Simplification of management of QT_GUI dependency

You find a bug using QxOrm library and you know how to fix it : submit a patch on this forum

Simplification of management of QT_GUI dependency

Postby jduran » Sun May 27, 2012 11:22 pm

The patch simplifies the management of QT GUI dependency avoiding to configure the files QxOrm.pri and include/QxCommon/QxConfig.h. With the patch, only the file QxOrm.pri will be modified.

Code: Select all
--- QxOrm_orig/include/QxCommon/QxConfig.h      2012-04-02 09:36:10.000000000 +0200
+++ QxOrm/include/QxCommon/QxConfig.h   2012-05-28 01:02:52.758483483 +0200
@@ -67,7 +67,10 @@
 #define _QX_USE_GCC_EXPORT_ALL_SYMBOLS                                  1
 #define _QX_USE_GCC_VISIBILITY                                          0
 #define _QX_USE_ASSERT                                                  1
-#define _QX_ENABLE_QT_GUI_DEPENDENCY                                    1
+// _QX_ENABLE_QT_GUI_DEPENDENCY: Defined the in configuration.
+#ifndef _QX_ENABLE_QT_GUI_DEPENDENCY
+#error _QX_ENABLE_QT_GUI_DEPENDENCY macro has not defined
+#endif
 #define _QX_ENABLE_QT_NETWORK_DEPENDENCY                                1
 #define _QX_SUPPORT_COVARIANT_RETURN_TYPE                               1
 #define _QX_USE_QX_SINGLETON_X                                          1
diff -Naur QxOrm_orig/QxOrm.pri QxOrm/QxOrm.pri
--- QxOrm_orig/QxOrm.pri        2012-01-31 11:10:52.000000000 +0100
+++ QxOrm/QxOrm.pri     2012-05-28 01:07:27.968784535 +0200
@@ -27,11 +27,15 @@
 # Qt GUI module dependency #
 ############################
 
-# To remove QtGui dependency :
-#   1- in "./include/QxCommon/QxConfig.h" file, modify "_QX_ENABLE_QT_GUI_DEPENDENCY" constant to : "#define _QX_ENABLE_QT_GUI_DEPENDENCY 0"
-#   2- in "./QxOrm.pri" file, add the following line : "QT -= gui"
+# To remove QtGui dependency, uncomment the following line.
+# CONFIG += QX_NO_QT_GUI
 
-# QT -= gui
+CONFIG(QX_NO_QT_GUI){
+QT -= gui
+DEFINES += _QX_ENABLE_QT_GUI_DEPENDENCY=0
+} else {
+DEFINES += _QX_ENABLE_QT_GUI_DEPENDENCY=1
+}
 
 ###############################
 # boost Library Configuration #


jduran
jduran
 

Re: Simplification of management of QT_GUI dependency

Postby QxOrm admin » Mon May 28, 2012 7:15 am

Thanks, it will be done for the next version (QxOrm 1.2.5)...
QxOrm admin
 

Re: Simplification of management of QT_GUI dependency

Postby nickla » Thu Aug 09, 2012 2:32 pm

Why do you use qt gui in qxorm?

I compiled it without gui and use it in qt gui application. Everything is working fine.
nickla
 
Posts: 52
Joined: Wed Jul 11, 2012 4:19 pm
Location: Russia

Re: Simplification of management of QT_GUI dependency

Postby qxorm » Fri Aug 10, 2012 9:26 am

Why do you use qt gui in qxorm ?

By default, there is a dependency to QtGui module to provide some serialization process of QtGui classes (QBrush, QColor, QPicture, etc.).
But to disable this dependency, it's very easy to do : open QxOrm.pri file and read the section Qt GUI module dependency.
The patch provided by jduran is just to not have to modify QxOrm.pri file.
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: Simplification of management of QT_GUI dependency

Postby qxorm » Tue Dec 11, 2012 1:14 pm

it will be done for the next version (QxOrm 1.2.5)...

Done, you can test it with the following BETA version :
http://www.qxorm.com/version/QxOrm_1.2.5_BETA_04.zip
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am


Return to QxOrm - Submit a patch

Who is online

Users browsing this forum: No registered users and 4 guests

cron