void KlipperPopup::buildFromScratch() { addTitle(KIcon("klipper"), i18n("Klipper - Clipboard Tool")); m_filterWidget = new KLineEditBlackKey(this); m_filterWidget->setFocusPolicy( Qt::NoFocus ); m_filterWidgetAction = new QWidgetAction(this); m_filterWidgetAction->setDefaultWidget(m_filterWidget); m_filterWidgetAction->setVisible(false); addAction(m_filterWidgetAction); addSeparator(); for (int i = 0; i < m_actions.count(); i++) { if (i + 1 == m_actions.count()) { addMenu(m_helpMenu->menu())->setIcon(KIcon("help-contents")); addSeparator(); } addAction(m_actions.at(i)); } if ( KGlobalSettings::insertTearOffHandle() ) { setTearOffEnabled(true); } }
ProjectFilterMenu::ProjectFilterMenu(JobListWidget * jobList) : JobListMenu<>( jobList, "Project Filter" ) , mProjectShowAll( 0 ) , mProjectShowNone( 0 ) , mProjectShowNonProject( 0 ) , mProjectActionsCreated( false ) { setTearOffEnabled( true ); }
int QMenu::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 11) qt_static_metacall(this, _c, _id, _a); _id -= 11; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< bool*>(_v) = isTearOffEnabled(); break; case 1: *reinterpret_cast< QString*>(_v) = title(); break; case 2: *reinterpret_cast< QIcon*>(_v) = icon(); break; case 3: *reinterpret_cast< bool*>(_v) = separatorsCollapsible(); break; } _id -= 4; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setTearOffEnabled(*reinterpret_cast< bool*>(_v)); break; case 1: setTitle(*reinterpret_cast< QString*>(_v)); break; case 2: setIcon(*reinterpret_cast< QIcon*>(_v)); break; case 3: setSeparatorsCollapsible(*reinterpret_cast< bool*>(_v)); break; } _id -= 4; } else if (_c == QMetaObject::ResetProperty) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 4; } #endif // QT_NO_PROPERTIES return _id; }