Skip to content

Commit 655077b

Browse files
linux正常使用
1 parent 0c9e180 commit 655077b

File tree

4 files changed

+9
-64
lines changed

4 files changed

+9
-64
lines changed

qt_clion/CMakeLists.txt

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -23,45 +23,6 @@ if (NOT CMAKE_PREFIX_PATH)
2323
endif ()
2424

2525

26-
## 添加用户界面文件
27-
#set(FORMS
28-
# mainwindow.ui
29-
# )
30-
31-
# 自动生成用户界面文件的 C++ 代码
32-
#qt5_wrap_ui(UI_HEADERS ${FORMS})
33-
34-
# 自动生成用户界面文件的 C++ 代码
35-
# 自动生成用户界面文件的 C++ 代码
36-
#set(UI_HEADERS)
37-
if(WIN32)
38-
39-
#foreach(FORM ${FORMS})
40-
# get_filename_component(FORM_BASE ${FORM} NAME_WE)
41-
# set(UI_HEADER "${CMAKE_CURRENT_BINARY_DIR}/ui_${FORM_BASE}.h")
42-
# list(APPEND UI_HEADERS ${UI_HEADER})
43-
# add_custom_command(
44-
# OUTPUT ${UI_HEADER}
45-
# COMMAND ${Qt5_DIR}/../../../bin/uic ${CMAKE_CURRENT_SOURCE_DIR}/${FORM} -o ${UI_HEADER}
46-
# DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FORM}
47-
# )
48-
#endforeach()
49-
50-
else()
51-
# foreach(FORM ${FORMS})
52-
# get_filename_component(FORM_BASE ${FORM} NAME_WE)
53-
# set(UI_HEADER "${CMAKE_CURRENT_BINARY_DIR}/ui_${FORM_BASE}.h")
54-
# list(APPEND UI_HEADERS ${UI_HEADER})
55-
# add_custom_command(
56-
# OUTPUT ${UI_HEADER}
57-
# COMMAND /usr/bin/uic ${CMAKE_CURRENT_SOURCE_DIR}/${FORM} -o ${UI_HEADER}
58-
# DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FORM}
59-
# )
60-
# endforeach()
61-
62-
endif()
63-
64-
6526
add_executable(${PROJECT_NAME}
6627
main.cpp
6728
mainwindow.cpp)

qt_screenshot/CMakeLists.txt

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,8 @@ endif ()
3838
#set(UI_HEADERS)
3939
if(WIN32)
4040

41-
#foreach(FORM ${FORMS})
42-
# get_filename_component(FORM_BASE ${FORM} NAME_WE)
43-
# set(UI_HEADER "${CMAKE_CURRENT_BINARY_DIR}/ui_${FORM_BASE}.h")
44-
# list(APPEND UI_HEADERS ${UI_HEADER})
45-
# add_custom_command(
46-
# OUTPUT ${UI_HEADER}
47-
# COMMAND ${Qt5_DIR}/../../../bin/uic ${CMAKE_CURRENT_SOURCE_DIR}/${FORM} -o ${UI_HEADER}
48-
# DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FORM}
49-
# )
50-
#endforeach()
5141

52-
else()
53-
# foreach(FORM ${FORMS})
54-
# get_filename_component(FORM_BASE ${FORM} NAME_WE)
55-
# set(UI_HEADER "${CMAKE_CURRENT_BINARY_DIR}/ui_${FORM_BASE}.h")
56-
# list(APPEND UI_HEADERS ${UI_HEADER})
57-
# add_custom_command(
58-
# OUTPUT ${UI_HEADER}
59-
# COMMAND /usr/bin/uic ${CMAKE_CURRENT_SOURCE_DIR}/${FORM} -o ${UI_HEADER}
60-
# DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FORM}
61-
# )
62-
# endforeach()
42+
else(UNIX)
6343

6444
endif()
6545

@@ -74,6 +54,14 @@ add_executable(${PROJECT_NAME}
7454
${utils_src}
7555
)
7656

57+
58+
#find_package(PkgConfig REQUIRED)
59+
#pkg_search_module(GTK REQUIRED gtk+-3.0)
60+
#
61+
#include_directories(${GTK_INCLUDE_DIRS})
62+
#link_directories(${GTK_LIBRARY_DIRS})
63+
#target_link_libraries(${PROJECT_NAME} ${GTK_LIBRARIES})
64+
7765
#if(WIN32)
7866
# target_link_libraries(${PROJECT_NAME} xcb xcb-util)
7967
#endif()

qt_screenshot/fireshot.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
FireShot::FireShot(QWidget *parent) :
1212
QMainWindow(parent), ui(new Ui::FireShot) {
1313
ui->setupUi(this);
14-
#ifdef Q_OS_UNIX
15-
gdk_init(NULL, NULL);
16-
#endif // Q_OS_LINUX
1714
}
1815

1916
FireShot::~FireShot() {

qt_screenshot/utils/spdlog_wrapper.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
//
44

55
#include "spdlog_wrapper.h"
6-
#include <QDebug>
76
#include "spdlog/spdlog.h"
87
#include "spdlog/cfg/env.h" // support for loading levels from the environment variable
98
#include "spdlog/fmt/ostr.h" // support for user defined types

0 commit comments

Comments
 (0)