mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-16 09:29:55 +00:00
Compare Pane Mechanics
.. compare pane now appears and disappears on both the analysis view and home view .. it also is notified of drag/drop events and can accept the objects dropped .. it is now time to write the widget for collecting and managing compare sets
This commit is contained in:
@@ -20,4 +20,40 @@
|
||||
|
||||
ComparePane::ComparePane(QWidget *parent, CompareMode mode) : mode_(mode), QWidget(parent)
|
||||
{
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
|
||||
setAcceptDrops(true);
|
||||
setAutoFillBackground(true);
|
||||
QPalette pal;
|
||||
pal.setBrush(QPalette::Active, QPalette::Window, Qt::white);
|
||||
pal.setBrush(QPalette::Inactive, QPalette::Window, Qt::white);
|
||||
setPalette(pal);
|
||||
#if 0
|
||||
// just add a label for now
|
||||
QLabel *filler = new QLabel(tr("Drag and drop here..."), this);
|
||||
filler->setPalette(pal);
|
||||
layout->addWidget(filler);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ComparePane::dragEnterEvent(QDragEnterEvent *event)
|
||||
{
|
||||
if (event->mimeData()->formats().contains("application/x-qabstractitemmodeldatalist")) {
|
||||
qDebug()<<"compare pane: enter event";
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ComparePane::dragLeaveEvent(QDragLeaveEvent *event)
|
||||
{
|
||||
qDebug()<<"compare pane: leave event";
|
||||
}
|
||||
|
||||
void
|
||||
ComparePane::dropEvent(QDropEvent *)
|
||||
{
|
||||
qDebug()<<"compare pane: drop event";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user