void ToolManager::slotToolChanged(KoCanvasController* canvas, int toolId) { Q_UNUSED(canvas); Q_UNUSED(toolId); if(!d->toolManager) return; QString id = KoToolManager::instance()->activeToolId(); d->currentTool = qobject_cast<KoToolBase*>(KoToolManager::instance()->toolById(canvas->canvas(), id)); emit currentToolChanged(); }
bool ConfigToolboxDialog::qt_invoke( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: addTool(); break; case 1: removeTool(); break; case 2: moveToolUp(); break; case 3: moveToolDown(); break; case 4: currentToolChanged((QListViewItem*)static_QUType_ptr.get(_o+1)); break; case 5: currentCommonToolChanged((QListViewItem*)static_QUType_ptr.get(_o+1)); break; case 6: ok(); break; case 7: languageChange(); break; default: return QDialog::qt_invoke( _id, _o ); } return TRUE; }
void ToolManager::setCurrentTool(const QString &name) { if (!_actionHash.values().contains(name)) return; if (_currentTool == name) return; _currentTool = name; QAction *action = _actionHash.key(name); Q_ASSERT(action); if (!action->isChecked()) action->setChecked(true); emit currentToolChanged(name); }
bool FormWindow::qt_invoke( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: widgetChanged((QObject*)static_QUType_ptr.get(_o+1)); break; case 1: currentToolChanged(); break; case 2: visibilityChanged(); break; case 3: modificationChanged((bool)static_QUType_bool.get(_o+1)); break; case 4: invalidCheckedSelections(); break; case 5: updatePropertiesTimerDone(); break; case 6: showPropertiesTimerDone(); break; case 7: selectionChangedTimerDone(); break; case 8: windowsRepaintWorkaroundTimerTimeout(); break; default: return QWidget::qt_invoke( _id, _o ); } return TRUE; }
bool MainWindow::qt_emit( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->signalOffset() ) { case 0: currentToolChanged(); break; case 1: hasActiveForm((bool)static_QUType_bool.get(_o+1)); break; case 2: hasActiveWindow((bool)static_QUType_bool.get(_o+1)); break; case 3: hasActiveWindowOrProject((bool)static_QUType_bool.get(_o+1)); break; case 4: hasNonDummyProject((bool)static_QUType_bool.get(_o+1)); break; case 5: formModified((bool)static_QUType_bool.get(_o+1)); break; case 6: formWindowsChanged(); break; case 7: formWindowChanged(); break; case 8: projectChanged(); break; case 9: editorChanged(); break; default: return QMainWindow::qt_emit(_id,_o); } return TRUE; }
void MindToolBar::chooseTool() { MINDTOOL newTool; QObject* emiter = sender(); if(emiter==m_arrow) { newTool=MindToolBar::ARROW; } else if(emiter==m_handleItem) { newTool=MindToolBar::HANDLE; } else if(emiter==m_addBreak) { newTool=MindToolBar::ADD_BREAK; } else if(emiter==m_delBreak) { newTool=MindToolBar::DEL_BREAK; } emit currentToolChanged(newTool); }
void MindToolBar::setupUi() { m_itemList = new QListView(); connect(m_itemList, SIGNAL(pressed(QModelIndex)),this,SLOT(clickOn(QModelIndex))); m_itemList->setModel(m_model); m_edgeList = new QListView(); connect(m_edgeList, SIGNAL(pressed(QModelIndex)),this,SLOT(clickOnEdge(QModelIndex))); m_edgeList->setModel(m_edgeModel); m_geoList = new QListView(); connect(m_geoList, SIGNAL(pressed(QModelIndex)),this,SLOT(clickOnCommon(QModelIndex))); m_geoList->setModel(m_commonModel); QVBoxLayout* layout = new QVBoxLayout(this); //QHBoxLayout* buttonlayout = new QHBoxLayout(); /// @todo add icons to push button m_handleItem= new QPushButton(tr("Handle")); m_handleItem->setCheckable(true); layout->addWidget(m_handleItem); m_addBreak= new QPushButton(tr("Add Break")); m_addBreak->setCheckable(true); m_delBreak= new QPushButton(tr("Delete Break")); m_delBreak->setCheckable(true); layout->addWidget(m_addBreak); layout->addWidget(m_delBreak); layout->addWidget(new QLabel(tr("Shape:"),this)); layout->addWidget(m_geoList); layout->addWidget(new QLabel(tr("Edge:"),this)); layout->addWidget(m_edgeList); layout->addWidget(new QLabel(tr("Node:"),this)); layout->addWidget(m_itemList); QHBoxLayout* buttonlayout2 = new QHBoxLayout(); m_addItem= new QPushButton(tr("Add Item")); m_addItem->setCheckable(true); m_delItem= new QPushButton(tr("Delete Item")); m_delItem->setCheckable(true); buttonlayout2->addWidget(m_addItem); buttonlayout2->addWidget(m_delItem); layout->addLayout(buttonlayout2); //m_group->addButton(m_arrow); m_group->addButton(m_handleItem); m_group->addButton(m_delBreak); m_group->addButton(m_addBreak); m_group->setExclusive(false); connect(m_handleItem,SIGNAL(pressed()),this,SLOT(chooseTool())); connect(m_addBreak,SIGNAL(pressed()),this,SLOT(chooseTool())); connect(this,SIGNAL(currentToolChanged(MindToolBar::MINDTOOL)),this, SLOT(currentToolHasChanged(MindToolBar::MINDTOOL))); // connect(m_arrow,SIGNAL(pressed()),this,SLOT(chooseTool())); }
void MindToolBar::clickOnEdge(QModelIndex index) { emit currentToolChanged(MindToolBar::ARROW); emit currentEdgeBrushChanged(m_edgeModel->getNodeAt(index)); }
void MindToolBar::clickOnCommon(QModelIndex index) { emit currentToolChanged(MindToolBar::ADD_GEO); emit currentGeoTypeChanged(m_commonModel->getNodeAt(index)->getName()); }
void MindToolBar::clickOn(QModelIndex index) { emit currentToolChanged(MindToolBar::ADD_ITEM); emit currentNodeBrushChanged(m_model->getNodeAt(index)); }
void ToolsBar::currentToolHasChanged(QAction* bt) { SelectableTool previous = m_currentTool; if(bt==m_pencilAct) { m_currentTool = Pen; } if(bt==m_lineAct) { m_currentTool = Line; } if(bt==m_rectAct) { m_currentTool = EmptyRect; } if(bt==m_filledRectAct) { m_currentTool = FilledRect; } if(bt==m_ellipseAct) { m_currentTool = EmptyEllipse; } if(bt==m_filledEllipseAct) { m_currentTool = FilledEllipse; } if(bt==m_textAct) { if (!(m_textEdit->hasFocus())) { m_textEdit->setFocus(Qt::OtherFocusReason); m_textEdit->setSelection(0, m_textEdit->text().length()); } m_currentTool = Text; } if(bt==m_handAct) { m_currentTool = Handler; } if(bt==m_addNpcAct) { if (!(m_npcNameEdit->hasFocus())) { m_npcNameEdit->setFocus(Qt::OtherFocusReason); m_npcNameEdit->setSelection(0, m_npcNameEdit->text().length()); } m_currentTool = AddNpc; } if(bt==m_delNpcAct) { m_currentTool = DelNpc; } if(bt==m_moveCharacterAct) { m_currentTool = MoveCharacterToken; } if(bt==m_changeCharacterState) { m_currentTool = ChangeCharacterState; } if(previous!=m_currentTool) { emit currentToolChanged(m_currentTool); } }