mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Start to make it possible to move columns around
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
325f47c8d8
commit
fd41ff4ab9
2 changed files with 22 additions and 0 deletions
|
@ -211,6 +211,27 @@ void ColumnNameResult::setColumnValues(QList<QStringList> columns)
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ColumnDropCSVView::mousePressEvent(QMouseEvent *press)
|
||||||
|
{
|
||||||
|
QModelIndex atClick = indexAt(press->pos());
|
||||||
|
if (!atClick.isValid() || atClick.row())
|
||||||
|
return;
|
||||||
|
|
||||||
|
QRect indexRect = visualRect(atClick);
|
||||||
|
QPixmap pix(indexRect.width(), indexRect.height());
|
||||||
|
pix.fill(QColor(0,0,0,0));
|
||||||
|
render(&pix, QPoint(0, 0),QRegion(indexRect));
|
||||||
|
|
||||||
|
QDrag *drag = new QDrag(this);
|
||||||
|
QMimeData *mimeData = new QMimeData;
|
||||||
|
mimeData->setData(subsurface_mimedata, atClick.data().toByteArray());
|
||||||
|
drag->setPixmap(pix);
|
||||||
|
drag->setMimeData(mimeData);
|
||||||
|
if (drag->exec() != Qt::IgnoreAction){
|
||||||
|
// Do stuff here.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DiveLogImportDialog::DiveLogImportDialog(QStringList fn, QWidget *parent) : QDialog(parent),
|
DiveLogImportDialog::DiveLogImportDialog(QStringList fn, QWidget *parent) : QDialog(parent),
|
||||||
selector(true),
|
selector(true),
|
||||||
ui(new Ui::DiveLogImportDialog)
|
ui(new Ui::DiveLogImportDialog)
|
||||||
|
|
|
@ -58,6 +58,7 @@ class ColumnDropCSVView : public QTableView {
|
||||||
public:
|
public:
|
||||||
ColumnDropCSVView(QWidget *parent);
|
ColumnDropCSVView(QWidget *parent);
|
||||||
protected:
|
protected:
|
||||||
|
void mousePressEvent(QMouseEvent *press);
|
||||||
void dragLeaveEvent(QDragLeaveEvent *leave);
|
void dragLeaveEvent(QDragLeaveEvent *leave);
|
||||||
void dragEnterEvent(QDragEnterEvent *event);
|
void dragEnterEvent(QDragEnterEvent *event);
|
||||||
void dragMoveEvent(QDragMoveEvent *event);
|
void dragMoveEvent(QDragMoveEvent *event);
|
||||||
|
|
Loading…
Add table
Reference in a new issue