summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/Trellis/QtDNDTabBar.h')
-rw-r--r--Swift/QtUI/Trellis/QtDNDTabBar.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/Swift/QtUI/Trellis/QtDNDTabBar.h b/Swift/QtUI/Trellis/QtDNDTabBar.h
new file mode 100644
index 0000000..4f26bc1
--- /dev/null
+++ b/Swift/QtUI/Trellis/QtDNDTabBar.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2014 Kevin Smith and Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+#include <QTabBar>
+
+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:
+ void dragEnterEvent(QDragEnterEvent* dragEnterEvent);
+ void dropEvent(QDropEvent* dropEvent);
+ bool event(QEvent* event);
+
+ private:
+ int defaultTabHeight;
+ int dragIndex;
+ QString dragText;
+ QWidget* dragWidget;
+};
+
+}