Salome HOME
Moved some functionality to VTKViewer_Utilities.h
[modules/kernel.git] / src / PatchQt / qsplitterP.cxx
index 49decad82d1b9eb6caa4b74bd71bd15573a4a494..3983746b2f07ef6eb8593ead7c1ef24d528e296d 100644 (file)
@@ -1,4 +1,9 @@
-using namespace std;
+/////////////////////////////////////////////////////////////////////////////
+// Module      : PatchQt
+// File        : qsplitterP.cxx
+// Description : the patch for Qt's QSplitter class (qsplitter.cpp)
+/////////////////////////////////////////////////////////////////////////////
+
 /****************************************************************************
 ** $Id$
 **
@@ -35,6 +40,7 @@ using namespace std;
 ** not clear to you.
 **
 **********************************************************************/
+
 #include "qsplitterP.h"
 #ifndef QT_NO_COMPLEXWIDGETS
 
@@ -54,6 +60,7 @@ using namespace std;
 
 #include <qobjectlist.h>
 #include <qapplication.h> //sendPostedEvents
+using namespace std;
 
 #define SPLITTER_ICON_WIDTH 10
 #define SPLITTER_ICON_HEIGHT 12
@@ -124,10 +131,6 @@ QSplitterPHandle::QSplitterPHandle( Qt::Orientation o,
   left->setCursor( arrowCursor );      right->setCursor( arrowCursor );
   unleft->setCursor( arrowCursor ); unright->setCursor( arrowCursor );
 
-// VSR 21/11/02 -> ================================
-  setMinimumSize( 1, 1 );
-// VSR 21/11/02 <- ================================
-
   connect(left,    SIGNAL(clicked()), this, SLOT(onBeforeCompress()));
   connect(right,   SIGNAL(clicked()), this, SLOT(onAfterCompress()));
   connect(unleft,  SIGNAL(clicked()), this, SLOT(onBeforeUnCompress()));
@@ -848,8 +851,8 @@ void QSplitterP::moveAfter( int pos, int id, bool upLeft )
        }
     } else {
        int right = pick( w->geometry().bottomRight() );
-
-               int dd = right - pos + 1;
+       int ddd = pick( QSize(contentsRect().width(), contentsRect().height() ) ) - pos;
+               int dd = QMIN(right - pos + 1, ddd);
        dd = QMAX( pick(minSize(w)), QMIN(dd, pick(maxSize(w))));
        int newRight = pos+dd-1;
        setG( w, pos, dd );