mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-13 18:17:08 -07:00
Avoid creating unnecessary event loops
The `exec()` method will create another event loop and transfer control over there which might introduce unexpected bugs.
This commit is contained in:
parent
206bb018dd
commit
3748b995ff
22 changed files with 509 additions and 476 deletions
|
@ -284,13 +284,14 @@ void Private::FileLineEdit::keyPressEvent(QKeyEvent *e)
|
|||
void Private::FileLineEdit::contextMenuEvent(QContextMenuEvent *event)
|
||||
{
|
||||
QMenu *menu = createStandardContextMenu();
|
||||
menu->addSeparator();
|
||||
menu->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
if (m_browseAction) {
|
||||
menu->addSeparator();
|
||||
menu->addAction(m_browseAction);
|
||||
}
|
||||
menu->exec(event->globalPos());
|
||||
delete menu;
|
||||
|
||||
menu->popup(event->globalPos());
|
||||
}
|
||||
|
||||
void Private::FileLineEdit::showCompletionPopup()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue