summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/Trellis/QtDNDTabBar.h')
-rw-r--r--Swift/QtUI/Trellis/QtDNDTabBar.h55
1 files changed, 29 insertions, 26 deletions
diff --git a/Swift/QtUI/Trellis/QtDNDTabBar.h b/Swift/QtUI/Trellis/QtDNDTabBar.h
index 71ca94b..6de04d5 100644
--- a/Swift/QtUI/Trellis/QtDNDTabBar.h
+++ b/Swift/QtUI/Trellis/QtDNDTabBar.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2015 Isode Limited.
+ * Copyright (c) 2014-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,34 +8,37 @@
#include <QTabBar>
+#include <Swift/QtUI/QtTabWidget.h>
+
namespace Swift {
class QtDNDTabBar : public QTabBar {
- Q_OBJECT
- public:
- explicit QtDNDTabBar(QWidget* parent = 0);
- virtual ~QtDNDTabBar();
-
- int getDragIndex() const;
- QString getDragText() const;
- QWidget* getDragWidget() const;
-
- virtual QSize sizeHint() const;
-
- signals:
- void onDropSucceeded();
-
- protected:
- virtual void dragEnterEvent(QDragEnterEvent* dragEnterEvent);
- virtual void dropEvent(QDropEvent* dropEvent);
- virtual bool event(QEvent* event);
- virtual QSize tabSizeHint(int index) const;
-
- private:
- int defaultTabHeight;
- int dragIndex;
- QString dragText;
- QWidget* dragWidget;
+ Q_OBJECT
+ public:
+ explicit QtDNDTabBar(QWidget* parent = nullptr);
+ virtual ~QtDNDTabBar();
+
+ int getDragIndex() const;
+ QString getDragText() const;
+ QWidget* getDragWidget() const;
+
+ virtual QSize sizeHint() const;
+
+ friend class QtTabWidget;
+ signals:
+ void onDropSucceeded();
+
+ protected:
+ virtual void dragEnterEvent(QDragEnterEvent* dragEnterEvent);
+ virtual void dropEvent(QDropEvent* dropEvent);
+ virtual bool event(QEvent* event);
+ virtual QSize tabSizeHint(int index) const;
+
+ private:
+ int defaultTabHeight;
+ int dragIndex = -1;
+ QString dragText;
+ QWidget* dragWidget = nullptr;
};
}