From: <and...@us...> - 2009-07-20 13:13:10
|
Revision: 10166 http://plplot.svn.sourceforge.net/plplot/?rev=10166&view=rev Author: andrewross Date: 2009-07-20 12:00:27 +0000 (Mon, 20 Jul 2009) Log Message: ----------- Sort out g++ visibility issues with qt driver. Can now compile and run example with qt raster and qtwidget drivers. The c++ qt_example work, but the visibility issues with the pyqt4 bindings are not (yet) sorted. Modified Paths: -------------- trunk/bindings/qt_gui/plqt.cpp trunk/drivers/qt.cpp trunk/include/pldll.h.in trunk/include/qt.h Modified: trunk/bindings/qt_gui/plqt.cpp =================================================================== --- trunk/bindings/qt_gui/plqt.cpp 2009-07-20 01:47:47 UTC (rev 10165) +++ trunk/bindings/qt_gui/plqt.cpp 2009-07-20 12:00:27 UTC (rev 10166) @@ -34,9 +34,43 @@ #include "qt.h" // Global variables for Qt driver. -int vectorize = 0; -MasterHandler handler; +PLDLLIMPEXP_QT_DATA(int) vectorize = 0; +PLDLLIMPEXP_QT_DATA(MasterHandler) handler; +// Master Device Handler for multiple streams +// Only handles multiple Qt devices +MasterHandler::MasterHandler():QObject() +{ + masterDevice=NULL; +} + +bool MasterHandler::isMasterDevice(QtPLDriver* d) +{ + return d==masterDevice; +} + +void MasterHandler::setMasterDevice(QtPLDriver* d) +{ + masterDevice=d; +} + +void MasterHandler::DeviceChangedPage(QtPLDriver* d) +{ + if(d==masterDevice) + { + emit MasterChangedPage(); + } +} + +void MasterHandler::DeviceClosed(QtPLDriver* d) +{ + if(d==masterDevice) + { + emit MasterClosed(); + masterDevice=NULL; + } +} + ///////////// Generic Qt driver class ///////////////// QMutex QtPLDriver::mutex; Modified: trunk/drivers/qt.cpp =================================================================== --- trunk/drivers/qt.cpp 2009-07-20 01:47:47 UTC (rev 10165) +++ trunk/drivers/qt.cpp 2009-07-20 12:00:27 UTC (rev 10166) @@ -237,7 +237,7 @@ if(widget!=NULL && qt_family_check(pls)) {return;} #endif #if defined(PLD_qtwidget) || defined(PLD_extqt) - if(widget==NULL) widget=dynamic_cast<QtPLWidget*>((QWidget *) pls->dev); + if(widget==NULL) widget=dynamic_cast<QtPLWidget*>((QtPLWidget *) pls->dev); #endif if(widget==NULL) return; @@ -262,7 +262,7 @@ if(widget!=NULL && qt_family_check(pls)) {return;} #endif #if defined(PLD_qtwidget) || defined(PLD_extqt) - if(widget==NULL) widget=dynamic_cast<QtPLWidget*>((QWidget *) pls->dev); + if(widget==NULL) widget=dynamic_cast<QtPLWidget*>((QtPLWidget *) pls->dev); #endif if(widget==NULL) return; @@ -289,7 +289,7 @@ if(widget!=NULL && qt_family_check(pls)) {return;} #endif #if defined(PLD_qtwidget) || defined(PLD_extqt) - if(widget==NULL) widget=dynamic_cast<QtPLWidget*>((QWidget *) pls->dev); + if(widget==NULL) widget=dynamic_cast<QtPLWidget*>((QtPLWidget *) pls->dev); #endif if(widget==NULL) return; @@ -345,7 +345,7 @@ if(widget!=NULL && qt_family_check(pls)) {return;} #endif #if defined(PLD_qtwidget) || defined(PLD_extqt) - if(widget==NULL) widget=dynamic_cast<QtPLWidget*>((QWidget *) pls->dev); + if(widget==NULL) widget=dynamic_cast<QtPLWidget*>((QtPLWidget *) pls->dev); #endif if(widget==NULL) return; Modified: trunk/include/pldll.h.in =================================================================== --- trunk/include/pldll.h.in 2009-07-20 01:47:47 UTC (rev 10165) +++ trunk/include/pldll.h.in 2009-07-20 12:00:27 UTC (rev 10166) @@ -141,4 +141,12 @@ #define PLDLLIMPEXP_PLPLOT_MODULE_DATA(type) PLDLLIMPORT type #endif +#if defined(plplotqt${LIB_TAG}_EXPORTS) + #define PLDLLIMPEXP_QT PLDLLEXPORT + #define PLDLLIMPEXP_QT_DATA(type) PLDLLEXPORT type +#else + #define PLDLLIMPEXP_QT PLDLLIMPORT + #define PLDLLIMPEXP_QT_DATA(type) PLDLLIMPORT type +#endif + #endif /* __PL_DLL_H */ Modified: trunk/include/qt.h =================================================================== --- trunk/include/qt.h 2009-07-20 01:47:47 UTC (rev 10165) +++ trunk/include/qt.h 2009-07-20 12:00:27 UTC (rev 10166) @@ -88,48 +88,25 @@ #define QT_DEFAULT_X 842 #define QT_DEFAULT_Y 595 -class QtPLDriver; +class PLDLLIMPEXP_QT QtPLDriver; // Master Device Handler for multiple streams // Only handles multiple Qt devices -class MasterHandler:public QObject +class PLDLLIMPEXP_QT MasterHandler:public QObject { Q_OBJECT public: - MasterHandler():QObject() - { - masterDevice=NULL; - } + MasterHandler(); - ~MasterHandler(){} + bool isMasterDevice(QtPLDriver* d); - bool isMasterDevice(QtPLDriver* d) - { - return d==masterDevice; - } - - void setMasterDevice(QtPLDriver* d) - { - masterDevice=d; - } + void setMasterDevice(QtPLDriver* d); - void DeviceChangedPage(QtPLDriver* d) - { - if(d==masterDevice) - { - emit MasterChangedPage(); - } - } + void DeviceChangedPage(QtPLDriver* d); - void DeviceClosed(QtPLDriver* d) - { - if(d==masterDevice) - { - emit MasterClosed(); - masterDevice=NULL; - } - } + void DeviceClosed(QtPLDriver* d); + signals: void MasterChangedPage(); @@ -140,7 +117,7 @@ }; // Basic class, offering the common interface to all Qt plplot devices -class PLDLLIMPEXP_DRIVER QtPLDriver +class PLDLLIMPEXP_QT QtPLDriver { public: // Constructor, taking the device size as arguments @@ -196,7 +173,7 @@ #if defined (PLD_bmpqt) || defined(PLD_jpgqt) || defined (PLD_pngqt) || defined(PLD_ppmqt) || defined(PLD_tiffqt) // Driver painting whatever raster format Qt can save -class QtRasterDevice: public QtPLDriver, public QImage +class PLDLLIMPEXP_QT QtRasterDevice: public QtPLDriver, public QImage { public: QtRasterDevice(int i_iWidth=QT_DEFAULT_X, @@ -224,7 +201,7 @@ #if defined(PLD_svgqt) && QT_VERSION >= 0x040300 #include <QSvgGenerator> // Driver painting on an SVG device -class QtSVGDevice: public QtPLDriver, public QSvgGenerator +class PLDLLIMPEXP_QT QtSVGDevice: public QtPLDriver, public QSvgGenerator { public: QtSVGDevice(int i_iWidth=QT_DEFAULT_X, @@ -242,7 +219,7 @@ #if defined (PLD_epsqt) || defined (PLD_pdfqt) // Driver painting on an EPS or PDF device, uses QPrinter // A (possibly dummy) QApplication must be declared before use -class QtEPSDevice: public QtPLDriver, public QPrinter +class PLDLLIMPEXP_QT QtEPSDevice: public QtPLDriver, public QPrinter { public: #if QT_VERSION < 0x040400 @@ -336,7 +313,7 @@ // This widget allows to use plplot as a plotting engine in a Qt Application // The aspect ratio of the plotted data is constant, so gray strips are used // to delimit the page when the widget aspect ratio is not the one of the plotted page -class PLDLLIMPEXP_DRIVER QtPLWidget: public QWidget, public QtPLDriver +class PLDLLIMPEXP_QT QtPLWidget: public QWidget, public QtPLDriver { Q_OBJECT @@ -390,7 +367,7 @@ #endif #if defined (PLD_extqt) -class PLDLLIMPEXP_DRIVER QtExtWidget: public QtPLWidget +class PLDLLIMPEXP_QT QtExtWidget: public QtPLWidget { Q_OBJECT @@ -419,9 +396,9 @@ bool killed; }; -PLDLLIMPEXP_DRIVER void plsetqtdev(QtExtWidget* widget); // Registers the widget as plot device, as the widget has to be created in the Qt application GUI, prior to any plplot call. Must be called before plinit(). +PLDLLIMPEXP_QT void plsetqtdev(QtExtWidget* widget); // Registers the widget as plot device, as the widget has to be created in the Qt application GUI, prior to any plplot call. Must be called before plinit(). -PLDLLIMPEXP_DRIVER void plfreeqtdev(); // Deletes and unregisters the device. +PLDLLIMPEXP_QT void plfreeqtdev(); // Deletes and unregisters the device. #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |