cmake: Make it compile with Qt4
authorLuís Pereira <luis.artur.pereira@gmail.com>
Tue, 5 Dec 2017 12:45:01 +0000 (12:45 +0000)
committerAlf Gaida <agaida@siduction.org>
Fri, 8 Dec 2017 23:17:28 +0000 (00:17 +0100)
Qt4 doesn't have Qt::AA_UseHighDpiPixmaps.

src/CMakeLists.txt
src/obconf-qt.cpp

index 20ca9f3..249cf0a 100644 (file)
@@ -100,6 +100,10 @@ add_definitions(
   -DTHEME_DIR="${CMAKE_INSTALL_FULL_DATAROOTDIR}/openbox/themes"
 )
 
+if (USE_QT4)
+    add_definitions(-DUSE_QT4)
+endif()
+
 target_link_libraries(obconf-qt
   ${QTX_LIBRARIES}
   ${GLIB_LIBRARIES}
index 5912fda..207a3ff 100644 (file)
@@ -180,7 +180,9 @@ static gboolean prop_get_string_utf8(Window win, Atom prop, gchar** ret) {
 
 int main(int argc, char** argv) {
   QApplication app(argc, argv);
+#ifndef USE_QT4
   app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
+#endif
 
   // load translations
   QTranslator qtTranslator, translator;