-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDocTabWidget.h
72 lines (67 loc) · 2.21 KB
/
DocTabWidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef __Oln_DocTabWidget__
#define __Oln_DocTabWidget__
/*
* Copyright 2010-2018 Rochus Keller <mailto:[email protected]>
*
* This file is part of the CrossLine application.
*
* The following is the license that applies to this copy of the
* application. For a license to use the application under conditions
* other than those described here, please email to [email protected].
*
* GNU General Public License Usage
* This file may be used under the terms of the GNU General Public
* License (GPL) versions 2.0 or 3.0 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in
* the packaging of this file. Please review the following information
* to ensure GNU General Public Licensing requirements will be met:
* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
* http://www.gnu.org/copyleft/gpl.html.
*/
#include <QTabWidget>
#include <Udb/Obj.h>
class QToolButton;
namespace Oln
{
class DocTabWidget : public QTabWidget
{
Q_OBJECT
public:
DocTabWidget( QWidget*, bool hideSingleTab = true );
int addFixed( QWidget*, const QString& title );
int findDoc( const Udb::Obj& doc ); // Index oder -1
int showDoc( const Udb::Obj& doc ); // Index oder -1
int addDoc( QWidget*, const Udb::Obj& doc, const QString& title = QString() );
int showWidget( QWidget* );
Udb::Obj getCurrentObj() const;
Udb::Obj getDoc( int i ) const;
QWidget* getCurrentTab() const;
QTabBar* getBar() const { return tabBar(); }
void closeTab( int i );
void setCloserIcon( const QString& );
static quint32 attrText;
// overrides
QSize minimumSizeHint () const { return QSize( 30, 30 ); } // RISK
signals:
void closing(int);
public slots:
void onCloseDoc(); // Menübefehl
void onDocSelect(); // Menübefehl
void onCloseAll();
void onCloseAllButThis();
protected slots:
void onTabChanged( int );
void onDbUpdate( Udb::UpdateInfo );
void onSelectDoc( QWidget* );
protected:
void updateState();
private:
QList<Udb::Obj> d_views; // isNull..fixed
QList<QWidget*> d_order;
QToolButton* d_closer;
bool d_backLock;
bool d_observed;
bool d_hideSingleTab;
};
}
#endif