ECOListWidget::ECOListWidget(QWidget *parent) : QWidget(parent), ui(new Ui::TagDetailWidget) { setObjectName("ECOListWidget"); ui->setupUi(this); m_filterModel = new QStringListModel(this); ui->tagList->setModel(m_filterModel); ui->renameItem->setVisible(false); setObjectName("ECOListWidget"); connect(ui->filterEdit, SIGNAL(textChanged(const QString&)), SLOT(findECO(const QString&))); connect(ui->filterDatabase, SIGNAL(clicked()), SLOT(filterSelectedECO())); connect(ui->tagList, SIGNAL(doubleClicked(const QModelIndex&)), SLOT(filterSelectedECO())); selectECO(QString()); QItemSelectionModel* selectionModel = ui->tagList->selectionModel(); connect(selectionModel, SIGNAL(selectionChanged(QItemSelection, QItemSelection)), this, SLOT(selectionChangedSlot())); ui->detailText->setOpenLinks(true); ui->detailText->setOpenExternalLinks(false); connect(ui->detailText, SIGNAL(anchorClicked(QUrl)), SLOT(slotLinkClicked(QUrl))); slotReconfigure(); }
PlayerListWidget::PlayerListWidget(QWidget *parent) : QWidget(parent), ui(new Ui::TagDetailWidget) { setObjectName("PlayerListWidget"); ui->setupUi(this); m_filterModel = new QStringListModel(this); ui->tagList->setModel(m_filterModel); setObjectName("PlayerListWidget"); connect(ui->filterEdit, SIGNAL(textChanged(const QString&)), SLOT(findPlayers(const QString&))); connect(ui->tagList, SIGNAL(clicked(const QModelIndex&)), SLOT(showSelectedPlayer())); connect(ui->filterDatabase, SIGNAL(clicked()), SLOT(filterSelectedPlayer())); connect(ui->renameItem, SIGNAL(clicked()), SLOT(renameSelectedPlayer())); connect(ui->tagList, SIGNAL(doubleClicked(const QModelIndex&)), SLOT(filterSelectedPlayer())); selectPlayer(QString()); QItemSelectionModel* selectionModel = ui->tagList->selectionModel(); connect(selectionModel, SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(selectionChangedSlot())); ui->detailText->setOpenLinks(false); connect(ui->detailText, SIGNAL(anchorClicked(QUrl)), SLOT(slotLinkClicked(QUrl))); slotReconfigure(); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); connect(ui->action_Beenden,SIGNAL(triggered()),this,SLOT(close())); connect(ui->actionNeues_Blatt,SIGNAL(triggered()),this,SLOT(slotNeuesBlatt())); connect(ui->pushNBlatt,SIGNAL(clicked()),this,SLOT(slotNeuesBlatt())); connect(ui->actionNeuer_Kurs,SIGNAL(triggered()),this,SLOT(slotNeuerKurs())); connect(ui->pushNKurs,SIGNAL(clicked()),this,SLOT(slotNeuerKurs())); connect(ui->action_Speichern,SIGNAL(triggered()),this,SLOT(slotSpeichern())); connect(ui->actionSpeichern_unter,SIGNAL(triggered()),this,SLOT(slotSpeichernunter())); connect(ui->actionNeu,SIGNAL(triggered()),this,SLOT(slotNeu())); connect(ui->action_ffnen,SIGNAL(triggered()),this,SLOT(slotLaden())); connect(ui->action_ber_Punkte,SIGNAL(triggered()),this,SLOT(slotUber())); connect(ui->action_ber_Qt,SIGNAL(triggered()),qApp,SLOT(aboutQt())); connect(ui->actionFarbe_W_hlen,SIGNAL(triggered()),this,SLOT(slotFarbe())); connect(ui->actionDiagramm_anzeigen,SIGNAL(triggered()),&Graphik,SLOT(show())); connect(ui->actionKurs_Bearbeiten,SIGNAL(triggered()),this,SLOT(slotKursBearbeiten())); ui->listView->setModel(&Kurse); Auswahl=-1; SpeicherOrt=""; connect(ui->listView->selectionModel(),SIGNAL(selectionChanged(QItemSelection ,QItemSelection )), this,SLOT(selectionChangedSlot(QItemSelection ,QItemSelection ))); Graphik.setListe(&Kurse); }
ToolListWidget::ToolListWidget(QWidget* parent) : QListWidget(parent) { connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(selectionChangedSlot())); this->setSelectionBehavior(QAbstractItemView::SelectItems); this->setSelectionMode(QAbstractItemView::SingleSelection); }
// Rename current group/item. void qsamplerInstrumentList::renameSlot (void) { QListViewItem *pListItem = QListView::selectedItem(); if (pListItem) pListItem->startRename(0); selectionChangedSlot(); }
PgxEditor::PgxEditor(Database *database, QString editor_name) { ++editor_widow_id; this->database = database; this->editor_name = editor_name; createActions(); breakpointArea = new BreakPointArea(this); lineNumberArea = new LineNumberArea(this); setStyleSheet("QPlainTextEdit{background-color: white; font: bold 14px 'Courier New';}"); highlighter = new Highlighter(document()); toolbar = new QToolBar; toolbar->setIconSize(QSize(36,36)); toolbar->setObjectName("pgxeditor"); toolbar->setMovable(false); toolbar->addAction(newpgxeditor_action); toolbar->addAction(cut_action); toolbar->addAction(copy_action); toolbar->addAction(paste_action); if(!editor_name.isEmpty()) { toolbar->addSeparator(); toolbar->addAction(save_action); toolbar->addSeparator(); toolbar->addAction(execute_action); } toolbar->addSeparator(); toolbar->addAction(selected_execute_action); toolbar->addAction(wrap_action); toolbar->addAction(find_action); pgxeditor_mainwin = new PgxEditorMainWindow; pgxeditor_mainwin->addToolBar(toolbar); pgxeditor_mainwin->setCentralWidget(this); pgxeditor_mainwin->setAttribute(Qt::WA_DeleteOnClose); find_bar = new QLineEdit; find_bar->setPlaceholderText(tr("Find")); find_bar->setVisible(false); pgxeditor_mainwin->statusBar()->setSizeGripEnabled(false); pgxeditor_mainwin->statusBar()->addPermanentWidget(casesensitivity_button, 0); pgxeditor_mainwin->statusBar()->addPermanentWidget(wholeword_button, 0); pgxeditor_mainwin->statusBar()->addPermanentWidget(backwards_button, 0); pgxeditor_mainwin->statusBar()->addPermanentWidget(find_bar); replace_bar = new QLineEdit; replace_bar->setPlaceholderText(tr("Replace")); replace_bar->setVisible(false); pgxeditor_mainwin->statusBar()->addPermanentWidget(replace_bar); connect(find_bar, SIGNAL(returnPressed()), this, SLOT(findText())); connect(replace_bar, SIGNAL(returnPressed()), this, SLOT(replaceText())); connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int))); connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int))); connect(this, SIGNAL(selectionChanged()), this, SLOT(selectionChangedSlot())); connect(this, SIGNAL(textChanged()), this, SLOT(textChangedSlot())); connect(pgxeditor_mainwin, SIGNAL(pgxeditorClosing()), this, SLOT(pgxeditorClosing())); updateLineNumberAreaWidth(0); }
// Add a new group item below the current one. void qsamplerInstrumentList::newGroupSlot (void) { qsamplerInstrumentGroup *pNewGroup = addGroup(tr("New Group"), groupItem(QListView::selectedItem())); if (pNewGroup) pNewGroup->startRename(0); selectionChangedSlot(); }
MainWindow6::MainWindow6(QWidget *parent) : QMainWindow(parent) { treeView = new QTreeView(this); setCentralWidget(treeView); standardModel = new QStandardItemModel; QStandardItem *rootNode = standardModel->invisibleRootItem(); QStandardItem *americaItem = new QStandardItem("America"); QStandardItem *mexicoItem = new QStandardItem("Mexico"); QStandardItem *usaItem = new QStandardItem("USA"); QStandardItem *bostonItem = new QStandardItem("Boston"); QStandardItem *europeItem = new QStandardItem("Europe"); QStandardItem *italyItem = new QStandardItem("Italy"); QStandardItem *romeItem = new QStandardItem("Rome"); QStandardItem *veronaItem = new QStandardItem("Verona"); rootNode->appendRow(americaItem); rootNode->appendRow(europeItem); americaItem->appendRow(mexicoItem); americaItem->appendRow(usaItem); usaItem->appendRow(bostonItem); europeItem->appendRow(italyItem); italyItem->appendRow(romeItem); italyItem->appendRow(veronaItem); treeView->setModel(standardModel); treeView->expandAll(); QItemSelectionModel *selectionModel = treeView->selectionModel(); connect(selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(selectionChangedSlot(QItemSelection,QItemSelection))); // QList<QStandardItem *> preparedRow = prepareRow("first", "second", "third"); // QStandardItem *item = standardModel->invisibleRootItem(); // item->appendRow(preparedRow); // QList<QStandardItem *> secondRow = prepareRow("111", "222", "333"); // preparedRow.first()->appendRow(secondRow); // treeView->setModel(standardModel); // treeView->expandAll(); }
// Edit current item below the current one. void qsamplerInstrumentList::editItemSlot (void) { QListViewItem *pListItem = QListView::selectedItem(); if (pListItem == NULL) return; if (pListItem->rtti() == Item) { qsamplerInstrument *pInstrument = NULL; qsamplerInstrumentItem *pItem = static_cast<qsamplerInstrumentItem *> (pListItem); if (pItem) pInstrument = pItem->instrument(); if (pInstrument) { // Save current key values... qsamplerInstrument oldInstrument(*pInstrument); // Do the edit dance... qsamplerInstrumentForm form(this); form.setup(pInstrument); if (form.exec()) { // Commit... pInstrument->mapInstrument(); // Check whether we changed instrument key... if (oldInstrument.map() == pInstrument->map() && oldInstrument.bank() == pInstrument->bank() && oldInstrument.prog() == pInstrument->prog()) { // just update tree item... pItem->update(); } else { // Unmap old instance... oldInstrument.unmapInstrument(); // Change item tree, whether applicable... if (m_iMidiMap < 0 || m_iMidiMap == pInstrument->map()) { // Add new brand item into view... addItem(pInstrument, groupItem(pListItem)); } else { // Just remove/hide old one. delete pItem; } } // Notify we've changes... emit instrumentsChanged(); } } } selectionChangedSlot(); }
GLineEdit::GLineEdit(QWidget *parent,VM *pVM) : QLineEdit(parent) { this->pVM = pVM; strcpy(this->cTextChangedEvent,""); strcpy(this->ccursorPositionChangedEvent,""); strcpy(this->ceditingFinishedEvent,""); strcpy(this->creturnPressedEvent,""); strcpy(this->cselectionChangedEvent,""); strcpy(this->ctextEditedEvent,""); QObject::connect(this, SIGNAL(textChanged(QString)),this, SLOT(textChangedSlot())); QObject::connect(this, SIGNAL(cursorPositionChanged(int,int)),this, SLOT(cursorPositionChangedSlot())); QObject::connect(this, SIGNAL(editingFinished()),this, SLOT(editingFinishedSlot())); QObject::connect(this, SIGNAL(returnPressed()),this, SLOT(returnPressedSlot())); QObject::connect(this, SIGNAL(selectionChanged()),this, SLOT(selectionChangedSlot())); QObject::connect(this, SIGNAL(textEdited(QString)),this, SLOT(textEditedSlot())); }
// Add a new instrument item below the current one. void qsamplerInstrumentList::newItemSlot (void) { qsamplerInstrument *pInstrument = new qsamplerInstrument(); qsamplerInstrumentForm form(this); form.setup(pInstrument); if (!form.exec()) { delete pInstrument; return; } // Commit... pInstrument->mapInstrument(); // add new item to the tree... addItem(pInstrument, groupItem(QListView::selectedItem())); // Notify we've changes... emit instrumentsChanged(); selectionChangedSlot(); }
// Remove current group/item. void qsamplerInstrumentList::deleteSlot (void) { QListViewItem *pListItem = QListView::selectedItem(); if (pListItem == NULL) return; qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance(); if (pMainForm == NULL) return; // Prompt user if this is for real... qsamplerOptions *pOptions = pMainForm->options(); if (pOptions && pOptions->bConfirmRemove) { if (QMessageBox::warning(this, QSAMPLER_TITLE ": " + tr("Warning"), tr("Delete %1:\n\n" "%2\n\n" "Are you sure?") .arg(pListItem->rtti() == Item ? tr("instrument") : tr("group")) .arg(pListItem->text(0)), tr("OK"), tr("Cancel")) > 0) return; } // Unmap instrument entry... if (pListItem->rtti() == Item) { qsamplerInstrumentItem *pItem = static_cast<qsamplerInstrumentItem *> (pListItem); if (pItem && pItem->instrument()) { pItem->instrument()->unmapInstrument(); emit instrumentsChanged(); } } // Do it for real... delete pListItem; selectionChangedSlot(); }
int DataMergeGui::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QDialog::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: addMergeList(); break; case 1: removeMergeList(); break; case 2: { bool _r = mergeData(); if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break; case 3: { bool _r = selectionChangedSlot(); if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break; case 4: { bool _r = upButtonSlot(); if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break; case 5: { bool _r = downButtonSlot(); if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break; default: ; } _id -= 6; } return _id; }
// General reloader. void qsamplerInstrumentList::refresh (void) { clear(); qsamplerMainForm *pMainForm = qsamplerMainForm::getInstance(); if (pMainForm == NULL) return; if (pMainForm->client() == NULL) return; QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); // Load the whole bunch of instrument items... qsamplerInstrumentItem *pItem = NULL; lscp_midi_instrument_t *pInstrs = ::lscp_list_midi_instruments(pMainForm->client(), m_iMidiMap); for (int iInstr = 0; pInstrs && pInstrs[iInstr].map >= 0; ++iInstr) { int iMap = pInstrs[iInstr].map; int iBank = pInstrs[iInstr].bank; int iProg = pInstrs[iInstr].prog; qsamplerInstrument *pInstrument = new qsamplerInstrument(iMap, iBank, iProg); if (pInstrument->getInstrument()) pItem = new qsamplerInstrumentItem(this, pInstrument, pItem); // Try to keep it snappy :) QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); } QApplication::restoreOverrideCursor(); if (pInstrs == NULL && ::lscp_client_get_errno(pMainForm->client())) { pMainForm->appendMessagesClient("lscp_list_midi_instruments"); pMainForm->appendMessagesError(tr("Could not get current list of MIDI instrument mappings.\n\nSorry.")); } selectionChangedSlot(); }
RecipeActionsHandler::RecipeActionsHandler( K3ListView *_parentListView, RecipeDB *db ) : QObject( _parentListView ), parentListView( _parentListView ), database( db ), categorizeAction( 0 ), removeFromCategoryAction( 0 ) { kpop = new KMenu( parentListView ); catPop = new KMenu( parentListView ); connect( parentListView, SIGNAL( contextMenu( K3ListView *, Q3ListViewItem *, const QPoint & ) ), SLOT( showPopup( K3ListView *, Q3ListViewItem *, const QPoint & ) ) ); connect( parentListView, SIGNAL( doubleClicked( Q3ListViewItem*, const QPoint &, int ) ), SLOT( open() ) ); connect( parentListView, SIGNAL( selectionChanged() ), SLOT( selectionChangedSlot() ) ); connect( this, SIGNAL( printDone() ), this, SLOT( printDoneSlot() ), Qt::QueuedConnection ); }
// Constructor. qsamplerInstrumentList::qsamplerInstrumentList ( QWidget *pParent, const char *pszName ) : QListView(pParent, pszName) { m_iMidiMap = LSCP_MIDI_MAP_ALL; // QListView::setRootIsDecorated(true); QListView::setAllColumnsShowFocus(true); QListView::setResizeMode(QListView::NoColumn); // QListView::setAcceptDrops(true); QListView::setDragAutoScroll(true); QListView::setSizePolicy( QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); // QListView::setShowToolTips(false); QListView::setSortColumn(-1); QListView::addColumn(tr("Name")); QListView::addColumn(tr("Map")); QListView::addColumn(tr("Bank")); QListView::addColumn(tr("Prog")); QListView::addColumn(tr("Engine")); QListView::addColumn(tr("File")); QListView::addColumn(tr("Nr")); QListView::addColumn(tr("Vol")); QListView::addColumn(tr("Mode")); QListView::setColumnAlignment(1, Qt::AlignHCenter); // Map QListView::setColumnAlignment(2, Qt::AlignHCenter); // Bank QListView::setColumnAlignment(3, Qt::AlignHCenter); // Prog QListView::setColumnAlignment(6, Qt::AlignHCenter); // Nr QListView::setColumnAlignment(7, Qt::AlignHCenter); // Vol QListView::setColumnWidth(0, 120); // Name QListView::setColumnWidth(5, 240); // File m_pNewGroupAction = new QAction( QIconSet(QPixmap::fromMimeSource("itemGroupNew.png")), tr("New &Group"), tr("Ctrl+G"), this); m_pNewItemAction = new QAction( QIconSet(QPixmap::fromMimeSource("itemNew.png")), tr("New &Instrument..."), tr("Ins"), this); m_pEditItemAction = new QAction( QIconSet(QPixmap::fromMimeSource("formEdit.png")), tr("&Edit..."), tr("Enter"), this); m_pRenameAction = new QAction(tr("&Rename"), tr("F2"), this); m_pDeleteAction = new QAction( QIconSet(QPixmap::fromMimeSource("formRemove.png")), tr("&Delete"), tr("Del"), this); m_pRefreshAction = new QAction( QIconSet(QPixmap::fromMimeSource("formRefresh.png")), tr("Re&fresh"), tr("F5"), this); m_pNewGroupAction->setToolTip(tr("New Group")); m_pNewItemAction->setToolTip(tr("New Instrument")); m_pEditItemAction->setToolTip(tr("Edit")); m_pRenameAction->setToolTip(tr("Rename")); m_pDeleteAction->setToolTip(tr("Delete")); m_pRefreshAction->setToolTip(tr("Refresh")); QObject::connect(m_pNewGroupAction, SIGNAL(activated()), SLOT(newGroupSlot())); QObject::connect(m_pNewItemAction, SIGNAL(activated()), SLOT(newItemSlot())); QObject::connect(m_pEditItemAction, SIGNAL(activated()), SLOT(editItemSlot())); QObject::connect(m_pRenameAction, SIGNAL(activated()), SLOT(renameSlot())); QObject::connect(m_pDeleteAction, SIGNAL(activated()), SLOT(deleteSlot())); QObject::connect(m_pRefreshAction, SIGNAL(activated()), SLOT(refresh())); QObject::connect(this, SIGNAL(selectionChanged()), SLOT(selectionChangedSlot())); QObject::connect(this, SIGNAL(doubleClicked(QListViewItem*, const QPoint&, int)), SLOT(activatedSlot(QListViewItem*))); QObject::connect(this, SIGNAL(returnPressed(QListViewItem*)), SLOT(activatedSlot(QListViewItem*))); QObject::connect(this, SIGNAL(itemRenamed(QListViewItem*,int)), SLOT(renamedSlot(QListViewItem*))); selectionChangedSlot(); }
void QgsMapCanvas::setLayerSet( QList<QgsMapCanvasLayer> &layers ) { // create layer set QStringList layerSet, layerSetOverview; int i; for ( i = 0; i < layers.size(); i++ ) { QgsMapCanvasLayer &lyr = layers[i]; if ( !lyr.layer() ) { continue; } if ( lyr.isVisible() ) { layerSet.push_back( lyr.layer()->id() ); } if ( lyr.isInOverview() ) { layerSetOverview.push_back( lyr.layer()->id() ); } } const QStringList& layerSetOld = mapSettings().layers(); bool layerSetChanged = layerSetOld != layerSet; // update only if needed if ( layerSetChanged ) { QgsDebugMsg( "Layers changed to: " + layerSet.join( ", " ) ); for ( i = 0; i < layerCount(); i++ ) { // Add check if vector layer when disconnecting from selectionChanged slot // Ticket #811 - racicot QgsMapLayer *currentLayer = layer( i ); if ( !currentLayer ) continue; disconnect( currentLayer, SIGNAL( repaintRequested() ), this, SLOT( refresh() ) ); disconnect( currentLayer, SIGNAL( layerCrsChanged() ), this, SLOT( layerCrsChange() ) ); QgsVectorLayer *isVectLyr = qobject_cast<QgsVectorLayer *>( currentLayer ); if ( isVectLyr ) { disconnect( currentLayer, SIGNAL( selectionChanged() ), this, SLOT( selectionChangedSlot() ) ); } } mSettings.setLayers( layerSet ); for ( i = 0; i < layerCount(); i++ ) { // Add check if vector layer when connecting to selectionChanged slot // Ticket #811 - racicot QgsMapLayer *currentLayer = layer( i ); connect( currentLayer, SIGNAL( repaintRequested() ), this, SLOT( refresh() ) ); connect( currentLayer, SIGNAL( layerCrsChanged() ), this, SLOT( layerCrsChange() ) ); QgsVectorLayer *isVectLyr = qobject_cast<QgsVectorLayer *>( currentLayer ); if ( isVectLyr ) { connect( currentLayer, SIGNAL( selectionChanged() ), this, SLOT( selectionChangedSlot() ) ); } } updateDatumTransformEntries(); QgsDebugMsg( "Layers have changed, refreshing" ); emit layersChanged(); refresh(); } if ( mMapOverview ) { const QStringList& layerSetOvOld = mMapOverview->layerSet(); if ( layerSetOvOld != layerSetOverview ) { mMapOverview->setLayerSet( layerSetOverview ); } // refresh overview maplayers even if layer set is the same // because full extent might have changed updateOverview(); } } // setLayerSet