Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/dropjob.cpp
Show First 20 Lines • Show All 453 Lines • ▼ Show 20 Line(s) | 449 | if (error == KIO::ERR_UNKNOWN) { | |||
---|---|---|---|---|---|
454 | // If the user clicks outside the menu, it will be destroyed without emitting the triggered signal. | 454 | // If the user clicks outside the menu, it will be destroyed without emitting the triggered signal. | ||
455 | QObject::connect(menu, &QMenu::aboutToHide, q, [this]() { slotAboutToHide(); }); | 455 | QObject::connect(menu, &QMenu::aboutToHide, q, [this]() { slotAboutToHide(); }); | ||
456 | 456 | | |||
457 | fillPopupMenu(menu); | 457 | fillPopupMenu(menu); | ||
458 | QObject::connect(menu, &QMenu::triggered, q, [this](QAction* action) { | 458 | QObject::connect(menu, &QMenu::triggered, q, [this](QAction* action) { | ||
459 | m_triggered = true; | 459 | m_triggered = true; | ||
460 | slotTriggered(action); | 460 | slotTriggered(action); | ||
461 | }); | 461 | }); | ||
462 | | ||||
463 | //force surface creation before ensurePolish call in menu::Popup which happens before show | ||||
464 | //work around BUG 403440 | ||||
465 | menu->setAttribute(Qt::WA_TranslucentBackground); | ||||
466 | menu->winId(); | ||||
467 | | ||||
462 | menu->popup(window ? window->mapToGlobal(m_relativePos) : QCursor::pos()); | 468 | menu->popup(window ? window->mapToGlobal(m_relativePos) : QCursor::pos()); | ||
463 | m_menus.insert(menu); | 469 | m_menus.insert(menu); | ||
464 | QObject::connect(menu, &QObject::destroyed, q, [this, menu]() { | 470 | QObject::connect(menu, &QObject::destroyed, q, [this, menu]() { | ||
465 | m_menus.remove(menu); | 471 | m_menus.remove(menu); | ||
466 | }); | 472 | }); | ||
467 | } else { | 473 | } else { | ||
468 | q->setError(error); | 474 | q->setError(error); | ||
469 | q->emitResult(); | 475 | q->emitResult(); | ||
▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines |