mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-16 17:39:58 +00:00
.. 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
60 lines
1.8 KiB
C++
60 lines
1.8 KiB
C++
/*
|
|
* Copyright (c) 2013 Mark Liversedge (liversedge@gmail.com)
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by the Free
|
|
* Software Foundation; either version 2 of the License, or (at your option)
|
|
* any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
* more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along
|
|
* with this program; if not, write to the Free Software Foundation, Inc., 51
|
|
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*/
|
|
|
|
#include "ComparePane.h"
|
|
|
|
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";
|
|
}
|