From: mpv Date: Wed, 8 Jun 2005 04:33:32 +0000 (+0000) Subject: Porting to Mandrake 10.1 and new products: X-Git-Tag: T2_2_4a~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4fbdb16d3bd55a9f2050392e4da061bc266e77ab;p=modules%2Fkernel.git Porting to Mandrake 10.1 and new products: porting to the new qt (roll back PatchQt for it), new python includes order (python must be included before qt - it has "slots" field in the class declaration) --- diff --git a/src/SALOMEGUI/QAD_Desktop.cxx b/src/SALOMEGUI/QAD_Desktop.cxx index cbc5a92e7..ba0bb2d7d 100644 --- a/src/SALOMEGUI/QAD_Desktop.cxx +++ b/src/SALOMEGUI/QAD_Desktop.cxx @@ -794,7 +794,11 @@ void QAD_Desktop::createActions() myStdActions.insert( DefaultPlot2dId, viewerPlot2dAction1 ); myQAG->addTo( &myDefaultViewer ); - QAD_ASSERT(connect( myQAG, SIGNAL(selected(QActionP * )), this, SLOT(onDefaultViewer(QActionP *) ))); +#if (QT_VERSION >= 0x030303) // mpv: do not use patches for QT version >= 3.3.3 + QAD_ASSERT(connect( myQAG, SIGNAL(selected(QAction* )), this, SLOT(onDefaultViewer(QAction*) ))); +#else + QAD_ASSERT(connect( myQAG, SIGNAL(selected(QActionP* )), this, SLOT(onDefaultViewer(QActionP *) ))); +#endif //VRV: T2.5 - add default viewer myPrefPopup.insertSeparator(); diff --git a/src/SALOMEGUI/QAD_Desktop.h b/src/SALOMEGUI/QAD_Desktop.h index 35c71416e..caa0e8603 100644 --- a/src/SALOMEGUI/QAD_Desktop.h +++ b/src/SALOMEGUI/QAD_Desktop.h @@ -236,7 +236,12 @@ protected slots: void onPlot2d(); void onConsoleFontAction(); //VRV: T2.5 - add default viewer +#if (QT_VERSION >= 0x030303) // mpv: do not use Qt patch for Qt vewrsion >= 3.3.3 + void onDefaultViewer( QAction * theAction); +#else + void onDefaultViewer( QAction * theAction) {}; void onDefaultViewer( QActionP * theAction); +#endif //VRV: T2.5 - add default viewer void onViewerTrihedron(); diff --git a/src/SALOMEGUI/QAD_RightFrame.cxx b/src/SALOMEGUI/QAD_RightFrame.cxx index 96e3d69b6..583540cb7 100644 --- a/src/SALOMEGUI/QAD_RightFrame.cxx +++ b/src/SALOMEGUI/QAD_RightFrame.cxx @@ -26,13 +26,15 @@ // Module : SALOME // $Header$ -#include "QAD_PyEditor.h" // this include must be first (see PyInterp_base.h)! +// mpv 28.02.2005: if Python 2.4 python includes must be first: it uses "slots" field, redefined in qt +#include "QAD_PyInterp.h" + #include "QAD_RightFrame.h" #include "QAD_Application.h" #include "QAD_Desktop.h" #include "QAD_StudyFrame.h" #include "QAD_Tools.h" -#include "QAD_PyInterp.h" +#include "QAD_PyEditor.h" #include @@ -62,7 +64,10 @@ QAD_RightFrame::QAD_RightFrame(QWidget *theParent, myViewType(theTypeView), myInterp(theInterp) { +#if (QT_VERSION < 0x030303) +// mpv: do not use patchqt for qt version >= 3.3.3 this->setCompressEnabled( true ); +#endif QAD_Desktop* Desktop = QAD_Application::getDesktop(); int DesktopHeight = Desktop->getMainFrame()->width(); @@ -193,7 +198,10 @@ QAD_RightFrame::QAD_RightFrame(QWidget *theParent, myViewFrame->setMinimumSize( 1, 1 ); mySplitter = new QAD_Splitter( Qt::Horizontal, this ); mySplitter->setMinimumSize( 1, 1 ); +#if (QT_VERSION < 0x030303) +// mpv: do not use patchqt for qt version >= 3.3.3 mySplitter->setCompressEnabled( true ); +#endif myPyEditor = new QAD_PyEditor(myInterp, theMutex, mySplitter ,"Python Interpreter"); myPyEditor->setMinimumSize( 1, 1 ); @@ -252,9 +260,14 @@ QAD_PyEditor* QAD_RightFrame::getPyEditor() const */ void QAD_RightFrame::compressUp() { +#if (QT_VERSION < 0x030303) +// mpv: do not use patchqt for qt version >= 3.3.3 + QSplitterPHandle* h = getHandleAfter(myViewFrame); if (h) h->compressBefore(); + +#endif } /*! @@ -262,9 +275,14 @@ void QAD_RightFrame::compressUp() */ void QAD_RightFrame::unCompressUp() { +#if (QT_VERSION < 0x030303) +// mpv: do not use patchqt for qt version >= 3.3.3 + QSplitterPHandle* h = getHandleAfter(myViewFrame); if (h) h->unCompressBefore(); + +#endif } /*! @@ -272,9 +290,14 @@ void QAD_RightFrame::unCompressUp() */ void QAD_RightFrame::compressBottom() { +#if (QT_VERSION < 0x030303) +// mpv: do not use patchqt for qt version >= 3.3.3 + QSplitterPHandle* h = getHandleAfter(myViewFrame); if (h) h->compressAfter(); + +#endif } /*! @@ -282,51 +305,95 @@ void QAD_RightFrame::compressBottom() */ void QAD_RightFrame::unCompressBottom() { +#if (QT_VERSION < 0x030303) +// mpv: do not use patchqt for qt version >= 3.3.3 + QSplitterPHandle* h = getHandleAfter(myViewFrame); if (h) h->unCompressAfter(); + +#endif } void QAD_RightFrame::compressLeft() { +#if (QT_VERSION < 0x030303) +// mpv: do not use patchqt for qt version >= 3.3.3 + QSplitterPHandle* h = mySplitter->getHandleAfter( getPyEditor() ); if( h ) h->compressBefore(); + +#endif } void QAD_RightFrame::compressRight() { +#if (QT_VERSION < 0x030303) +// mpv: do not use patchqt for qt version >= 3.3.3 + QSplitterPHandle* h = mySplitter->getHandleAfter( getPyEditor() ); if( h ) h->compressAfter(); + +#endif } void QAD_RightFrame::unCompressLeft() { +#if (QT_VERSION < 0x030303) +// mpv: do not use patchqt for qt version >= 3.3.3 + QSplitterPHandle* h = mySplitter->getHandleAfter( getPyEditor() ); if( h ) h->unCompressBefore(); + +#endif } void QAD_RightFrame::unCompressRight() { +#if (QT_VERSION < 0x030303) +// mpv: do not use patchqt for qt version >= 3.3.3 + QSplitterPHandle* h = mySplitter->getHandleAfter( getPyEditor() ); if( h ) h->unCompressAfter(); + +#endif } bool QAD_RightFrame::isCompressedViewFrame() const { +#if (QT_VERSION < 0x030303) +// mpv: do not use patchqt for qt version >= 3.3.3 + return isCompressed( myViewFrame ); +#else + return false; +#endif } bool QAD_RightFrame::isCompressedPython() const { +#if (QT_VERSION < 0x030303) +// mpv: do not use patchqt for qt version >= 3.3.3 + return mySplitter->isCompressed( getPyEditor() ); + +#else + return false; +#endif } bool QAD_RightFrame::isCompressedMessage() const { +#if (QT_VERSION < 0x030303) +// mpv: do not use patchqt for qt version >= 3.3.3 + return mySplitter->isCompressed( getMessage() ); -} +#else + return false; +#endif +} diff --git a/src/SALOMEGUI/QAD_StudyFrame.cxx b/src/SALOMEGUI/QAD_StudyFrame.cxx index fa1642d6d..0cfc30df7 100644 --- a/src/SALOMEGUI/QAD_StudyFrame.cxx +++ b/src/SALOMEGUI/QAD_StudyFrame.cxx @@ -31,7 +31,9 @@ \brief Frame window which contains QAD_LeftFrame and QAD_RightFrame. */ -#include "QAD_PyInterp.h" // this include must be first (see PyInterp_base.h)! +// mpv 28.02.2005: if Python 2.4 python includes must be first: it uses "slots" field, redefined in qt +#include "QAD_PyInterp.h" + #include "QAD_StudyFrame.h" #include "QAD_StudyFrame.h" #include "QAD_RightFrame.h" @@ -64,7 +66,10 @@ QAD_StudyFrame::QAD_StudyFrame(QAD_Study* theStudy, QWidget* theParent, setPalette(QAD_Application::getPalette()); mySplitter = new QAD_Splitter( Qt::Horizontal, this); +#if (QT_VERSION < 0x030303) +// mpv: do not use patchqt for qt version >= 3.3.3 mySplitter->setCompressEnabled( true ); +#endif setCentralWidget(mySplitter); myLeftFrm = new QAD_LeftFrame(myStudy->getStudyDocument(), mySplitter, theTitle ); @@ -134,40 +139,74 @@ void QAD_StudyFrame::closeEvent(QCloseEvent* e) */ void QAD_StudyFrame::compressLeft() { +#if (QT_VERSION < 0x030303) +// mpv: do not use patchqt for qt version >= 3.3.3 + QSplitterPHandle* h = mySplitter->getHandleAfter(myLeftFrm); if( h ) h->compressBefore(); + +#endif } void QAD_StudyFrame::compressRight() { +#if (QT_VERSION < 0x030303) +// mpv: do not use patchqt for qt version >= 3.3.3 + QSplitterPHandle* h = mySplitter->getHandleAfter(myLeftFrm); if( h ) h->compressAfter(); + +#endif } void QAD_StudyFrame::unCompressLeft() { +#if (QT_VERSION < 0x030303) +// mpv: do not use patchqt for qt version >= 3.3.3 + QSplitterPHandle* h = mySplitter->getHandleAfter(myLeftFrm); if( h ) h->unCompressBefore(); + +#endif } void QAD_StudyFrame::unCompressRight() { +#if (QT_VERSION < 0x030303) +// mpv: do not use patchqt for qt version >= 3.3.3 + QSplitterPHandle* h = mySplitter->getHandleAfter(myLeftFrm); if( h ) h->unCompressAfter(); + +#endif } bool QAD_StudyFrame::isCompressedLeft() const { +#if (QT_VERSION < 0x030303) +// mpv: do not use patchqt for qt version >= 3.3.3 + return mySplitter->isCompressed(myLeftFrm); + +#else + return false; +#endif } bool QAD_StudyFrame::isCompressedRight() const { +#if (QT_VERSION < 0x030303) +// mpv: do not use patchqt for qt version >= 3.3.3 + return mySplitter->isCompressed(myRightFrm); + +#else + return false; +#endif } /*!