diff --git a/src/HomeWindow.cpp b/src/HomeWindow.cpp index f3aa32539..c20d7bd18 100644 --- a/src/HomeWindow.cpp +++ b/src/HomeWindow.cpp @@ -417,10 +417,12 @@ HomeWindow::styleChanged(int id) void HomeWindow::dragEnterEvent(QDragEnterEvent *event) { +#if 0 // drah and drop chart no longer part of the UX if (event->mimeData()->formats().contains("application/x-qabstractitemmodeldatalist")) { event->accept(); dropPending = true; } +#endif } void @@ -447,6 +449,7 @@ HomeWindow::appendChart(GcWinID id) void HomeWindow::dropEvent(QDropEvent *event) { +#if 0 // drah and drop chart no longer part of the UX QStandardItemModel model; model.dropMimeData(event->mimeData(), Qt::CopyAction, -1,-1, QModelIndex()); QString chart = model.data(model.index(0,0), Qt::DisplayRole).toString(); @@ -471,6 +474,7 @@ HomeWindow::dropEvent(QDropEvent *event) winWidget->repaint(); return; +#endif } void diff --git a/src/TabView.h b/src/TabView.h index 2e6a15706..792032dc3 100644 --- a/src/TabView.h +++ b/src/TabView.h @@ -135,8 +135,10 @@ class ViewSplitter : public QSplitter Q_OBJECT public: - ViewSplitter(Qt::Orientation orientation, QString name, QWidget *parent=0) : - orientation(orientation), name(name), QSplitter(orientation, parent) { + ViewSplitter(Qt::Orientation orientation, QString name, TabView *parent=0) : + orientation(orientation), name(name), tabView(parent), showForDrag(false), + QSplitter(orientation, parent) { + setAcceptDrops(true); qRegisterMetaType("hpos"); } @@ -146,6 +148,24 @@ protected: } int handleWidth() { return 23; }; + virtual void dragEnterEvent(QDragEnterEvent *event) { + if (showForDrag == false && event->mimeData()->formats().contains("application/x-qabstractitemmodeldatalist")) { + if (tabView->hasBottom() && tabView->isShowBottom() == false) { + showForDrag = true; + tabView->setShowBottom(true); + event->acceptProposedAction(); + } + } + } + + virtual void dragLeaveEvent(QDragLeaveEvent *) { + + if (showForDrag == true && tabView->hasBottom() && tabView->isShowBottom() == true) { + showForDrag = false; + tabView->setShowBottom(false); + } + } + public: Q_PROPERTY(int hpos READ hpos WRITE sethpos USER true) @@ -174,6 +194,8 @@ public: private: Qt::Orientation orientation; QString name; + TabView *tabView; + bool showForDrag; }; #endif // _GC_TabView_h