]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Porting to Qt4.
authormkr <mkr@opencascade.com>
Mon, 25 Jun 2007 12:24:57 +0000 (12:24 +0000)
committermkr <mkr@opencascade.com>
Mon, 25 Jun 2007 12:24:57 +0000 (12:24 +0000)
src/LightApp/LightApp.pro
src/LightApp/Makefile.am
src/Makefile.am
src/SUPERVGraph/SUPERVGraph.cxx
src/SUPERVGraph/SUPERVGraph.h
src/SUPERVGraph/SUPERVGraph.pro [new file with mode: 0644]
src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx
src/SUPERVGraph/SUPERVGraph_ViewFrame.h
src/SUPERVGraph/SUPERVGraph_ViewManager.cxx
src/SUPERVGraph/SUPERVGraph_ViewManager.h
src/src.pro

index 2e7d75a87b13bb12685ea3369e4d56010111b0ea..aa420964df259bdacf17ce84b67998bda7cd82ed 100644 (file)
@@ -54,7 +54,7 @@ INCLUDEPATH += $${PYTHON_INCLUDES} $${QT_INCLUDES} $${CAS_CPPFLAGS} $${HDF5_INCL
 #endif
 
 #if ENABLE_SUPERVGRAPHVIEWER
-#  INCLUDEPATH += ../SUPERVGraph
+  INCLUDEPATH += ../SUPERVGraph
 #else !ENABLE_SUPERVGRAPHVIEWER
 #  DEFINES += DISABLE_SUPERVGRAPHVIEWER
 #endif
@@ -129,7 +129,7 @@ LIBS += $${QT_MT_LIBS} -L../../lib -lsuit -lstd -lCAM -lLogWindow $${CAS_KERNEL}
 #endif
 
 #if ENABLE_SUPERVGRAPHVIEWER
-#  LIBS += -lSUPERVGraph
+  LIBS += -lSUPERVGraph
 #endif
 
 CONFIG -= debug release debug_and_release
index 6c69a32e6922adb05368c145a8a2e97b8e03ea27..094d97c6792bc40b8ed6877e2dc91686d99e4e06 100755 (executable)
@@ -242,5 +242,5 @@ if ENABLE_PYCONSOLE
   libLightApp_la_LIBADD+= ../PyInterp/libPyInterp.la ../PyConsole/libPyConsole.la
 endif
 if ENABLE_SUPERVGRAPHVIEWER
-#  libLightApp_la_LIBADD+= ../SUPERVGraph/libSUPERVGraph.la
+  libLightApp_la_LIBADD+= ../SUPERVGraph/libSUPERVGraph.la
 endif
index fc310ff247fa6942a9150f580d4a0920580d2db9..7ada29911ad8fac0cc8552689b8e86367b8a0654 100755 (executable)
@@ -62,7 +62,7 @@ if ENABLE_SUPERVGRAPHVIEWER
 # VSR: this is the original packages list
 #  SUBDIRS += SUPERVGraph
 # VSR: already migrated to Qt4 packages
-  SUBDIRS += 
+  SUBDIRS += SUPERVGraph
 endif
 SUBDIRS += Event LightApp ResExporter
 
index d570c614a15a59d85b8fe54b226264cd392845b6..041a680cd2e251ad8bb316296cd1f054b9061b0a 100755 (executable)
@@ -29,6 +29,9 @@
 #include "SUPERVGraph.h"
 #include "SUPERVGraph_ViewFrame.h"
 
+#include "SUIT_Desktop.h"
+#include "SUIT_ViewWindow.h"
+
 using namespace std;
 
 /*!
@@ -36,7 +39,7 @@ using namespace std;
 */
 SUIT_ViewWindow* SUPERVGraph::createView(SUIT_Desktop* parent)
 {
-  return new SUPERVGraph_ViewFrame( parent/*, "vtkView"*/ ); 
+  return new SUPERVGraph_ViewFrame( parent ); 
 }
 
 extern "C"
index 22ca3c4fded59e1cb8c18d01123c7f8f9001c42c..1aebcc100e3232946d60d53a21b72083d5aeb2c7 100755 (executable)
@@ -29,9 +29,6 @@
 #ifndef SUPERVGraph_HeaderFile
 #define SUPERVGraph_HeaderFile
 
-#include "SUIT_Desktop.h"
-#include "SUIT_ViewWindow.h"
-
 #ifdef WIN32
 #ifdef SUPERVGRAPH_EXPORTS
 #define SUPERVGRAPH_EXPORT __declspec(dllexport)
 #pragma warning ( disable: 4251 )
 #endif
 
+#include <QObject>
+
+class SUIT_Desktop;
+class SUIT_ViewWindow;
+
 class SUPERVGRAPH_EXPORT SUPERVGraph : public QObject
 {
   Q_OBJECT
 
 public :
 
-    /*Standard_EXPORT*/ static SUIT_ViewWindow* createView ( SUIT_Desktop* parent);
+    static SUIT_ViewWindow* createView ( SUIT_Desktop* parent);
   
 };
 
diff --git a/src/SUPERVGraph/SUPERVGraph.pro b/src/SUPERVGraph/SUPERVGraph.pro
new file mode 100644 (file)
index 0000000..a83a045
--- /dev/null
@@ -0,0 +1,49 @@
+TEMPLATE = lib
+TARGET = SUPERVGraph
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+QT_INCLUDES = $$(QTDIR)/include $$(QTDIR)/include/QtCore $$(QTDIR)/include/QtGui $$(QTDIR)/include/QtOpenGL $$(QTDIR)/include/QtXml
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
+
+BOOST_CPPFLAGS = $$(BOOSTDIR)/include
+
+QT_MT_LIBS = -L$$(QTDIR)/lib -lQtCore -lQtXml -lQtGui -lQtOpenGL
+
+INCLUDEPATH += $${QT_INCLUDES} $${CAS_CPPFLAGS} $${PYTHON_INCLUDES} $${BOOST_CPPFLAGS} ../Qtx ../SUIT ../OBJECT
+
+LIBS += $${QT_MT_LIBS} -L../../lib -lsuit
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32 
+DEFINES += SUPERVGRAPH_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
+
+HEADERS  = SUPERVGraph_ViewFrame.h
+HEADERS += SUPERVGraph_ViewManager.h
+HEADERS += SUPERVGraph_ViewModel.h
+HEADERS += SUPERVGraph.h
+
+SOURCES  = SUPERVGraph.cxx
+SOURCES += SUPERVGraph_ViewFrame.cxx
+SOURCES += SUPERVGraph_ViewManager.cxx
+SOURCES += SUPERVGraph_ViewModel.cxx
+
+TRANSLATIONS = resources/SUPERVGraph_images.ts \
+               resources/SUPERVGraph_msg_en.ts
+
+ICONS   = resources/*.png
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = $$ICONS resources/*.qm
+resources.path = ../../resources
+
+INSTALLS += includes resources
index e20b59768f619c1c862ef1df042310df1ff1e7c5..fe2c9b1377e8c4b78019632a14db5e13cb7534da 100755 (executable)
@@ -32,8 +32,8 @@
 #include <SUIT_Session.h>
 
 //QT Include
-#include <qlayout.h>
-#include <qcolordialog.h>
+#include <QVBoxLayout>
+#include <QToolBar>
 
 using namespace std;
 
@@ -57,7 +57,7 @@ SUPERVGraph_View::SUPERVGraph_View( SUPERVGraph_View* theParent ): QWidget( theP
 /*!
   Builds popup for SUPERVGraph viewer
 */
-void SUPERVGraph_View::contextMenuPopup( QPopupMenu* )
+void SUPERVGraph_View::contextMenuPopup( QMenu* )
 {
   // to be implemented
 }
@@ -94,8 +94,8 @@ SUPERVGraph_ViewFrame::SUPERVGraph_ViewFrame( SUIT_Desktop* theDesktop )
   setBackgroundColor(QColor(R,G,B));*/
 
   myToolBar = new QToolBar(this);
-  myToolBar->setCloseMode(QDockWindow::Undocked);
-  myToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
+  //myToolBar->setCloseMode(QDockWindow::Undocked);
+  myToolBar->setWindowTitle(tr("LBL_TOOLBAR_LABEL"));
   createActions();
   createToolBar();
 }
