Salome HOME
Updated copyright comment
[modules/gui.git] / src / Qtx / QtxGridBox.h
1 // Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 // File:      QtxGridBox.h
21 // Author:    Sergey TELKOV
22 //
23 #ifndef QTXGRIDBOX_H
24 #define QTXGRIDBOX_H
25
26 #include "Qtx.h"
27
28 #include <QWidget>
29
30 class QGridLayout;
31
32 class QTX_EXPORT QtxGridBox : public QWidget
33 {
34   Q_OBJECT
35
36   class Space;
37
38 public:
39   QtxGridBox( QWidget* = 0, const int = 5, const int = 5 );
40   QtxGridBox( const int, Qt::Orientation, QWidget* = 0, const int = 5, const int = 5 );
41   virtual ~QtxGridBox();
42
43   int             columns() const;
44   Qt::Orientation orientation() const;
45
46   void            setColumns( const int );
47   void            setOrientation( Qt::Orientation );
48
49   void            setLayout( const int, Qt::Orientation );
50
51   bool            skipInvisible() const;
52   void            setSkipInvisible( const bool );
53
54   void            addSpace( const int );
55
56   int             insideMargin() const;
57   int             insideSpacing() const;
58   void            setInsideMargin( const int );
59   void            setInsideSpacing( const int );
60
61   virtual bool    eventFilter( QObject*, QEvent* );
62
63 protected:
64   void            childEvent( QChildEvent* );
65
66 private:
67   void            skip();
68   void            arrangeWidgets();
69   void            placeWidget( QWidget* );
70
71 private:
72   int             myCols;
73   bool            mySkip;
74   Qt::Orientation myOrient;
75   QGridLayout*    myLayout;
76
77   int             myCol, myRow;
78 };
79
80 #endif