Details
-
Bug
-
Resolution: Duplicate
-
P3: Somewhat important
-
None
-
5.5.0
-
None
-
Mac OS 10.11
Qt Creator 3.4.2 (opensource)
Based on Qt 5.5.0 (Clang 6.0 (Apple), 64 bit)
Built on Jun 29 2015 01:54:07
Description
Dragging of the item in QTableView or QTreeVIew works very slowly on Mac OS if method canDropMimeData of the model returns true.
On windows all works fine.
If canDropMimeData returns false - all works fine on Mac OS.
To see the behaviour - look at attached short video.
BTW: Qt creator shows such messages in application output:
QNSView mouseDragged: Internal mouse button tracking invalid (missing Qt::LeftButton)
I created a simple project to reproduce this issue:
1 Create a simple project in the QtCreator for QDilag:
2 Replace code in the dialog.cpp on code below:
#include "dialog.h" #include "ui_dialog.h" #include <QTableView> #include <QHBoxLayout> class Model : public QAbstractTableModel { public: Model( QObject* parent ) : QAbstractTableModel( parent ) { } public: int rowCount(const QModelIndex & parent = QModelIndex()) const { return 5; } int columnCount(const QModelIndex & parent = QModelIndex()) const { return 5; } QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const { if( role == Qt::DisplayRole ) { return "test"; } return QVariant(); } Qt::ItemFlags flags( const QModelIndex& index ) const override { return QAbstractTableModel::flags( index ) | Qt::ItemIsDropEnabled | Qt::ItemIsDragEnabled; } Qt::DropActions supportedDropActions( void ) const override { return Qt::CopyAction; } bool canDropMimeData( const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent) const override { return true; } }; Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog) { ui->setupUi(this); QTableView* table = new QTableView; table->setModel( new Model( table ) ); table->setSelectionBehavior( QAbstractItemView::SelectRows ); table->viewport()->setAcceptDrops( true ); table->setDropIndicatorShown( false ); table->setDragDropMode( QAbstractItemView::DragDrop ); QHBoxLayout* layout = new QHBoxLayout; setLayout( layout ); layout->addWidget( table ); } Dialog::~Dialog() { delete ui; }
Attachments
Issue Links
- duplicates
-
QTBUG-49204 [OS X] [Reg: Qt 5.4.1 -> Qt 5.5.0] Poor performance when dragging TreeWidgetItem
-
- Closed
-