Auto show compare on drag interval

.. but its broken, needs fixing.
This commit is contained in:
Mark Liversedge
2013-11-30 22:19:38 +00:00
parent 7a87725457
commit 2a47d36ff1
2 changed files with 28 additions and 2 deletions

View File

@@ -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

View File

@@ -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<ViewSplitter*>("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