void KPrViewModeSlidesSorter::activate(KoPAViewMode *previousViewMode) { Q_UNUSED(previousViewMode); KoPAView *view = dynamic_cast<KoPAView *>(m_view); if (view) { view->replaceCentralWidget(m_centralWidget); } m_slidesSorterView->setFocus(Qt::ActiveWindowFocusReason); updateToActivePageIndex(); //setup signals connect(m_slidesSorterView,SIGNAL(indexChanged(QModelIndex)), this, SLOT(itemClicked(QModelIndex))); connect(m_slidesSorterView, SIGNAL(pressed(QModelIndex)), this, SLOT(itemClicked(QModelIndex))); connect(m_view->proxyObject, SIGNAL(activePageChanged()), this, SLOT(updateToActivePageIndex())); //change zoom saving slot connect(m_view->zoomController(), SIGNAL(zoomChanged(KoZoomMode::Mode,qreal)), this, SLOT(updateZoom(KoZoomMode::Mode,qreal))); KPrView *kPrview = dynamic_cast<KPrView *>(m_view); if (kPrview) { disconnect(kPrview->zoomController(), SIGNAL(zoomChanged(KoZoomMode::Mode,qreal)), kPrview, SLOT(zoomChanged(KoZoomMode::Mode,qreal))); m_view->zoomController()->zoomAction()->setZoomModes(KoZoomMode::ZOOM_CONSTANT); loadZoomConfig(); disconnect(kPrview->deleteSelectionAction(), SIGNAL(triggered()), kPrview, SLOT(editDeleteSelection())); connect(kPrview->deleteSelectionAction(), SIGNAL(triggered()), this, SLOT(deleteSlide())); } }
void SheetsPage::populateLayout() { list = new MList(centralWidget()); list->setCellCreator(new SheetsPageCellCreator()); list->setItemModel(new QStringListModel(list)); policy->addItem(list, Qt::AlignCenter); connect(list, SIGNAL(itemClicked(QModelIndex)), this, SLOT(itemClicked(QModelIndex))); }
void HPSComboBox::initPopup() { mPopup = new HPSPopupWidget(this); mPopup->setWindowFlags(Qt::Popup); connect(mPopup,SIGNAL(exit()),this,SLOT(onMPopupExit())); connect(mPopup,SIGNAL(itemClicked(QString)),this,SLOT(onMPopupItemClicked(QString))); }
void ProstoPleerPluginGetTunesDialog::Private::itemClicked(const QJSValue &row) { //QAbstractItemModel *model = item->property("model").value<QAbstractItemModel*>(); QModelIndex i = row.toVariant().value<QModelIndex>(); //model->setData(i, QompCon::DataToggle, Qt::CheckStateRole); emit itemClicked(i); }
bool NewWordsDialog::set_dict(QDIterableDict *dict) { _dict = dict; _init(); connect(ui->list_newwords, SIGNAL(clicked(QModelIndex)), this, SLOT(itemClicked(QModelIndex))); return true; }
void MList::selectItem(const QModelIndex &index) { QItemSelectionModel *sModel = selectionModel(); if (index.isValid() && sModel->model() != index.model()) { qWarning("MList::selectItem() failed: " "Trying to select an item that is for" " a different model than the view "); return; } if (sModel != NULL) { if (selectionMode() == MList::MultiSelection) { if (sModel->isSelected(index)) { sModel->select(index, QItemSelectionModel::Deselect); } else { sModel->select(index, QItemSelectionModel::Select); } } else if (selectionMode() == MList::SingleSelection) { sModel->select(index, QItemSelectionModel::ClearAndSelect); } } emit itemClicked(index); }
bool cPopMenu::processTouchMessage( const cTouchMessage & msg ) { bool ret = false; if( msg.id() == cMessage::touchUp ) { if( windowBelow( cPoint( msg.position().x, msg.position().y ) ) && !_skipTouch ) { hide(); itemClicked( _selectedItemIndex ); } else hide(); _skipTouch = false; ret = true; } if( msg.id() == cMessage::touchMove || msg.id() == cMessage::touchDown ) { const INPUT & input = getInput(); size_t item = itemBelowPoint( cPoint( input.touchPt.px, input.touchPt.py ) ); if( (size_t)-1 == item ) _skipTouch = true; else _selectedItemIndex = item; ret = true; } return ret; }
bool cPopMenu::processKeyMessage( const cKeyMessage & msg ) { bool ret = false; switch( msg.keyCode() ) { case cKeyMessage::UI_KEY_DOWN : _selectedItemIndex += 1; if( _selectedItemIndex > (s16)_items.size() - 1 ) _selectedItemIndex = 0; ret = true; break; case cKeyMessage::UI_KEY_UP: _selectedItemIndex -= 1; if( _selectedItemIndex < 0 ) _selectedItemIndex = (s16)_items.size() - 1; ret = true; break; case cKeyMessage::UI_KEY_A: // do something by ( _selectedItemIndex ) hide(); itemClicked( _selectedItemIndex ); ret = true; break; case cKeyMessage::UI_KEY_B: hide(); ret = true; break; }; return ret; }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); lastDrawnShapeType = None; buttonCheckStates.append(ui->bDrawLine); buttonCheckStates.append(ui->bDrawRectangle); buttonCheckStates.append(ui->bDrawEllipse); buttonCheckStates.append(ui->bTriangle); ui->tabWidget->removeTab(0); ui->tabWidget->removeTab(0); ui->rShowName->setChecked(true); ui->rHideName->setChecked(false); connect(ui->bPenColor, SIGNAL(released()), this, SLOT(buttonPenColorAction())); connect(ui->bDrawLine, SIGNAL(released()), this, SLOT(buttonLineAction())); connect(ui->bDrawRectangle, SIGNAL(released()), this, SLOT(buttonRectAction())); connect(ui->bDrawEllipse, SIGNAL(released()), this, SLOT(buttonEllipseAction())); connect(ui->bPenWidth, SIGNAL(released()), this, SLOT(buttonPenWidthAction())); connect(ui->bTriangle, SIGNAL(released()), this, SLOT(buttonTriangleAction())); connect(ui->bFill, SIGNAL(released()), this, SLOT(buttonFill())); connect(ui->rShowName, SIGNAL(clicked(bool)), this, SLOT(showNames())); connect(ui->rHideName, SIGNAL(clicked(bool)), this, SLOT(hideNames())); connect(ui->listWidget, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(itemDoubleClicked(QModelIndex))); connect(ui->listWidget, SIGNAL(activated(QModelIndex)), this, SLOT(itemClicked(QModelIndex))); connect(ui->actionShow_List_View, SIGNAL(triggered(bool)), this, SLOT(showTableList())); connect(ui->action_Hide_List_View, SIGNAL(triggered(bool)), this, SLOT(hideTableList())); }
MsmWindow::MsmWindow(QWidget *parent) : QMainWindow(parent) { // Prepare the view area stackedWidget = new QStackedWidget(this); setCentralWidget(stackedWidget); QQuickView *view = new QQuickView(); menuView = QWidget::createWindowContainer(view, this); menuView->setFocusPolicy(Qt::TabFocus); view->setSource(QUrl("qrc:/qml/main.qml")); stackedWidget->addWidget(menuView); stackedWidget->setCurrentWidget(menuView); moduleView = new ModuleView(); stackedWidget->addWidget(moduleView); QQuickItem *rootObject = view->rootObject(); QQuickItem::connect(rootObject, SIGNAL(itemClicked(QString)), this, SLOT(loadModule(QString))); ModuleView::connect(moduleView, &ModuleView::closeRequest, [=]() { moduleView->resolveChanges(); moduleView->closeModules(); stackedWidget->setCurrentWidget(menuView); }); init(); readPositionSettings(); }
bool ContentWindow::eventFilter(QObject *o, QEvent *e) { if (m_contentWidget && o == m_contentWidget->viewport() && e->type() == QEvent::MouseButtonRelease) { QMouseEvent *me = static_cast<QMouseEvent*>(e); QModelIndex index = m_contentWidget->indexAt(me->pos()); QItemSelectionModel *sm = m_contentWidget->selectionModel(); Qt::MouseButtons button = me->button(); if (index.isValid() && (sm && sm->isSelected(index))) { if ((button == Qt::LeftButton && (me->modifiers() & Qt::ControlModifier)) || (button == Qt::MidButton)) { QHelpContentModel *contentModel = qobject_cast<QHelpContentModel*>(m_contentWidget->model()); if (contentModel) { QHelpContentItem *itm = contentModel->contentItemAt(index); if (itm && !isPdfFile(itm)) CentralWidget::instance()->setSourceInNewTab(itm->url()); } } else if (button == Qt::LeftButton) { itemClicked(index); } } } return QWidget::eventFilter(o, e); }
void Workspace::rmbClicked( QListViewItem *i, const QPoint& pos ) { if ( !i ) return; WorkspaceItem* wi = (WorkspaceItem*)i; enum { OPEN_SOURCE, REMOVE_SOURCE, OPEN_FORM, REMOVE_FORM, OPEN_FORM_SOURCE, REMOVE_FORM_SOURCE, OPEN_OBJECT_SOURCE }; QPopupMenu menu( this ); menu.setCheckable( TRUE ); switch ( wi->type() ) { case WorkspaceItem::SourceFileType: menu.insertItem( tr( "&Open source file" ), OPEN_SOURCE ); menu.insertSeparator(); menu.insertItem( QPixmap::fromMimeSource( "designer_editcut.png" ), tr( "&Remove source file from project" ), REMOVE_SOURCE ); break; case WorkspaceItem::FormFileType: menu.insertItem( tr( "&Open form" ), OPEN_FORM ); menu.insertSeparator(); menu.insertItem( QPixmap::fromMimeSource( "designer_editcut.png" ), tr( "&Remove form from project" ), REMOVE_FORM ); break; case WorkspaceItem::FormSourceType: menu.insertItem( tr( "&Open form source" ), OPEN_FORM_SOURCE ); menu.insertSeparator(); if ( project->isCpp() ) menu.insertItem( QPixmap::fromMimeSource( "designer_editcut.png" ), tr( "&Remove source file from form" ), REMOVE_FORM_SOURCE ); else menu.insertItem( QPixmap::fromMimeSource( "designer_editcut.png" ), tr( "&Remove form from project" ), REMOVE_FORM ); break; case WorkspaceItem::ProjectType: MainWindow::self->popupProjectMenu( pos ); return; case WorkspaceItem::ObjectType: menu.insertItem( tr( "&Open source" ), OPEN_OBJECT_SOURCE ); break; } switch ( menu.exec( pos ) ) { case REMOVE_SOURCE: project->removeSourceFile( wi->sourceFile ); break; case REMOVE_FORM: project->removeFormFile( wi->formFile ); break; case REMOVE_FORM_SOURCE: ( (WorkspaceItem*)i )->formFile->setModified( TRUE ); ( (WorkspaceItem*)i )->formFile->setCodeFileState( FormFile::Deleted ); delete ( (WorkspaceItem*)i )->formFile->editor(); break; case OPEN_OBJECT_SOURCE: case OPEN_SOURCE: case OPEN_FORM: case OPEN_FORM_SOURCE: itemClicked( LeftButton, i, pos ); break; } }
GlMenuSampler::GlMenuSampler(GlObject* parent) : GlObject(parent) { backGroundColor = QColor(Qt::black); setGeometry(0,0,800,600); setVisible(false); listWidget = new GlListWidget(this); listWidget->setGeometry(30,20,400,560); connect(listWidget, SIGNAL(itemClicked(QString)), this, SIGNAL(samplerSelected(QString))); //listWidget->setImage(); buttonMain = new GlButton(this); buttonMain->setGeometry(530, 48,200,30); buttonMain->setBackGroundPixmap(QPixmap(":/images/button.png")); buttonMain->setBackGroundPixmapPressed(QPixmap(":/images/button_pressed.png")); buttonMain->setText("Main"); buttonMain->setImage(); connect(buttonMain, SIGNAL(clicked()), this, SIGNAL(buttonMainClicked())); buttonPlayer = new GlButton(this); buttonPlayer->setGeometry(530,108,200,30); buttonPlayer->setBackGroundPixmap(QPixmap(":/images/button.png")); buttonPlayer->setBackGroundPixmapPressed(QPixmap(":/images/button_pressed.png")); buttonPlayer->setText("Player"); buttonPlayer->setImage(); connect(buttonPlayer, SIGNAL(clicked()), this, SIGNAL(buttonPlayerClicked())); }
SearchResults::SearchResults(QWidget *parent) : QWidget(parent) { QVBoxLayout* mainLayout = new QVBoxLayout(this); mainLayout->setMargin(0); mModel = new SearchResultModel(this); mDelegate = new SearchResultDelegate(mModel, this); mTreeView = new QTreeView(this); mTreeView->setModel(mModel); mTreeView->setItemDelegate(mDelegate); mTreeView->setHeaderHidden(true); mainLayout->addWidget(mTreeView); QHBoxLayout* childLayout = new QHBoxLayout(); mainLayout->addLayout(childLayout); childLayout->setMargin(5); mReplaceLabel = new QLabel(tr("Replace With: "), this); mReplaceLabel->setMargin(5); childLayout->addWidget(mReplaceLabel); mReplaceWithText = new QLineEdit(this); mReplaceWithText->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); childLayout->addWidget(mReplaceWithText); mReplaceButton = new QPushButton(tr("Replace"), this); mReplaceLabel->setMargin(5); childLayout->addWidget(mReplaceButton); connect(mTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(itemClicked(QModelIndex))); connect(mReplaceButton, SIGNAL(clicked()), this, SLOT(replaceClicked())); }
void MainWindow::clearAll() { QtCanvasItemList list = canvas->allItems(); qDeleteAll(list); itemClicked(0); canvas->update(); }
PoiskmPluginGetTunesDialog::Private::Private() : QObject() { item = QompQmlEngine::instance()->createItem(QUrl("qrc:///qml/PoiskmResultView.qml")); connect(item, SIGNAL(itemCheckClick(QVariant)), SLOT(itemClicked(QVariant))); connect(item, SIGNAL(actNext()), SIGNAL(next())); connect(item, SIGNAL(selectAllClicked(QVariant)), SLOT(selectAllClicked(QVariant))); }
CuteRadioPluginGetTunesDialog::CuteRadioPluginGetTunesDialog(QObject *parent) : QompPluginGettunesDlg(parent) { setWindowTitle(CUTERADIO_PLUGIN_NAME); p = new Private; connect (p, SIGNAL(itemClicked(QModelIndex)), SLOT(itemSelected(QModelIndex))); setResultsWidget(p->item); }
/*! * \brief Handle a list item being clicked * * \param item The list item */ void MythUIButtonTree::handleClick(MythUIButtonListItem *item) { if (!item) return; MythGenericTree *node = qVariantValue<MythGenericTree*> (item->GetData()); if (DoSetCurrentNode(node)) emit itemClicked(item); }
void VersionManager::keyPressEvent (QKeyEvent * event){ QListWidgetItem *item = listPrefix->currentItem(); if (!item) return; if (event->key() == Qt::Key_Return) itemClicked(item); }
void MainWindow::deleteObject() { if (!currentItem) return; delete currentItem; itemClicked(0); canvas->update(); }
PoiskmPluginGetTunesDialog::PoiskmPluginGetTunesDialog(QObject *parent) : QompPluginGettunesDlg(parent) { setWindowTitle(POISKM_PLUGIN_NAME); p = new Private; connect (p, SIGNAL(itemClicked(QModelIndex)), SLOT(itemSelected(QModelIndex))); connect (p, &PoiskmPluginGetTunesDialog::Private::next, this, &PoiskmPluginGetTunesDialog::next); setResultsWidget(p->item); }
void OSItem::mouseReleaseEvent(QMouseEvent * event) { if (event->button() == Qt::LeftButton){ if( m_mouseDown ){ event->accept(); emit itemClicked(this); m_mouseDown = false; } } }
void CanvasView::handleMouseClickEvent(QMouseEvent* event) { QPoint p = inverseWorldMatrix().map(event->pos()); QtCanvasItemList l = canvas()->collisions(p); moving = 0; if (!l.isEmpty()) moving = l.first(); moving_start = p; emit itemClicked(moving); }
void RListWidget::contextMenuEvent(QContextMenuEvent* e) { if (e != NULL) { QListWidgetItem* item = itemAt(e->pos()); if (item != NULL) { setCurrentItem(item); emit itemClicked(item); } } e->ignore(); }
ProstoPleerPluginGetTunesDialog::ProstoPleerPluginGetTunesDialog(QObject *parent) : QompPluginGettunesDlg(parent) { setWindowTitle(PROSTOPLEER_PLUGIN_NAME); p = new Private; connect (p, SIGNAL(itemClicked(QModelIndex)), SLOT(itemSelected(QModelIndex))); connect (p, SIGNAL(next()), SIGNAL(next())); setResultsWidget(p->item); }
OptionsWindow::OptionsWindow( Vwr::CoreGraph* cg, QOSG::ViewerQT* viewer ) { //vytvorenie a inicializovanie celeho okna this->viewer = viewer; this->cg = cg; setModal( true ); resize( 600,250 ); changes = new QList<QString>(); selectedItem = NULL; Util::ApplicationConfig* appConf = Util::ApplicationConfig::get(); treeModel = new TreeModel( appConf->getList() ); QTreeView* treeView = new QTreeView(); treeView->setFocusPolicy( Qt::NoFocus ); treeView->setModel( treeModel ); treeView->setHeaderHidden( true ); connect( treeView,SIGNAL( clicked( QModelIndex ) ),this,SLOT( itemClicked( QModelIndex ) ) ); view = new QTreeView(); view->setFocusPolicy( Qt::NoFocus ); view->setVisible( false ); QPushButton* closeButton = new QPushButton( tr( "Close" ) ); closeButton->setFocusPolicy( Qt::NoFocus ); connect( closeButton, SIGNAL( clicked() ), this, SLOT( close() ) ); applyButton= new QPushButton( tr( "Apply" ) ); applyButton->setFocusPolicy( Qt::NoFocus ); applyButton->setEnabled( false ); connect( applyButton, SIGNAL( clicked() ), this, SLOT( commitChanges() ) ); QHBoxLayout* horizontalLayout = new QHBoxLayout; horizontalLayout->addWidget( treeView ); horizontalLayout->addWidget( view ); QHBoxLayout* buttonsLayout = new QHBoxLayout; buttonsLayout->addStretch( 1 ); buttonsLayout->addWidget( applyButton ); buttonsLayout->addWidget( closeButton ); QVBoxLayout* mainLayout = new QVBoxLayout; mainLayout->addLayout( horizontalLayout ); mainLayout->addStretch( 1 ); mainLayout->addSpacing( 12 ); mainLayout->addLayout( buttonsLayout ); setLayout( mainLayout ); setWindowTitle( tr( "Config Dialog" ) ); }
bool Workspace::qt_invoke( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: update(); break; case 1: update((FormFile*)static_QUType_ptr.get(_o+1)); break; case 2: activeFormChanged((FormWindow*)static_QUType_ptr.get(_o+1)); break; case 3: activeEditorChanged((SourceEditor*)static_QUType_ptr.get(_o+1)); break; case 4: itemClicked((int)static_QUType_int.get(_o+1),(QListViewItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3))); break; case 5: itemDoubleClicked((QListViewItem*)static_QUType_ptr.get(_o+1)); break; case 6: rmbClicked((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2))); break; case 7: bufferChosen((const QString&)static_QUType_QString.get(_o+1)); break; case 8: projectDestroyed((QObject*)static_QUType_ptr.get(_o+1)); break; case 9: sourceFileAdded((SourceFile*)static_QUType_ptr.get(_o+1)); break; case 10: sourceFileRemoved((SourceFile*)static_QUType_ptr.get(_o+1)); break; case 11: formFileAdded((FormFile*)static_QUType_ptr.get(_o+1)); break; case 12: formFileRemoved((FormFile*)static_QUType_ptr.get(_o+1)); break; case 13: objectAdded((QObject*)static_QUType_ptr.get(_o+1)); break; case 14: objectRemoved((QObject*)static_QUType_ptr.get(_o+1)); break; default: return QListView::qt_invoke( _id, _o ); } return TRUE; }
/*! \brief Create a widget to be inserted into the legend The default implementation returns a QwtLegendLabel. \param data Attributes of the legend entry \return Widget representing data on the legend \note updateWidget() will called soon after createWidget() with the same attributes. */ QWidget *QwtLegend::createWidget( const QwtLegendData &data ) const { Q_UNUSED( data ); QwtLegendLabel *label = new QwtLegendLabel(); label->setItemMode( defaultItemMode() ); connect( label, SIGNAL( clicked() ), SLOT( itemClicked() ) ); connect( label, SIGNAL( checked( bool ) ), SLOT( itemChecked( bool ) ) ); return label; }
//VOXOX CHANGE by Rolando - 2009.09.08 void QtUMItemManager::itemClickedSlot(QTreeWidgetItem* item, int column){ QtUMItem * umItem = getQtUMItemFromItem(item);//VOXOX CHANGE by Rolando - 2009.09.08 if(umItem){ itemClicked(umItem->getId());//VOXOX CHANGE by Rolando - 2009.09.08 setCurrentItem(item);//VOXOX CHANGE by Rolando - 2009.09.04 _tree->viewport()->update();//VOXOX CHANGE by Rolando - 2009.10.01 } }
bool MidijDrawGraphicsScene::event(QEvent *event) { if (event->type() == QEvent::GraphicsSceneMousePress) { QGraphicsItem* item = itemAt(((QGraphicsSceneMouseEvent*)event)->scenePos()); if (item && item->type() == GraphicsMidiControlItem::Type) { emit itemClicked(item); } } return QGraphicsScene::event(event); }