Skip to content

Commit 5744fc9

Browse files
authored
Merge branch 'master' into j2doll/LargeData
2 parents 60c8fd3 + 1203179 commit 5744fc9

File tree

9 files changed

+1039
-13
lines changed

9 files changed

+1039
-13
lines changed

Example.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,6 @@ int main(int argc, char *argv[])
106106
107107
![](markdown.data/read-color.jpg)
108108
109-
## XlsxFactory
110-
- Load xlsx file and display on Qt widgets.
111-
- Moved to personal repository for advanced app.
112-
- https://j2doll.tistory.com/654
113-
- The source code of this program cannot be released because it contains a commercial license.
114-
115-
![](markdown.data/copycat.png)
116-
![](markdown.data/copycat2.jpg)
117-
118109
## [csv](https://github.com/QtExcel/QXlsx/tree/master/csv)
119110
- Save the `xlsx` file as a `csv` file.
120111
```cpp
@@ -130,6 +121,20 @@ int main(int argc, char *argv[])
130121
}
131122
```
132123

124+
## [ExcelViewer](https://github.com/QtExcel/QXlsx/tree/master/ExcelViewer)
125+
- Load xlsx file and display on Qt widgets.
126+
127+
![](markdown.data/excel-viewer.jpg)
128+
129+
## XlsxFactory
130+
- Load xlsx file and display on Qt widgets.
131+
- Moved to personal repository for advanced app.
132+
- https://j2doll.tistory.com/654
133+
- The source code of this program cannot be released because it contains a commercial license.
134+
135+
![](markdown.data/copycat.png)
136+
![](markdown.data/copycat2.jpg)
137+
133138
## [LargeData](https://github.com/QtExcel/QXlsx/tree/master/LargeData)
134139
- `LargeData` example demonstrates how to efficiently generate, write, and read large Excel `.xlsx` files using `QXlsx`.
135140
- It showcases:
@@ -168,7 +173,3 @@ LargeData -r 300000 -c 15 -S 60000 --use-style
168173
```
169174

170175

171-
172-
173-
174-

ExcelViewer/CMakeLists.txt

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
cmake_minimum_required(VERSION 3.26)
2+
project(ExcelViewer LANGUAGES CXX)
3+
4+
set(CMAKE_CXX_STANDARD 17)
5+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
6+
7+
set(CMAKE_AUTOMOC ON)
8+
set(CMAKE_AUTOUIC ON)
9+
set(CMAKE_AUTORCC ON)
10+
11+
find_package(Qt6 REQUIRED COMPONENTS Widgets)
12+
13+
# Tell QXlsx which Qt major version to use.
14+
set(QT_VERSION_MAJOR 6)
15+
16+
# Add QXlsx from one directory above the current project.
17+
add_subdirectory(
18+
${CMAKE_CURRENT_SOURCE_DIR}/../QXlsx
19+
${CMAKE_CURRENT_BINARY_DIR}/QXlsx_build
20+
)
21+
22+
add_executable(ExcelViewer
23+
main.cpp
24+
mainwindow.h
25+
mainwindow.cpp
26+
excelmodel.h
27+
excelmodel.cpp
28+
)
29+
30+
target_link_libraries(ExcelViewer PRIVATE
31+
Qt6::Widgets
32+
QXlsx::QXlsx
33+
)
34+
35+
# Get full git hash of QXlsx (40 characters)
36+
execute_process(
37+
COMMAND git rev-parse HEAD
38+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..
39+
OUTPUT_VARIABLE QXLSX_GIT_FULL_HASH
40+
OUTPUT_STRIP_TRAILING_WHITESPACE
41+
)
42+
43+
message(STATUS "QXlsx Git full hash = ${QXLSX_GIT_FULL_HASH}")
44+
45+
# Pass it to C++ code as a define
46+
add_compile_definitions(QXLSX_GIT_FULL_HASH="${QXLSX_GIT_FULL_HASH}")
47+
48+

0 commit comments

Comments
 (0)