@@ -107,18 +107,18 @@ void SUPERVGraph_ViewFrame::createActions()
 {
   if (!myActionsMap.isEmpty()) return;
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
-  QAction* aAction;
+  QtxAction* aAction;
 
   // Panning
-  aAction = new QAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_PAN" ) ),
-                       tr( "MNU_PAN_VIEW" ), 0, this);
+  aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_PAN" ) ),
+                         tr( "MNU_PAN_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_PAN_VIEW"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewPan()));
   myActionsMap[ PanId ] = aAction;
 
   // Reset
-  aAction = new QAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_RESET" ) ),
-                       tr( "MNU_RESET_VIEW" ), 0, this);
+  aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_RESET" ) ),
+                         tr( "MNU_RESET_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_RESET_VIEW"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewReset()));
   myActionsMap[ ResetId ] = aAction;
@@ -278,8 +278,11 @@ void SUPERVGraph_ViewFrame::onViewFitAll()
 */
 void SUPERVGraph_ViewFrame::setBackgroundColor( const QColor& color )
 {
-    if (myView)
-      myView->setPaletteBackgroundColor(color);
+  if (myView) {
+    QPalette palette;
+    palette.setColor(myView->backgroundRole(), color);
+    myView->setPalette(palette);
+  }
 }
 
 /*!
@@ -288,8 +291,8 @@ void SUPERVGraph_ViewFrame::setBackgroundColor( const QColor& color )
 QColor SUPERVGraph_ViewFrame::backgroundColor() const
 {
   if (myView)
-    return myView->paletteBackgroundColor();
-  return QMainWindow::backgroundColor();
+    return myView->palette().color( myView->backgroundRole() );
+  return palette().color( backgroundRole() );
 }
 
 /*!
index 2a5e7f03b39dbbb410383c69ac6fb72fb6bda5fb..be33df74d73594bad519795e470af6b60b15fa32 100755 (executable)
@@ -35,7 +35,7 @@
 #include "SUIT_PopupClient.h"
 #include "SUIT_ViewWindow.h"
 
-#include <qaction.h>
+#include <QtxAction.h>
 
 #ifdef WIN32
 #pragma warning ( disable:4251 )
@@ -54,7 +54,7 @@ class SUPERVGRAPH_EXPORT SUPERVGraph_View: public QWidget, public SUIT_PopupClie
 
   /* redefine functions from SUIT_PopupClient */
   virtual QString popupClientType() const { return Type(); }
