I have a Qt application (Qt5) on linux which runs (and looks) perfectly fine. I have developed this using Qt Creator and so it gets built with the help of qmake by default.
But when I use cmake to build this project, the colors of all the widgets are disturbed (shown as below). Am I missing something anything in my CMakeLists file?
Here is my cmake file:
cmake_minimum_required(VERSION 3.0.2)
set (PROJECT_NAME QtTrialBuild)
project (${PROJECT_NAME})
find_package(Qt5Widgets REQUIRED)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include_directories(${Qt5Widgets_INCLUDES})
add_definitions(${Qt5Widgets_DEFINITIONS})
set(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
set ( SOURCES
main.cpp
imageviewer.cpp
CRubberBand.cpp
CImageSelector.cpp
CSelectablePicture.cpp
CScale.cpp
)
set ( MOC_HEADERS
imageviewer.h
CRubberBand.h
CImageSelector.h
CSelectablePicture.h
CScale.h
)
set ( UIS
imageviewer.ui
)
qt5_wrap_ui( UI_HEADERS ${UIS} )
qt5_wrap_cpp( MOC_SRCS ${MOC_HEADERS} )
add_executable(${PROJECT_NAME} ${SOURCES} ${MOC_SRCS} ${UI_HEADERS})
target_link_libraries( ${PROJECT_NAME} Qt5::Widgets)
When built with Qt Creator this is how the window looks (and that's how wanted it to be too)
But with Cmake
this is how it looked when built with cmake
The colors of the buttons, borders and pop-up windows are changed. Did I miss any parameters or did I forget to add something in the cmakelists?