Проблема отображения при использовании QT QMENU OBJECT EVENCE RIGHT EVER [закрыто] ⇐ C++
-
Anonymous
Проблема отображения при использовании QT QMENU OBJECT EVENCE RIGHT EVER [закрыто]
os: win10 enterprise ltsc 21h2
qt версия: 5.14 /> Проблема: как изображение, когда нажимать правильную кнопку, контекстное меню иногда не отображается сразу. < /p>
Код: < /p>
projectTreeView->setContextMenuPolicy(Qt::CustomContextMenu);
connect(projectTreeView, &QTreeView::customContextMenuRequested, this, [=](const QPoint &pos){
QModelIndex index = projectTreeView->indexAt(pos);
if (!index.isValid())
return;
else
{
qDebug() addAction(createAction);
menu->addAction(deleteAction);
menu->exec(QCursor::pos());
}
});
Подробнее здесь: https://stackoverflow.com/questions/796 ... lick-event
os: win10 enterprise ltsc 21h2
qt версия: 5.14 /> Проблема: как изображение, когда нажимать правильную кнопку, контекстное меню иногда не отображается сразу. < /p>
Код: < /p>
projectTreeView->setContextMenuPolicy(Qt::CustomContextMenu);
connect(projectTreeView, &QTreeView::customContextMenuRequested, this, [=](const QPoint &pos){
QModelIndex index = projectTreeView->indexAt(pos);
if (!index.isValid())
return;
else
{
qDebug() addAction(createAction);
menu->addAction(deleteAction);
menu->exec(QCursor::pos());
}
});
Подробнее здесь: https://stackoverflow.com/questions/796 ... lick-event
Мобильная версия