-  virtual void    contextMenuPopup( QPopupMenu* );
+  virtual void    contextMenuPopup( QMenu* );
   
   virtual void resizeView( QResizeEvent* theEvent ) {};
   
@@ -125,7 +125,7 @@ class SUPERVGRAPH_EXPORT SUPERVGraph_ViewFrame : public SUIT_ViewWindow {
 
   //! Actions ID
   enum { PanId, ResetId };
-  typedef QMap<int, QAction*> ActionsMap;
+  typedef QMap<int, QtxAction*> ActionsMap;
 
   ActionsMap       myActionsMap;
   QToolBar*        myToolBar;
index 0f890c4b564a1ac81870d5aa77ca9cfdc33fd875..e2ae70d27defc3e9b295524f38b2bba07254c3b4 100644 (file)
@@ -18,6 +18,8 @@
 //
 #include "SUPERVGraph_ViewManager.h"
 
+#include "SUIT_ViewWindow.h"
+
 int SUPERVGraph_ViewManager::myMaxId = 0;
 
 /*!
@@ -44,15 +46,15 @@ SUPERVGraph_ViewManager::~SUPERVGraph_ViewManager()
 */
 void SUPERVGraph_ViewManager::setViewName(SUIT_ViewWindow* theView)
 {
-  int aPos = myViews.find(theView);
-  theView->setCaption( QString( "SUPERVISION  scene:%1 - viewer:%2" ).arg( myId ).arg(aPos+1));
+  int aPos = myViews.indexOf(theView);
+  theView->setWindowTitle( QString( "SUPERVISION  scene:%1 - viewer:%2" ).arg( myId ).arg(aPos+1));
 }
 
 /*!
   Fills popup menu with custom actions
  \param popup - popup menu to be filled with
 */
-void SUPERVGraph_ViewManager::contextMenuPopup( QPopupMenu* thePopup)
+void SUPERVGraph_ViewManager::contextMenuPopup( QMenu* thePopup)
 {
   SUIT_ViewManager::contextMenuPopup( thePopup );
   // to be implemented
index 94c5a850df26ef5936aecc53e6dc2dd4cdec7d50..313beca3bcfec90a2dbc765698e5b8df75e21436 100644 (file)
@@ -21,7 +21,6 @@
 
 #include "SUPERVGraph.h"
 
-#include "SUPERVGraph_ViewModel.h"
 #include "SUIT_ViewManager.h"
 
 class SUIT_Desktop;
@@ -34,7 +33,7 @@ public:
   SUPERVGraph_ViewManager( SUIT_Study* theStudy, SUIT_Desktop* theDesktop, SUIT_ViewModel* theViewModel = 0 );
   ~SUPERVGraph_ViewManager();
 
-  virtual void      contextMenuPopup( QPopupMenu* thePopup );
+  virtual void      contextMenuPopup( QMenu* thePopup );
 
 protected:
   void              setViewName(SUIT_ViewWindow* theView);
index fc54392e128c2d687329c39751c17ec68500a40c..a621136a915629ec1806c60c5efcbe6a08b206f4 100644 (file)
@@ -21,6 +21,7 @@ SUBDIRS += OCCViewer
 SUBDIRS += SOCC
 SUBDIRS += Plot2d
 SUBDIRS += SPlot2d
+SUBDIRS += SUPERVGraph
 SUBDIRS += Event
 SUBDIRS += LightApp
 SUBDIRS += ResExporter