void QDesignerPromotionDialog::slotTreeViewContextMenu(const QPoint &pos) { unsigned flags; const QDesignerWidgetDataBaseItemInterface *dbItem = databaseItemAt(m_treeView->selectionModel()->selection(), flags); if (!dbItem) return; QMenu menu; QAction *signalSlotAction = menu.addAction(tr("Change signals/slots...")); connect(signalSlotAction, SIGNAL(triggered()), this, SLOT(slotEditSignalsSlots())); menu.exec(m_treeView->viewport()->mapToGlobal(pos)); }
PromotionTaskMenu::PromotionTaskMenu(QWidget *widget,Mode mode, QObject *parent) : QObject(parent), m_mode(mode), m_widget(widget), m_promotionMapper(0), m_globalEditAction(new QAction(tr("Promoted widgets..."), this)), m_EditPromoteToAction(new QAction(tr("Promote to ..."), this)), m_EditSignalsSlotsAction(new QAction(tr("Change signals/slots..."), this)), m_promoteLabel(tr("Promote to")), m_demoteLabel(tr("Demote to %1")) { connect(m_globalEditAction, SIGNAL(triggered()), this, SLOT(slotEditPromotedWidgets())); connect(m_EditPromoteToAction, SIGNAL(triggered()), this, SLOT(slotEditPromoteTo())); connect(m_EditSignalsSlotsAction, SIGNAL(triggered()), this, SLOT(slotEditSignalsSlots())); }