Salome HOME
Moved some functionality to VTKViewer_Utilities.h
[modules/kernel.git] / src / PatchQt / qsplitterP.cxx
index f44990ee392288051a734140c5e9f19f98364aeb..3983746b2f07ef6eb8593ead7c1ef24d528e296d 100644 (file)
@@ -1,28 +1,8 @@
-//  SALOME PatchQt : patch for Qt
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
-//
-//
-//
-//  File   : qsplitterP.cxx
-//  Module : SALOME
+/////////////////////////////////////////////////////////////////////////////
+// Module      : PatchQt
+// File        : qsplitterP.cxx
+// Description : the patch for Qt's QSplitter class (qsplitter.cpp)
+/////////////////////////////////////////////////////////////////////////////
 
 /****************************************************************************
 ** $Id$
@@ -60,6 +40,7 @@
 ** not clear to you.
 **
 **********************************************************************/
+
 #include "qsplitterP.h"
 #ifndef QT_NO_COMPLEXWIDGETS
 
@@ -150,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()));
@@ -874,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 );