void HistoryMessagesTab::createGui() { TimelinePopupMenu = new QMenu(this); TimelinePopupMenu->addAction(KaduIcon("kadu_icons/clear-history").icon(), tr("&Remove entries"), this, SLOT(removeEntries())); QVBoxLayout *layout = new QVBoxLayout(this); layout->setMargin(2); Splitter = new QSplitter(Qt::Horizontal, this); FilteredView = new FilteredTreeView(FilteredTreeView::FilterAtTop, Splitter); FilteredView->filterWidget()->setAutoVisibility(false); FilteredView->filterWidget()->setLabel(tr("Filter") + ":"); TalkableTree = new TalkableTreeView(FilteredView); TalkableTree->setAlternatingRowColors(true); TalkableTree->setContextMenuEnabled(true); TalkableTree->setContextMenuPolicy(Qt::CustomContextMenu); TalkableTree->setUseConfigurationColors(true); TalkableTree->delegateConfiguration().setShowMessagePixmap(false); QString style; style.append("QTreeView::branch:has-siblings:!adjoins-item { border-image: none; image: none }"); style.append("QTreeView::branch:has-siblings:adjoins-item { border-image: none; image: none }"); style.append("QTreeView::branch:has-childres:!has-siblings:adjoins-item { border-image: none; image: none }"); TalkableTree->setStyleSheet(style); TalkableTree->viewport()->setStyleSheet(style); connect(TalkableTree, SIGNAL(currentChanged(Talkable)), this, SLOT(currentTalkableChanged(Talkable))); connect(TalkableTree, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showTalkablePopupMenu())); FilteredView->setView(TalkableTree); TimelineView = new TimelineChatMessagesView(Splitter); TimelineView->searchBar()->setAutoVisibility(false); TimelineView->searchBar()->setSearchWidget(this); TimelineView->timeline()->setContextMenuPolicy(Qt::CustomContextMenu); connect(TimelineView->timeline(), SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showTimelinePopupMenu())); connect(timelineView(), SIGNAL(currentDateChanged()), this, SLOT(currentDateChanged())); QList<int> sizes; sizes.append(150); sizes.append(300); Splitter->setSizes(sizes); layout->addWidget(Splitter); setFocusProxy(FilteredView->filterWidget()); }
QT_BEGIN_NAMESPACE BookmarkDialog::BookmarkDialog(BookmarkModel *sourceModel, const QString &title, const QString &url, QWidget *parent) : QDialog(parent) , m_url(url) , m_title(title) , bookmarkModel(sourceModel) { TRACE_OBJ ui.setupUi(this); ui.bookmarkEdit->setText(m_title); ui.newFolderButton->setVisible(false); ui.buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(accepted())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(rejected())); connect(ui.newFolderButton, SIGNAL(clicked()), this, SLOT(addFolder())); connect(ui.toolButton, SIGNAL(clicked()), this, SLOT(toolButtonClicked())); connect(ui.bookmarkEdit, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString))); bookmarkProxyModel = new BookmarkFilterModel(this); bookmarkProxyModel->setSourceModel(bookmarkModel); ui.bookmarkFolders->setModel(bookmarkProxyModel); connect(ui.bookmarkFolders, SIGNAL(currentIndexChanged(int)), this, SLOT(currentIndexChanged(int))); bookmarkTreeModel = new BookmarkTreeModel(this); bookmarkTreeModel->setSourceModel(bookmarkModel); ui.treeView->setModel(bookmarkTreeModel); ui.treeView->expandAll(); ui.treeView->setVisible(false); ui.treeView->installEventFilter(this); ui.treeView->viewport()->installEventFilter(this); ui.treeView->setContextMenuPolicy(Qt::CustomContextMenu); connect(ui.treeView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint))); connect(ui.treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(currentIndexChanged(QModelIndex))); ui.bookmarkFolders->setCurrentIndex(0); ui.treeView->setCurrentIndex(ui.treeView->indexAt(QPoint(2, 2))); const HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); if (helpEngine.usesAppFont()) setFont(helpEngine.appFont()); }
void MyTabbedStackWidget::showWidget(int index) { if (m_stackWidget->currentIndex() == index) { return; } bool proceed = false; emit currentAboutToShow(index, &proceed); if (proceed) { m_stackWidget->setCurrentIndex(index); emit currentChanged(index); } else { m_listWidget->setCurrentRow(m_stackWidget->currentIndex(), QItemSelectionModel::ClearAndSelect); } }
void MainWindow::slot_fileOpen() { QFileDialog *dialog = new QFileDialog(this); dialog->setOption(QFileDialog::DontUseNativeDialog, true); SGFPreview *previewWidget = new SGFPreview(dialog); QGridLayout *layout = (QGridLayout*)dialog->layout(); layout->addWidget(previewWidget, 1, 3); connect(dialog,SIGNAL(currentChanged(QString)),previewWidget,SLOT(setPath(QString))); connect(dialog,SIGNAL(fileSelected(QString)),this,SLOT(openSGF(QString))); dialog->setNameFilter("Smart Game Format (*.sgf *.SGF)"); dialog->setFileMode(QFileDialog::ExistingFile); dialog->exec(); delete dialog; }
UAVObjectBrowserWidget::UAVObjectBrowserWidget(QWidget *parent) : QWidget(parent), updatePeriod(MAXIMUM_UPDATE_PERIOD) { // Create browser and configuration GUIs m_browser = new Ui_UAVObjectBrowser(); m_viewoptions = new Ui_viewoptions(); m_viewoptionsDialog = new QDialog(this); m_viewoptions->setupUi(m_viewoptionsDialog); m_browser->setupUi(this); // Create data model m_model = new UAVObjectTreeModel(); // Create tree view and add to layout treeView = new UAVOBrowserTreeView(m_model, MAXIMUM_UPDATE_PERIOD); treeView->setObjectName(QString::fromUtf8("treeView")); m_browser->verticalLayout->addWidget(treeView); treeView->setModel(m_model); treeView->setColumnWidth(0, 300); treeView->setEditTriggers(QAbstractItemView::AllEditTriggers); treeView->setSelectionBehavior(QAbstractItemView::SelectItems); treeView->setUniformRowHeights(true); BrowserItemDelegate *m_delegate = new BrowserItemDelegate(); treeView->setItemDelegate(m_delegate); showMetaData(m_viewoptions->cbMetaData->isChecked()); // Connect signals connect(treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(toggleUAVOButtons(QModelIndex,QModelIndex))); connect(m_viewoptions->cbMetaData, SIGNAL(toggled(bool)), this, SLOT(showMetaData(bool))); connect(m_viewoptions->cbCategorized, SIGNAL(toggled(bool)), this, SLOT(categorize(bool))); connect(m_browser->saveSDButton, SIGNAL(clicked()), this, SLOT(saveObject())); connect(m_browser->readSDButton, SIGNAL(clicked()), this, SLOT(loadObject())); connect(m_browser->eraseSDButton, SIGNAL(clicked()), this, SLOT(eraseObject())); connect(m_browser->sendButton, SIGNAL(clicked()), this, SLOT(sendUpdate())); connect(m_browser->requestButton, SIGNAL(clicked()), this, SLOT(requestUpdate())); connect(m_browser->viewSettingsButton,SIGNAL(clicked()),this,SLOT(viewSlot())); connect(m_viewoptions->cbScientific, SIGNAL(toggled(bool)), this, SLOT(useScientificNotation(bool))); connect(m_viewoptions->cbScientific, SIGNAL(toggled(bool)), this, SLOT(viewOptionsChangedSlot())); connect(m_viewoptions->cbMetaData, SIGNAL(toggled(bool)), this, SLOT(viewOptionsChangedSlot())); connect(m_viewoptions->cbCategorized, SIGNAL(toggled(bool)), this, SLOT(viewOptionsChangedSlot())); connect((QTreeView*) treeView, SIGNAL(collapsed(QModelIndex)), this, SLOT(on_TreeItemCollapsed(QModelIndex) )); connect((QTreeView*) treeView, SIGNAL(expanded(QModelIndex)), this, SLOT(on_TreeItemExpanded(QModelIndex) )); // Set browser buttons to disabled enableUAVOBrowserButtons(false); }
void LiteTabWidget::tabCurrentChanged(int index) { QWidget *w = m_widgetList.value(index); if (w) { m_stackedWidget->setCurrentWidget(w); } QAction *act = m_listActGroup->actions().value(index); if (act) { act->setChecked(true); } emit currentChanged(index); }
void Q3DataBrowser::postNav(bool primeUpd) { if (primeUpd) { QSqlRecord* buf = d->frm.record(); Q3SqlCursor* cur = d->cur.cursor(); if (!buf || !cur) return; currentChanged(cur); cur->primeUpdate(); emit primeUpdate(buf); readFields(); } updateBoundary(); }
LegacyJarModPage::LegacyJarModPage(LegacyInstance *inst, QWidget *parent) : QWidget(parent), ui(new Ui::LegacyJarModPage), m_inst(inst) { ui->setupUi(this); m_jarmods = m_inst->jarModList(); ui->jarModsTreeView->setModel(m_jarmods.get()); ui->jarModsTreeView->setDragDropMode(QAbstractItemView::DragDrop); ui->jarModsTreeView->setSelectionMode(QAbstractItemView::SingleSelection); ui->jarModsTreeView->installEventFilter(this); m_jarmods->startWatching(); auto smodel = ui->jarModsTreeView->selectionModel(); connect(smodel, SIGNAL(currentChanged(QModelIndex, QModelIndex)), SLOT(jarCurrent(QModelIndex, QModelIndex))); }
ObjectViewer::ObjectViewer(QWidget* parent, Qt::WindowFlags f) : ViewerInterface(parent, f) { mainLayout = new QHBoxLayout(this); auto leftLayout = new QVBoxLayout; objectList = new QTableView; objectMenu = new QMenu(objectList); objectList->setContextMenuPolicy(Qt::CustomContextMenu); auto viewModelAction = new QAction("View Model", objectMenu); objectMenu->addAction(viewModelAction); connect(viewModelAction, SIGNAL(triggered()), this, SLOT(menuViewModel())); connect(objectList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onCustomContextMenu(QPoint))); filterModel = new ObjectSearchModel(this); objectList->setModel(filterModel); objectList->setColumnWidth(0, 50); objectList->setColumnWidth(1, 150); objectList->setColumnWidth(2, 200); objectList->setSortingEnabled(true); objectList->setSelectionBehavior(QAbstractItemView::SelectionBehavior::SelectRows); connect(objectList->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(showItem(QModelIndex))); leftLayout->addLayout(searchControls(filterModel)); leftLayout->addWidget(objectList); mainLayout->addLayout(leftLayout, 6); previewWidget = createViewer(); previewWidget->setMode(ViewerWidget::Mode::Object); infoLayout = new QGridLayout; previewID = new QLabel; previewModel = new QLabel; previewClass = new QLabel; infoLayout->addWidget(new QLabel("ID"), 1, 0); infoLayout->addWidget(previewID, 1, 1); infoLayout->addWidget(new QLabel("Type"), 2, 0); infoLayout->addWidget(previewClass, 2, 1); infoLayout->addWidget(new QLabel("Model"), 3, 0); infoLayout->addWidget(previewModel, 3, 1); infoLayout->addWidget(QWidget::createWindowContainer(previewWidget), 0, 0, 1, 2); infoLayout->setRowStretch(0, 1); mainLayout->addLayout(infoLayout, 4); setLayout(mainLayout); }
void FooTabWidget::closeTab(int index) { if (count() > 1) { QWidget* current = widget(index); if (FooPlaylistManager::instance()->currentPlaylistIndex() == index) { emit currentChanged(index - 1); FooPlaylistManager::instance()->useSelectedPlaylist(); } delete current; FooPlaylistManager::instance()->deletePlaylist(index); } }
void HAnalyze_a::getProductsForClientsInRange() { QString sql; sql="SELECT distinct prodotti.ID,prodotti.descrizione from lotdef,prodotti,associazioni,ricette where associazioni.ID_ricetta=ricette.ID and ricette.ID_prodotto=prodotti.ID and prodotti.ID=ricette.ID_prodotto and associazioni.ID_cliente="+ID+ " and lotdef.data between '"+ui->dateDal->date().toString("yyyy-MM-dd")+"' and '"+ui->dateAl->date().toString("yyyy-MM-dd")+"'"; QSqlQuery q(db); m=new QSqlQueryModel(); q.exec(sql); m->setQuery(q); ui->lvWhat->setModel(m); ui->lvWhat->setModelColumn(1); connect(ui->lvWhat->selectionModel(),SIGNAL(currentChanged(QModelIndex,QModelIndex)),this,SLOT(requestData())); //// qDebug()<<"getproductsforClients:"<<q.lastQuery()<<q.lastError().text(); }
void OnyxPlayerView::deattachModel() { if (model_ != 0) { // clear data ODatas empty_data; song_list_view_.setData(empty_data); disconnect(model_, SIGNAL(firstAdded()), this, SLOT(play())); disconnect(model_, SIGNAL(loadingFinished()), this, SLOT(onLoadingFinished())); disconnect(model_, SIGNAL(currentChanged()), this, SLOT(onCurrentChanged())); model_ = 0; } }
void EditEntryWidget::setupAdvanced() { m_advancedUi->setupUi(m_advancedWidget); add(tr("Advanced"), m_advancedWidget); m_attachmentsModel->setEntryAttachments(m_entryAttachments); m_advancedUi->attachmentsView->setModel(m_attachmentsModel); connect(m_advancedUi->attachmentsView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), SLOT(updateAttachmentButtonsEnabled(QModelIndex))); connect(m_advancedUi->attachmentsView, SIGNAL(doubleClicked(QModelIndex)), SLOT(openAttachment(QModelIndex))); connect(m_advancedUi->saveAttachmentButton, SIGNAL(clicked()), SLOT(saveCurrentAttachment())); connect(m_advancedUi->openAttachmentButton, SIGNAL(clicked()), SLOT(openCurrentAttachment())); connect(m_advancedUi->addAttachmentButton, SIGNAL(clicked()), SLOT(insertAttachment())); connect(m_advancedUi->removeAttachmentButton, SIGNAL(clicked()), SLOT(removeCurrentAttachment())); m_attributesModel->setEntryAttributes(m_entryAttributes); m_advancedUi->attributesView->setModel(m_attributesModel); connect(m_advancedUi->addAttributeButton, SIGNAL(clicked()), SLOT(insertAttribute())); connect(m_advancedUi->editAttributeButton, SIGNAL(clicked()), SLOT(editCurrentAttribute())); connect(m_advancedUi->removeAttributeButton, SIGNAL(clicked()), SLOT(removeCurrentAttribute())); connect(m_advancedUi->attributesView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), SLOT(updateCurrentAttribute())); }
bool QTabDialog::qt_emit( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->signalOffset() ) { case 0: aboutToShow(); break; case 1: applyButtonPressed(); break; case 2: cancelButtonPressed(); break; case 3: defaultButtonPressed(); break; case 4: helpButtonPressed(); break; case 5: currentChanged((QWidget*)static_QUType_ptr.get(_o+1)); break; case 6: selected((const QString&)static_QUType_QString.get(_o+1)); break; default: return QDialog::qt_emit(_id,_o); } return TRUE; }
void Browser::showTable(const QString &t) { QSqlTableModel *model = new QSqlTableModel(table, connectionWidget->currentDatabase()); model->setEditStrategy(QSqlTableModel::OnRowChange); model->setTable(t); model->select(); if (model->lastError().type() != QSqlError::NoError) emit statusMessage(model->lastError().text()); table->setModel(model); table->setEditTriggers(QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed); connect(table->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), this, SLOT(currentChanged())); updateActions(); }
void SGraphicStack::setCurrentIndex( int index , bool signal_on ) { if( p->current_index != -1 ) p->list[ p->current_index ]->setChecked( false ); p->current_index = index; recheck(); if( !signal_on ) return ; emit currentIndexChanged( p->current_index ); if( p->current_index != -1 ) emit currentChanged( p->list.at( p->current_index )->text() ); }
void JabberAdd::showEvent(QShowEvent *e) { JabberAddBase::showEvent(e); if (m_wizard == NULL){ m_wizard = static_cast<QWizard*>(topLevelWidget()); connect(this, SIGNAL(goNext()), m_wizard, SLOT(goNext())); } if (m_result == NULL){ m_result = new AddResult(m_client); connect(m_result, SIGNAL(finished()), this, SLOT(addResultFinished())); connect(m_result, SIGNAL(search()), this, SLOT(startSearch())); m_wizard->addPage(m_result, i18n("Add Jabber contact")); } currentChanged(NULL); }
void BuddyContactsTable::createGui() { QHBoxLayout *layout = new QHBoxLayout(this); View = new QTableView(this); View->setAlternatingRowColors(true); View->setDragEnabled(true); View->setEditTriggers(QAbstractItemView::AllEditTriggers); View->setItemDelegate(Delegate); View->setModel(Proxy); View->setSelectionBehavior(QAbstractItemView::SelectRows); View->setVerticalHeader(0); View->horizontalHeader()->setResizeMode(QHeaderView::Stretch); View->horizontalHeader()->setStretchLastSection(true); connect(View->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(viewSelectionChanged(QModelIndex,QModelIndex))); layout->addWidget(View); QWidget *buttons = new QWidget(View); QVBoxLayout *buttonsLayout = new QVBoxLayout(buttons); MoveUpButton = new QPushButton(tr("Move up"), buttons); connect(MoveUpButton, SIGNAL(clicked(bool)), this, SLOT(moveUpClicked())); buttonsLayout->addWidget(MoveUpButton); MoveDownButton = new QPushButton(tr("Move down"), buttons); connect(MoveDownButton, SIGNAL(clicked(bool)), this, SLOT(moveDownClicked())); buttonsLayout->addWidget(MoveDownButton); AddContactButton = new QPushButton(tr("Add contact"), buttons); connect(AddContactButton, SIGNAL(clicked(bool)), this, SLOT(addClicked())); buttonsLayout->addWidget(AddContactButton); DetachContactButton = new QPushButton(tr("Detach contact"), buttons); connect(DetachContactButton, SIGNAL(clicked(bool)), this, SLOT(detachClicked())); buttonsLayout->addWidget(DetachContactButton); RemoveContactButton = new QPushButton(tr("Remove contact"), buttons); connect(RemoveContactButton, SIGNAL(clicked(bool)), this, SLOT(removeClicked())); buttonsLayout->addWidget(RemoveContactButton); viewSelectionChanged(QModelIndex(), QModelIndex()); layout->addWidget(buttons); }
void QToolBox::setCurrentItem( QWidget *item ) { QToolBoxPrivate::Page *c = d->page( item ); if ( !c || d->currentPage == c ) return; c->button->setSelected( TRUE ); if ( d->currentPage ) { d->currentPage->sv->hide(); d->currentPage->button->setSelected(FALSE); } d->currentPage = c; d->currentPage->sv->show(); d->updateTabs(); emit currentChanged( indexOf(item) ); }
int dListViewEx::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QListView::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: rowsAboutToBeRemoved(*(QModelIndex*)_a[1],*(int*)_a[2],*(int*)_a[3]); break; case 1: rowsInserted(*(QModelIndex*)_a[1],*(int*)_a[2],*(int*)_a[3]); break; case 2: dataChanged(*(QModelIndex*)_a[1],*(QModelIndex*)_a[2]); break; case 3: currentChanged(*(QModelIndex*)_a[1],*(QModelIndex*)_a[2]); break; } _id -= 4; } return _id; }
void LocationCompleter::slotPopupClosed() { m_popupClosed = true; m_oldSuggestions.clear(); disconnect(s_view, SIGNAL(closed()), this, SLOT(slotPopupClosed())); disconnect(s_view, SIGNAL(indexActivated(QModelIndex)), this, SLOT(indexActivated(QModelIndex))); disconnect(s_view, SIGNAL(indexCtrlActivated(QModelIndex)), this, SLOT(indexCtrlActivated(QModelIndex))); disconnect(s_view, SIGNAL(indexShiftActivated(QModelIndex)), this, SLOT(indexShiftActivated(QModelIndex))); disconnect(s_view, SIGNAL(indexDeleteRequested(QModelIndex)), this, SLOT(indexDeleteRequested(QModelIndex))); disconnect(s_view, &LocationCompleterView::loadRequested, this, &LocationCompleter::loadRequested); disconnect(s_view, &LocationCompleterView::searchEnginesDialogRequested, this, &LocationCompleter::openSearchEnginesDialog); disconnect(s_view->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(currentChanged(QModelIndex))); emit popupClosed(); }
FileList::FileList( QWidget *parent ) : QDockWidget( parent ) { setWindowTitle( "Open Files" ); QWidget *titleWidget = new QWidget( this ); setTitleBarWidget( titleWidget ); mTreeView = new OpenFileTreeView( this, OpenFileTreeView::CloseButtons | OpenFileTreeView::RefreshButtons ); mTreeView->setMinimumWidth( 150 ); setWidget( mTreeView ); connect( gDispatcher, SIGNAL( selectFile( BaseFile * ) ), this, SLOT( selectFile( BaseFile * ) ) ); connect( mTreeView->selectionModel(), SIGNAL( currentChanged( QModelIndex, QModelIndex ) ), this, SLOT( fileSelected() ) ); }
bool QTable::qt_emit( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->signalOffset() ) { case 0: currentChanged((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break; case 1: clicked((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2),(int)static_QUType_int.get(_o+3),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+4))); break; case 2: doubleClicked((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2),(int)static_QUType_int.get(_o+3),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+4))); break; case 3: pressed((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2),(int)static_QUType_int.get(_o+3),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+4))); break; case 4: selectionChanged(); break; case 5: valueChanged((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break; case 6: contextMenuRequested((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3))); break; case 7: dropped((QDropEvent*)static_QUType_ptr.get(_o+1)); break; default: return QScrollView::qt_emit(_id,_o); } return TRUE; }
void MessageModel::setCurrent(bool current) { if (m_current != current) { m_current = current; if (!current) { m_seen.fill(true); setSeparator(m_messages.count() - 1); } else { setBadge(0); setActiveHighlights(0); if (m_separator == -1) setSeparator(m_messages.count() - 1); } emit currentChanged(); } }
void AddonManagementDialog::installScript() { QString szFileName, szError; if(!KviFileDialog::askForOpenFileName( szFileName, __tr2qs_ctx("Select a Installation File - KVIrc","addon"), QString(),KVI_FILTER_ADDON,false,true,this )) return; szFileName.replace("\\","\\\\"); // Sanity check if(szFileName.endsWith(".kva")) { if(!AddonFunctions::installAddonPackage(szFileName,szError,this)) { QMessageBox::critical( this, __tr2qs_ctx("Install Addon - KVIrc","addon"), szError, QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton ); return; } } else { // Just for sanity check. We should NEVER enter here qDebug("Entered sanity check"); AddonFunctions::notAValidAddonPackage(szError); QMessageBox::critical( this, __tr2qs_ctx("Install Addon - KVIrc","addon"), szError, QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton ); } fillListView(); currentChanged(0,0); //m_pListWidget->publicUpdateContents(); //m_pListWidget->triggerUpdate(); }
void AlarmView::init() { /* Create stuff! */ QFormLayout *mainL = new QFormLayout(); mainL->setSpacing(2); mainL->setMargin(2); mAlarmList = new QWrapListView(); mAlarmList->setSelectionMode(QListView::SingleSelection); mAlarmList->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); //mAlarmList->setUniformItemSizes(true); mAlarmList->setAlternatingRowColors(true); mAlarmList->setItemDelegate(new TwoLevelDelegate(mAlarmList)); mAlarmList->setResizeMode(QListView::Adjust); mAlarmList->setLayoutMode(QListView::Batched); QSizePolicy expando(QSizePolicy::Expanding, QSizePolicy::Expanding); expando.setVerticalStretch(1); mAlarmList->setSizePolicy(expando); mainL->addRow(mAlarmList); mSnoozeButton = new QPushButton(tr("Snooze")); mainL->addRow(mSnoozeButton); mSnoozeChoices = new QComboBox(); mSnoozeChoices->clear(); mSnoozeChoices->addItem(tr("5 minutes")); mSnoozeChoices->addItem(tr("10 minutes")); mSnoozeChoices->addItem(tr("15 minutes")); mSnoozeChoices->addItem(tr("30 minutes")); mSnoozeChoices->addItem(tr("1 hour")); mSnoozeChoices->addItem(tr("1 day")); mSnoozeChoices->addItem(tr("1 week")); mSnoozeChoices->addItem(tr("1 month")); mainL->addRow(tr("Snooze delay:"), mSnoozeChoices); setLayout(mainL); mStandardModel = new QStandardItemModel(this); mAlarmList->setModel(mStandardModel); connect(mAlarmList->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(currentAlarmChanged(QModelIndex))); connect(mAlarmList, SIGNAL(activated(QModelIndex)), this, SLOT(alarmSelected(QModelIndex))); connect(mSnoozeButton, SIGNAL(clicked()), this, SLOT(snoozeClicked())); }
PageContainer::PageContainer(BasePageProviderPtr pageProvider, QString defaultId, QWidget *parent) : QWidget(parent) { createUI(); m_model = new PageModel(this); m_proxyModel = new PageEntryFilterModel(this); int firstIndex = -1; int counter = 0; auto pages = pageProvider->getPages(); for (auto page : pages) { page->stackIndex = m_pageStack->addWidget(dynamic_cast<QWidget *>(page)); page->listIndex = counter; counter++; if (firstIndex == -1) { firstIndex = page->stackIndex; } } m_model->setPages(pages); m_proxyModel->setSourceModel(m_model); m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); m_pageList->setIconSize(QSize(pageIconSize, pageIconSize)); m_pageList->setSelectionMode(QAbstractItemView::SingleSelection); m_pageList->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); m_pageList->setModel(m_proxyModel); connect(m_pageList->selectionModel(), SIGNAL(currentRowChanged(QModelIndex, QModelIndex)), this, SLOT(currentChanged(QModelIndex))); m_pageStack->setStackingMode(QStackedLayout::StackOne); m_pageList->setFocus(); // now find what we want to have selected... auto page = m_model->findPageEntryById(defaultId); QModelIndex index; if (page) { index = m_proxyModel->mapFromSource(m_model->index(page->listIndex)); } else { index = m_proxyModel->index(0, 0); } if (index.isValid()) m_pageList->setCurrentIndex(index); }
void CarShopMenu::gameStateLoaded(Client::State* state) { model.reset(new VehicleTableModel(state->getShopVehicles())); TableView* view = ui->carList; view->setModel(model.get()); connect(ui->carList->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(onCurrentChanged(QModelIndex, QModelIndex))); view->showColumn(model->name.getIndex()); view->showColumn(model->price.getIndex()); view->horizontalHeader()->setResizeMode(model->name.getIndex(), QHeaderView::Stretch); player = state->getPlayer(); vehicle = nullptr; }
void WorkspacesInfo::updateCurrentWorkspace() { int currentWorkspace; unsigned long *result; result = getX11IntProperty(_NET_CURRENT_DESKTOP, 1); if (result == NULL) { currentWorkspace = 0; } else { currentWorkspace = result[0]; } XFree(result); if (m_current != currentWorkspace) { m_current = currentWorkspace; Q_EMIT currentChanged(m_current); } }
KCMDesktopTheme::KCMDesktopTheme( QWidget* parent, const QVariantList& ) : KCModule( parent ) , m_dialog(0) , m_installProcess(0) , m_defaultTheme(new Plasma::Theme(this)) { setQuickHelp( i18n("<h1>Desktop Theme</h1>" "This module allows you to modify the visual appearance " "of the desktop.")); setupUi(this); m_bDesktopThemeDirty = false; m_bDetailsDirty = false; KAutostart plasmaNetbookAutoStart("plasma-netbook"); m_isNetbook = plasmaNetbookAutoStart.autostarts(); KGlobal::dirs()->addResourceType("themes", "data", "kstyle/themes"); KAboutData *about = new KAboutData( I18N_NOOP("KCMDesktopTheme"), 0, i18n("KDE Desktop Theme Module"), 0, QString(), KAboutData::License_GPL, i18n("(c) 2002 Karol Szwed, Daniel Molkentin")); about->addAuthor(i18n("Karol Szwed"), QString(), QStringLiteral("*****@*****.**")); about->addAuthor(i18n("Daniel Molkentin"), QString(), QStringLiteral("*****@*****.**")); about->addAuthor(i18n("Ralf Nolden"), QString(), QStringLiteral("*****@*****.**")); setAboutData( about ); m_newThemeButton->setIcon(QIcon::fromTheme("get-hot-new-stuff")); m_themeModel = new ThemeModel(this); m_theme->setModel(m_themeModel); m_theme->setItemDelegate(new ThemeDelegate(m_theme)); m_theme->setVerticalScrollMode(QAbstractItemView::ScrollPerItem); connect(m_detailsWidget, SIGNAL(changed()), this, SLOT(detailChanged())); connect(m_theme->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(setDesktopThemeDirty())); connect(m_newThemeButton, SIGNAL(clicked()), this, SLOT(getNewThemes())); connect(m_fileInstallButton, &QPushButton::clicked, this, &KCMDesktopTheme::showFileDialog); }