From 8531cec1004f1ee5f0655400557a4619945975b6 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 7 Jan 2015 15:04:15 -0200 Subject: Add delegate skeleton for the drag columns This new class is the responsible to draw the columns that can be dragged from the top bar to the bottom one. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/divelogimportdialog.cpp | 14 ++++++++++++++ qt-ui/divelogimportdialog.h | 9 +++++++++ 2 files changed, 23 insertions(+) diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp index aabd6df6a..506f9c8d6 100644 --- a/qt-ui/divelogimportdialog.cpp +++ b/qt-ui/divelogimportdialog.cpp @@ -480,3 +480,17 @@ void DiveLogImportDialog::on_buttonBox_accepted() process_dives(true, false); MainWindow::instance()->refreshDisplay(); } + +TagDragDelegate::TagDragDelegate(QObject *parent) : QStyledItemDelegate(parent) +{ +} + +QSize TagDragDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const +{ + return QStyledItemDelegate::sizeHint(option, index); +} + +void TagDragDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const +{ + QStyledItemDelegate::paint(painter, option, index); +} diff --git a/qt-ui/divelogimportdialog.h b/qt-ui/divelogimportdialog.h index 9a75bb14d..cc017e8c9 100644 --- a/qt-ui/divelogimportdialog.h +++ b/qt-ui/divelogimportdialog.h @@ -7,6 +7,7 @@ #include #include #include +#include #include "../dive.h" #include "../divelist.h" @@ -110,4 +111,12 @@ private: static const CSVAppConfig CSVApps[CSVAPPS]; }; +class TagDragDelegate : public QStyledItemDelegate { + Q_OBJECT +public: + TagDragDelegate(QObject *parent); + QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const; + void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const; +}; + #endif // DIVELOGIMPORTDIALOG_H -- cgit v1.2.3-70-g09d2