mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +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();
|
||||
}
|
||||
|
||||
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),
|
||||
selector(true),
|
||||
ui(new Ui::DiveLogImportDialog)
|
||||
|
|
|
@ -58,6 +58,7 @@ class ColumnDropCSVView : public QTableView {
|
|||
public:
|
||||
ColumnDropCSVView(QWidget *parent);
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *press);
|
||||
void dragLeaveEvent(QDragLeaveEvent *leave);
|
||||
void dragEnterEvent(QDragEnterEvent *event);
|
||||
void dragMoveEvent(QDragMoveEvent *event);
|
||||
|
|
Loading…
Reference in a new issue