void Fader::contextMenuEvent( QContextMenuEvent * _ev ) { CaptionMenu contextMenu( windowTitle() ); addDefaultActions( &contextMenu ); contextMenu.exec( QCursor::pos() ); _ev->accept(); }
void ComboBox::contextMenuEvent( QContextMenuEvent * event ) { if( model() == NULL || event->x() <= width() - CB_ARROW_BTN_WIDTH ) { QWidget::contextMenuEvent( event ); return; } CaptionMenu contextMenu( model()->displayName() ); addDefaultActions( &contextMenu ); contextMenu.exec( QCursor::pos() ); }
void knob::contextMenuEvent( QContextMenuEvent * ) { // for the case, the user clicked right while pressing left mouse- // button, the context-menu appears while mouse-cursor is still hidden // and it isn't shown again until user does something which causes // an QApplication::restoreOverrideCursor()-call... mouseReleaseEvent( NULL ); captionMenu contextMenu( model()->displayName() ); addDefaultActions( &contextMenu ); contextMenu.addSeparator(); contextMenu.addAction( embed::getIconPixmap( "help" ), tr( "&Help" ), this, SLOT( displayHelp() ) ); contextMenu.exec( QCursor::pos() ); }
Layer::Layer() { superlayer = NULL; _cornerRadius = 0; _backgroundColor = whiteColor; _borderColor = clearColor; _borderWidth = 0; _opacity = 1.0f; _visible = true; _backgroundContentMode = LayerContentModeScaleToFill; addDefaultKeyAccessors(); addDefaultActions(); composite(false); needsRedraw(); }
void Knob::contextMenuEvent( QContextMenuEvent * ) { // for the case, the user clicked right while pressing left mouse- // button, the context-menu appears while mouse-cursor is still hidden // and it isn't shown again until user does something which causes // an QApplication::restoreOverrideCursor()-call... mouseReleaseEvent( NULL ); CaptionMenu contextMenu( model()->displayName(), this ); addDefaultActions( &contextMenu ); contextMenu.addAction( QPixmap(), model()->isScaleLogarithmic() ? tr( "Set linear" ) : tr( "Set logarithmic" ), this, SLOT( toggleScale() ) ); contextMenu.addSeparator(); contextMenu.addHelpAction(); contextMenu.exec( QCursor::pos() ); }
void FxLineLcdSpinBox::contextMenuEvent(QContextMenuEvent* event) { // for the case, the user clicked right while pressing left mouse- // button, the context-menu appears while mouse-cursor is still hidden // and it isn't shown again until user does something which causes // an QApplication::restoreOverrideCursor()-call... mouseReleaseEvent(nullptr); QPointer<CaptionMenu> contextMenu = new CaptionMenu(model()->displayName(), this); if (QMenu *fxMenu = m_tv->createFxMenu( tr("Assign to:"), tr("New FX Channel"))) { contextMenu->addMenu(fxMenu); contextMenu->addSeparator(); } addDefaultActions(contextMenu); contextMenu->exec(QCursor::pos()); }
virtual void contextMenuEvent( QContextMenuEvent* event ) { // for the case, the user clicked right while pressing left mouse- // button, the context-menu appears while mouse-cursor is still hidden // and it isn't shown again until user does something which causes // an QApplication::restoreOverrideCursor()-call... mouseReleaseEvent( NULL ); QPointer<CaptionMenu> contextMenu = new CaptionMenu( model()->displayName(), this ); // This condition is here just as a safety check, fxLineLcdSpinBox is aways // created inside a TabWidget inside an InstrumentTrackWindow if ( InstrumentTrackWindow* window = dynamic_cast<InstrumentTrackWindow*>( (QWidget *)this->parent()->parent() ) ) { QMenu *fxMenu = window->instrumentTrackView()->createFxMenu( tr( "Assign to:" ), tr( "New FX Channel" ) ); contextMenu->addMenu( fxMenu ); contextMenu->addSeparator(); } addDefaultActions( contextMenu ); contextMenu->exec( QCursor::pos() ); }
void AutomatableButton::contextMenuEvent( QContextMenuEvent * _me ) { // for the case, the user clicked right while pressing left mouse- // button, the context-menu appears while mouse-cursor is still hidden // and it isn't shown again until user does something which causes // an QApplication::restoreOverrideCursor()-call... mouseReleaseEvent( NULL ); if ( m_group != NULL ) { CaptionMenu contextMenu( m_group->model()->displayName() ); m_group->addDefaultActions( &contextMenu ); contextMenu.exec( QCursor::pos() ); } else { CaptionMenu contextMenu( model()->displayName() ); addDefaultActions( &contextMenu ); contextMenu.exec( QCursor::pos() ); } }
QgsAttributeActionDialog::QgsAttributeActionDialog( QgsAttributeAction* actions, const QgsFields& fields, QWidget* parent ): QWidget( parent ), mActions( actions ) { setupUi( this ); QHeaderView *header = attributeActionTable->horizontalHeader(); header->setHighlightSections( false ); header->setStretchLastSection( true ); attributeActionTable->setColumnWidth( 0, 100 ); attributeActionTable->setColumnWidth( 1, 230 ); attributeActionTable->setCornerButtonEnabled( false ); connect( attributeActionTable, SIGNAL( itemSelectionChanged() ), this, SLOT( itemSelectionChanged() ) ); connect( actionName, SIGNAL( textChanged( QString ) ), this, SLOT( updateButtons() ) ); connect( actionAction, SIGNAL( textChanged() ), this, SLOT( updateButtons() ) ); connect( moveUpButton, SIGNAL( clicked() ), this, SLOT( moveUp() ) ); connect( moveDownButton, SIGNAL( clicked() ), this, SLOT( moveDown() ) ); connect( removeButton, SIGNAL( clicked() ), this, SLOT( remove() ) ); connect( addDefaultActionsButton, SIGNAL( clicked() ), this, SLOT( addDefaultActions() ) ); connect( browseButton, SIGNAL( clicked() ), this, SLOT( browse() ) ); connect( insertButton, SIGNAL( clicked() ), this, SLOT( insert() ) ); connect( updateButton, SIGNAL( clicked() ), this, SLOT( update() ) ); connect( insertFieldButton, SIGNAL( clicked() ), this, SLOT( insertField() ) ); connect( insertExpressionButton, SIGNAL( clicked() ), this, SLOT( insertExpression() ) ); connect( chooseIconButton, SIGNAL( clicked() ), this, SLOT( chooseIcon() ) ); init(); // Populate the combo box with the field names. Will the field names // change? If so, they need to be passed into the init() call, or // some access to them retained in this class. for ( int idx = 0; idx < fields.count(); ++idx ) fieldComboBox->addItem( fields[idx].name() ); }
QgsAttributeActionDialog::QgsAttributeActionDialog( const QgsActionManager& actions, QWidget* parent ) : QWidget( parent ) , mLayer( actions.layer() ) { setupUi( this ); QHeaderView* header = mAttributeActionTable->horizontalHeader(); header->setHighlightSections( false ); header->setStretchLastSection( true ); mAttributeActionTable->setColumnWidth( 0, 100 ); mAttributeActionTable->setColumnWidth( 1, 230 ); mAttributeActionTable->setCornerButtonEnabled( false ); mAttributeActionTable->setEditTriggers( QAbstractItemView::AnyKeyPressed | QAbstractItemView::SelectedClicked ); connect( mAttributeActionTable, SIGNAL( itemDoubleClicked( QTableWidgetItem* ) ), this, SLOT( itemDoubleClicked( QTableWidgetItem* ) ) ); connect( mAttributeActionTable, SIGNAL( itemSelectionChanged() ), this, SLOT( updateButtons() ) ); connect( mMoveUpButton, SIGNAL( clicked() ), this, SLOT( moveUp() ) ); connect( mMoveDownButton, SIGNAL( clicked() ), this, SLOT( moveDown() ) ); connect( mRemoveButton, SIGNAL( clicked() ), this, SLOT( remove() ) ); connect( mAddButton, SIGNAL( clicked( bool ) ), this, SLOT( insert() ) ); connect( mAddDefaultActionsButton, SIGNAL( clicked() ), this, SLOT( addDefaultActions() ) ); init( actions, mLayer->attributeTableConfig() ); }
void AutomatableSlider::contextMenuEvent( QContextMenuEvent * _me ) { CaptionMenu contextMenu( model()->displayName() ); addDefaultActions( &contextMenu ); contextMenu.exec( QCursor::pos() ); }