I just gave it a quick try and according to my test the selection doesn't change at all when the context menu is opened:
// main.cpp
#include <QtGui>
int main(int argc, char* argv[])
{
listWidget.setDragEnabled(true);
listWidget.setAcceptDrops(true);
listWidget.setDropIndicatorShown(true);
for (int i = 0; i < 10; ++i)
listWidget.
addItem(QString::number(i
));
listWidget.setContextMenuPolicy(Qt::ActionsContextMenu);
for (int i = 0; i < 5; ++i)
listWidget.show();
return app.exec();
}
// main.cpp
#include <QtGui>
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
QListWidget listWidget;
listWidget.setDragEnabled(true);
listWidget.setAcceptDrops(true);
listWidget.setDropIndicatorShown(true);
listWidget.setSelectionMode(QAbstractItemView::ExtendedSelection);
for (int i = 0; i < 10; ++i)
listWidget.addItem(QString::number(i));
listWidget.setContextMenuPolicy(Qt::ActionsContextMenu);
for (int i = 0; i < 5; ++i)
listWidget.addAction(new QAction(QString::number(i), &listWidget));
listWidget.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Could you modify the above example to reproduce the problem?
Bookmarks