fixed edge display for volume cells
[engrid-github.git] / src / libengrid / multipagewidget.h
blob38a02eda00b1603de90032cd995d1e02bb1e0ac6
1 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 // + +
3 // + This file is part of enGrid. +
4 // + +
5 // + Copyright 2008-2014 enGits GmbH +
6 // + +
7 // + enGrid is free software: you can redistribute it and/or modify +
8 // + it under the terms of the GNU General Public License as published by +
9 // + the Free Software Foundation, either version 3 of the License, or +
10 // + (at your option) any later version. +
11 // + +
12 // + enGrid is distributed in the hope that it will be useful, +
13 // + but WITHOUT ANY WARRANTY; without even the implied warranty of +
14 // + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
15 // + GNU General Public License for more details. +
16 // + +
17 // + You should have received a copy of the GNU General Public License +
18 // + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
19 // + +
20 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21 /****************************************************************************
23 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
24 ** Contact: Qt Software Information (qt-info@nokia.com)
26 ** This file is part of the example classes of the Qt Toolkit.
28 ** $QT_BEGIN_LICENSE:LGPL$
29 ** Commercial Usage
30 ** Licensees holding valid Qt Commercial licenses may use this file in
31 ** accordance with the Qt Commercial License Agreement provided with the
32 ** Software or, alternatively, in accordance with the terms contained in
33 ** a written agreement between you and Nokia.
35 ** GNU Lesser General Public License Usage
36 ** Alternatively, this file may be used under the terms of the GNU Lesser
37 ** General Public License version 2.1 as published by the Free Software
38 ** Foundation and appearing in the file LICENSE.LGPL included in the
39 ** packaging of this file. Please review the following information to
40 ** ensure the GNU Lesser General Public License version 2.1 requirements
41 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
43 ** In addition, as a special exception, Nokia gives you certain
44 ** additional rights. These rights are described in the Nokia Qt LGPL
45 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
46 ** package.
48 ** GNU General Public License Usage
49 ** Alternatively, this file may be used under the terms of the GNU
50 ** General Public License version 3.0 as published by the Free Software
51 ** Foundation and appearing in the file LICENSE.GPL included in the
52 ** packaging of this file. Please review the following information to
53 ** ensure the GNU General Public License version 3.0 requirements will be
54 ** met: http://www.gnu.org/copyleft/gpl.html.
56 ** If you are unsure which license is appropriate for your use, please
57 ** contact the sales department at qt-sales@nokia.com.
58 ** $QT_END_LICENSE$
60 ****************************************************************************/
62 #ifndef MULTIPAGEWIDGET_H
63 #define MULTIPAGEWIDGET_H
65 #include <QWidget>
67 QT_BEGIN_NAMESPACE
68 class QComboBox;
69 class QStackedWidget;
70 class QVBoxLayout;
71 QT_END_NAMESPACE
73 //! [0]
74 class MultiPageWidget : public QWidget
76 Q_OBJECT
77 Q_PROPERTY( int currentIndex READ currentIndex WRITE setCurrentIndex )
78 Q_PROPERTY( QString pageTitle READ pageTitle WRITE setPageTitle STORED false )
80 public:
81 MultiPageWidget( QWidget *parent = 0 );
83 QSize sizeHint() const;
85 int count() const;
86 int currentIndex() const;
87 QWidget *widget( int index );
88 QString pageTitle() const;
90 public slots:
91 void addPage( QWidget *page );
92 void insertPage( int index, QWidget *page );
93 void removePage( int index );
94 void setPageTitle( QString const &newTitle );
95 void setPageTitle( QString const &newTitle, int index );
96 void setCurrentIndex( int index );
98 signals:
99 void currentIndexChanged( int index );
100 void pageTitleChanged( const QString &title );
102 private:
103 QStackedWidget *stackWidget;
104 QComboBox *comboBox;
105 QVBoxLayout *layout;
107 //! [0]
109 #endif