Back to index

salome-gui  6.5.0
QtxGridBox.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 // File:      QtxGridBox.h
00021 // Author:    Sergey TELKOV
00022 //
00023 #ifndef QTXGRIDBOX_H
00024 #define QTXGRIDBOX_H
00025 
00026 #include "Qtx.h"
00027 
00028 #include <QWidget>
00029 
00030 class QGridLayout;
00031 
00032 class QTX_EXPORT QtxGridBox : public QWidget
00033 {
00034   Q_OBJECT
00035 
00036   class Space;
00037 
00038 public:
00039   QtxGridBox( QWidget* = 0, const int = 5, const int = 5 );
00040   QtxGridBox( const int, Qt::Orientation, QWidget* = 0, const int = 5, const int = 5 );
00041   virtual ~QtxGridBox();
00042 
00043   int             columns() const;
00044   Qt::Orientation orientation() const;
00045 
00046   void            setColumns( const int );
00047   void            setOrientation( Qt::Orientation );
00048 
00049   void            setLayout( const int, Qt::Orientation );
00050 
00051   bool            skipInvisible() const;
00052   void            setSkipInvisible( const bool );
00053 
00054   void            addSpace( const int );
00055 
00056   int             insideMargin() const;
00057   int             insideSpacing() const;
00058   void            setInsideMargin( const int );
00059   void            setInsideSpacing( const int );
00060 
00061   virtual bool    eventFilter( QObject*, QEvent* );
00062 
00063 protected:
00064   void            childEvent( QChildEvent* );
00065 
00066 private:
00067   void            skip();
00068   void            arrangeWidgets();
00069   void            placeWidget( QWidget* );
00070 
00071 private:
00072   int             myCols;
00073   bool            mySkip;
00074   Qt::Orientation myOrient;
00075   QGridLayout*    myLayout;
00076 
00077   int             myCol, myRow;
00078 };
00079 
00080 #endif