void LivePathEffectEditor::setDesktop(SPDesktop *desktop) { Panel::setDesktop(desktop); if ( desktop == current_desktop ) { return; } if (current_desktop) { selection_changed_connection.disconnect(); selection_modified_connection.disconnect(); } lpe_list_locked = false; current_desktop = desktop; if (desktop) { Inkscape::Selection *selection = sp_desktop_selection(desktop); selection_changed_connection = selection->connectChanged( sigc::bind (sigc::ptr_fun(&lpeeditor_selection_changed), this ) ); selection_modified_connection = selection->connectModified( sigc::bind (sigc::ptr_fun(&lpeeditor_selection_modified), this ) ); onSelectionChanged(selection); } else { onSelectionChanged(NULL); } }
void PartySelectionGUI::callbackActive(Widget &widget) { const Common::UString &tag = widget.getTag(); if (tag == "BTN_BACK") _returnCode = 1; else if (tag == "BTN_DONE") _returnCode = 2; else if (tag.beginsWith("BTN_NPC")) { Common::UString tmp(tag); tmp.replaceAll("BTN_NPC", ""); int index; Common::parseString(tmp, index); _activeSlot = index; onSelectionChanged(); } else if (tag == "BTN_ACCEPT") { if ((_activeSlot != _config.forceNPC1) && (_activeSlot != _config.forceNPC2)) {; if (!_config.slotSelected[_activeSlot]) { if (_numSelectedSlots < 2) { _config.slotSelected[_activeSlot] = true; ++_numSelectedSlots; } } else { _config.slotSelected[_activeSlot] = false; --_numSelectedSlots; } } onSelectionChanged(); } }
void TabView::selectionChanged() { // we got selected.. if (isSelected()) { // or do we need to show blankness? if (isBlank() && blank_ && page_ && blank_->canShow()) { splitter->hide(); blank()->show(); stack->setCurrentIndex(1); } else if (blank_ && page_) { blank()->hide(); splitter->show(); emit onSelectionChanged(); // give view a change to prepare page()->selected(); // select the view stack->setCurrentIndex(0); } } else { emit onSelectionChanged(); // give view a change to clear } }
void ribi::cmap::QtConceptMap::onFocusItemChanged( QGraphicsItem * newFocus, QGraphicsItem */*oldFocus*/, Qt::FocusReason reason ) { //Focus on QtNode if (QtNode * const qtnode = dynamic_cast<QtNode*>(newFocus)) { if (!IsOnEdge(qtnode, this->scene())) { m_tools->SetBuddyItem(qtnode); onSelectionChanged(); m_arrow->hide(); } else { m_tools->SetBuddyItem(nullptr); onSelectionChanged(); } return; } //Focus on m_tools if (newFocus == m_tools && !m_arrow->isVisible() && m_tools->GetBuddyItem() && reason == Qt::MouseFocusReason) { m_arrow->Start(m_tools->GetBuddyItem()); //Also sets visibility m_tools->setSelected(false); m_tools->GetBuddyItem()->setSelected(true); //Will tigger onSelectionChanged and hide the arrow m_tools->GetBuddyItem()->setFocus(); m_arrow->setVisible(true); } }
Sidebar::Sidebar(QWidget * parent) : QFrame(parent), d(new SidebarPrivate(this)) { connect(d, SIGNAL(urlRequested(const QUrl &, const QString &)), this, SIGNAL(urlRequested(const QUrl &, const QString &))); // Construct sidebar d->slideLayout = new Utopia::SlideLayout(Utopia::SlideLayout::StackRight, this); d->documentWideView = new ResultsView; connect(d->documentWideView, SIGNAL(linkClicked(const QUrl &, const QString &)), d, SLOT(linkClicked(const QUrl &, const QString &))); connect(d->documentWideView, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged())); d->slideLayout->addWidget(d->documentWideView, "documentwide"); d->resultsView = new ResultsView; connect(d->resultsView, SIGNAL(linkClicked(const QUrl &, const QString &)), d, SLOT(linkClicked(const QUrl &, const QString &))); connect(d->resultsView, SIGNAL(runningChanged(bool)), d, SLOT(onResultsViewRunningChanged(bool))); connect(d->resultsView, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged())); d->resultsViewWidget = new QWidget; QVBoxLayout * resultsViewLayout = new QVBoxLayout(d->resultsViewWidget); resultsViewLayout->setContentsMargins(0, 0, 0, 0); resultsViewLayout->setSpacing(0); QFrame * headerFrame = new QFrame; QHBoxLayout * headerLayout = new QHBoxLayout(headerFrame); headerLayout->setContentsMargins(0, 0, 0, 0); QPushButton * backButton = new QPushButton("Back"); backButton->setFlat(true); backButton->setObjectName("back"); headerLayout->addWidget(backButton, 0, Qt::AlignLeft | Qt::AlignVCenter); d->searchTermLabel = new Utopia::ElidedLabel; d->searchTermLabel->setAlignment(Qt::AlignCenter); headerLayout->addWidget(d->searchTermLabel, 1); d->resultsViewSpinner = new Utopia::Spinner; headerLayout->addWidget(d->resultsViewSpinner, 0, Qt::AlignRight | Qt::AlignVCenter); connect(backButton, SIGNAL(clicked()), d->slideLayout, SLOT(pop())); resultsViewLayout->addWidget(headerFrame, 0); resultsViewLayout->addWidget(d->resultsView, 1); d->slideLayout->addWidget(d->resultsViewWidget, "results"); d->webView = new Utopia::WebView; connect(d->webView, SIGNAL(linkClicked(const QUrl &)), d, SLOT(linkClicked(const QUrl &))); connect(d->webView, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged())); QWidget * webViewWidget = new QWidget; QVBoxLayout * webViewLayout = new QVBoxLayout(webViewWidget); webViewLayout->setContentsMargins(0, 0, 0, 0); webViewLayout->setSpacing(0); headerFrame = new QFrame; headerLayout = new QHBoxLayout(headerFrame); headerLayout->setContentsMargins(0, 0, 0, 0); backButton = new QPushButton("Back"); backButton->setFlat(true); backButton->setObjectName("back"); headerLayout->addWidget(backButton, 0, Qt::AlignLeft | Qt::AlignVCenter); connect(backButton, SIGNAL(clicked()), d->slideLayout, SLOT(pop())); webViewLayout->addWidget(headerFrame, 0); webViewLayout->addWidget(d->webView, 1); d->slideLayout->addWidget(webViewWidget, "web"); d->slideLayout->push("documentwide", false); }
void FunctionToolbar::setSelection(FunctionSelection *selection) { if (m_selection != selection) { if (m_selection) disconnect(m_selection, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged())); m_selection = selection; if (m_selection) connect(m_selection, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged())); } }
/************************************************************************* Select tab implementation *************************************************************************/ void TabControl::selectTab_impl(Window* wnd) { bool modified = false; bool foundSelected = false; // Iterate in order of tab index TabButtonIndexMap::iterator i, iend; iend = d_tabButtonIndexMap.end(); for (i = d_tabButtonIndexMap.begin(); i != iend; ++i) { // get corresponding tab button and content window TabButton* tb = i->second; Window* child = tb->getTargetWindow(); // Should we be selecting? bool selectThis = (child == wnd); // Are we modifying this tab? modified = modified || (tb->isSelected() != selectThis); foundSelected = foundSelected || selectThis; // Select tab & set visible if this is the window, not otherwise tb->setSelected(selectThis); tb->setRightOfSelected(foundSelected); child->setVisible(selectThis); } // Trigger event? if (modified) { WindowEventArgs args(this); onSelectionChanged(args); } }
CommitTableWidget::CommitTableWidget(QWidget *parent) // ---------------------------------------------------------------------------- // Create a CommitTableWidget // ---------------------------------------------------------------------------- : QTableView(parent) { table = new CommitTableModel(this); proxyModel = new CommitSortFilterProxyModel(this); proxyModel->setSourceModel(table); setModel(proxyModel); setSortingEnabled(true); setSelectionBehavior(QAbstractItemView::SelectRows); horizontalHeader()->setStretchLastSection(true); verticalHeader()->hide(); setEditTriggers(QAbstractItemView::NoEditTriggers); setSelectionMode(QAbstractItemView::SingleSelection); sortByColumn(1, Qt::DescendingOrder); horizontalHeader()->setSortIndicator(1, Qt::DescendingOrder); connect(selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(onSelectionChanged())); }
ItemText::ItemText(const QString &text, bool isRichText, QWidget *parent) : QTextEdit(parent) , ItemWidget(this) , m_textDocument() , m_searchTextDocument() , m_textFormat(isRichText ? Qt::RichText : Qt::PlainText) { init(m_textDocument, font()); init(m_searchTextDocument, font()); setUndoRedoEnabled(false); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setFrameStyle(QFrame::NoFrame); // Selecting text copies it to clipboard. connect( this, SIGNAL(selectionChanged()), SLOT(onSelectionChanged()) ); setReadOnly(true); if (isRichText) m_textDocument.setHtml( text.left(defaultMaxBytes) ); else m_textDocument.setPlainText( text.left(defaultMaxBytes) ); setDocument(&m_textDocument); updateSize(); }
void PartySelectionGUI::loadConfiguration(const PartyConfiguration &config) { _config = config; _numSelectedSlots = 0; _activeSlot = -1; if (_config.forceNPC1 != -1) { _config.slotSelected[_config.forceNPC1] = true; ++_numSelectedSlots; } if (_config.forceNPC2 != -1) { _config.slotSelected[_config.forceNPC2] = true; ++_numSelectedSlots; } for (int i = 0; i < _slotCount; ++i) { if (_config.slotTemplate[i].empty()) toggleSlot(i, false); else { const Common::UString portrait(getPortrait(_config.slotTemplate[i])); setSlotTexture(i, portrait); toggleSlot(i, true); } Odyssey::WidgetCheckBox *checkBox = getCheckBox("BTN_NPC" + Common::composeString(i)); const bool selected = _config.slotSelected[i]; checkBox->setState(selected); checkBox->setHighlight(selected); } getButton("BTN_BACK")->setDisabled(!config.canCancel); onSelectionChanged(); }
void LivePathEffectEditor::onApply() { Inkscape::Selection *sel = _getSelection(); if ( sel && !sel->isEmpty() ) { SPItem *item = sel->singleItem(); if ( item && SP_IS_LPE_ITEM(item) ) { SPDocument *doc = current_desktop->doc(); const Util::EnumData<LivePathEffect::EffectType>* data = combo_effecttype.get_active_data(); if (!data) return; // If item is a SPRect, convert it to path first: if ( SP_IS_RECT(item) ) { sp_selected_path_to_curves(current_desktop, false); item = sel->singleItem(); // get new item } LivePathEffect::Effect::createAndApply(data->key.c_str(), doc, item); sp_document_done(doc, SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Create and apply path effect")); lpe_list_locked = false; onSelectionChanged(sel); } } }
/************************************************************************* Select range of items *************************************************************************/ void ItemListbox::selectRange(size_t a, size_t z) { // do nothing if the list is empty if (d_listItems.empty()) { return; } size_t max = d_listItems.size(); if (a >= max) { a = 0; } if (z >= max) { z = max-1; } if (a>z) { size_t tmp = a; a = z; z = tmp; } for (size_t i=a; i<=z; ++i) { d_listItems[i]->setSelected_impl(true,false); } d_lastSelected = d_listItems[z]; WindowEventArgs e(this); onSelectionChanged(e); }
void AnimationList::addNewFile() { //// For some unknown reason passing "this" locks up the OSX qavimator window. Possibly a QT4 bug, needs investigation #ifdef __APPLE__ QStringList files=QFileDialog::getOpenFileNames(NULL, "Choose an animation file", Settings::Instance()->lastPath(), ANIM_FILTER); #else QStringList files=QFileDialog::getOpenFileNames(this, "Choose an animation file", Settings::Instance()->lastPath(), ANIM_FILTER); #endif if(files.isEmpty()) return; else { QFileInfo fInfo(files.last()); Settings::Instance()->setLastPath(fInfo.absoluteDir().absolutePath()); } foreach(QString file, files) { if(file.isEmpty() || availableAnimations.contains(file)) continue; else { if(file.endsWith(".avm", Qt::CaseInsensitive) || file.endsWith(".bvh", Qt::CaseInsensitive)) availableAnimations.append(files); } } QStringListModel* model = dynamic_cast<QStringListModel*>(ui->availableAnimsListView->model()); model->setStringList(availableAnimations); //TODO: this is sooo lame. Find a dignified way onSelectionChanged(); }
/************************************************************************* Set the select state of an attached ListboxItem. *************************************************************************/ void Listbox::setItemSelectState(size_t item_index, bool state) { if (item_index < getItemCount()) { // only do this if the setting is changing if (d_listItems[item_index]->isSelected() != state) { // conditions apply for single-select mode if (state && !d_multiselect) { clearAllSelections_impl(); } d_listItems[item_index]->setSelected(state); WindowEventArgs args(this); onSelectionChanged(args); } } else { CEGUI_THROW(InvalidRequestException("Listbox::setItemSelectState - the value passed in the 'item_index' parameter is out of range for this Listbox.")); } }
ImagePaletDialog::ImagePaletDialog(QWidget *parent, AnimationModel* pAnimationModel) : QDialog(parent), m_ui(new Ui::ImagePaletDialog), mpAnimationModel(pAnimationModel) { m_ui->setupUi(this); mpAnimationImagePaletPanel = new AnimationImagePaletPanel(pAnimationModel); mpAnimationImagePaletPanel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); m_ui->scrollArea->setWidget(mpAnimationImagePaletPanel); mCurrentFileType = ResourceManager::FileType_Image; this->refreshTreeView(mCurrentFileType); connect(m_ui->fileSelectionTreeView->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), this, SLOT(onSelectionChanged(QItemSelection, QItemSelection))); connect(m_ui->spinBoxGridX, SIGNAL(valueChanged(int)), this, SLOT(snapGridChanged())); connect(m_ui->spinBoxGridY, SIGNAL(valueChanged(int)), this, SLOT(snapGridChanged())); connect(m_ui->snapGridCheckBox, SIGNAL(toggled(bool)), this, SLOT(snapGridChanged())); connect(m_ui->imageRadioButton, SIGNAL(toggled(bool)), this, SLOT(onSourceChanged())); connect(m_ui->animationRadioButton, SIGNAL(toggled(bool)), this, SLOT(onSourceChanged())); connect(mpAnimationModel, SIGNAL(selectedPaletChanged(QString)), this, SLOT(onAnimationImagePaletChanged(QString))); snapGridChanged(); }
void ComboBox::select(const std::string& value) { setString(value); _currentValue = std::find(_values.begin(), _values.end(), value) - _values.begin(); onSelectionChanged(value, _currentValue); }
/************************************************************************* Select tab implementation *************************************************************************/ void TabControl::selectTab_impl(Window* wnd) { makeTabVisible_impl(wnd); bool modified = false; // Iterate in order of tab index for (size_t i = 0; i < d_tabButtonVector.size(); ++i) { // get corresponding tab button and content window TabButton* tb = d_tabButtonVector [i]; Window* child = tb->getTargetWindow(); // Should we be selecting? bool selectThis = (child == wnd); // Are we modifying this tab? modified = modified || (tb->isSelected() != selectThis); // Select tab & set visible if this is the window, not otherwise tb->setSelected(selectThis); child->setVisible(selectThis); } // Trigger event? if (modified) { WindowEventArgs args(this); onSelectionChanged(args); } }
FileDialog::FileDialog(QWidget* parent, const QString& caption, const QString& directory, const QString& nameFilter, const QStringList& filter) { Q_UNUSED(nameFilter); Q_UNUSED(parent); m_Model = new QFileSystemModel(this); m_View = new FileListView(this); setWindowTitle(caption); setWindowFlags(Qt::Dialog); m_Model->setFilter(QDir::Files); m_Model->setNameFilters(filter); m_Model->setRootPath(directory); m_View->setIconSize(QSize(0, 0)); //todo check this hides the icons everywhere m_Model->setNameFilterDisables(false); m_View->setModel(m_Model); QVBoxLayout* layout = new QVBoxLayout; layout->addWidget(m_View); setLayout(layout); setWindowFlags(Qt::WindowSystemMenuHint | Qt::WindowTitleHint); m_View->setRootIndex(m_Model->index(directory)); m_View->setFocus(); m_View->setMinimumWidth(640); m_View->setMinimumHeight(480); connect(m_View, SIGNAL(selectedItemChanged(QModelIndex, QModelIndex)), this, SLOT(updateCurrent(QModelIndex, QModelIndex))); connect(m_View, SIGNAL(activated(QModelIndex)), this, SLOT(onFileSelected(QModelIndex))); connect(m_View, SIGNAL(clicked(QModelIndex)), this, SLOT(onSelectionChanged(QModelIndex))); }
AMDataViewWithActionButtons::AMDataViewWithActionButtons(AMDatabase* database, QWidget *parent) : QWidget(parent) { QVBoxLayout* vl = new QVBoxLayout; dataView_ = new AMDataView(database); QFrame* actionsBarFrame = new QFrame; ui_ = new Ui::AMDataViewActionsBar; ui_->setupUi(actionsBarFrame); vl->setContentsMargins(0,0,0,0); vl->setSpacing(0); vl->addWidget(dataView_); vl->addWidget(actionsBarFrame); setLayout(vl); connect(ui_->sizeSlider, SIGNAL(valueChanged(int)), dataView_, SLOT(setItemSize(int))); connect(ui_->expandAllButton, SIGNAL(clicked()), dataView_, SLOT(expandAll())); connect(ui_->collapseAllButton, SIGNAL(clicked()), dataView_, SLOT(collapseAll())); connect(ui_->openSameEditorButton, SIGNAL(clicked()), this, SLOT(onCompareScansAction())); connect(ui_->openSeparateEditorButton, SIGNAL(clicked()), this, SLOT(onEditScansAction())); connect(ui_->exportButton, SIGNAL(clicked()), this, SLOT(onExportScansAction())); connect(ui_->scanConfigurationButton, SIGNAL(clicked()), this, SLOT(onLaunchScanConfigurationsFromDb())); connect(dataView_, SIGNAL(viewDoubleClicked()), this, SLOT(onDoubleClick())); connect(dataView_, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged())); connect(dataView_, SIGNAL(editScansFromDb()), this, SLOT(onEditScansAction())); connect(dataView_, SIGNAL(compareScansFromDb()), this, SLOT(onCompareScansAction())); connect(dataView_, SIGNAL(exportScansFromDb()), this, SLOT(onExportScansAction())); connect(dataView_, SIGNAL(launchScanConfigurationsFromDb()), this, SLOT(onLaunchScanConfigurationsFromDb())); connect(dataView_, SIGNAL(fixCDF()), this, SLOT(onFixCDF())); }
/************************************************************************* Set whether the list should allow multiple selections or just a single selection *************************************************************************/ void Listbox::setMultiselectEnabled(bool setting) { // only react if the setting is changed if (d_multiselect != setting) { d_multiselect = setting; // if we change to single-select, deselect all except the first selected item. WindowEventArgs args(this); if ((!d_multiselect) && (getSelectedCount() > 1)) { ListboxItem* itm = getFirstSelectedItem(); while ((itm = getNextSelected(itm))) { itm->setSelected(false); } onSelectionChanged(args); } onMultiselectModeChanged(args); } }
//---------------------------------------------------------------------------------------- void OfsTreeWidget::refreshWidget() { disconnect(this, SIGNAL(itemSelectionChanged()), this, SLOT(onSelectionChanged())); if(mCapabilities & CAP_SHOW_FILES) { disconnect(this, SIGNAL(itemCollapsed( QTreeWidgetItem * )), this, SLOT(onItemCollapsed( QTreeWidgetItem * ))); disconnect(this, SIGNAL(itemExpanded( QTreeWidgetItem * )), this, SLOT(onItemExpanded( QTreeWidgetItem * ))); }
//---------------------------------------------------------------------------------------- OfsTreeWidget::OfsTreeWidget(QWidget *parent, unsigned int capabilities, std::string initialSelection) : QTreeWidget(parent), mCapabilities(capabilities) { mSelected = initialSelection; setColumnCount(1); setHeaderHidden(true); setSelectionMode(QAbstractItemView::SingleSelection); setSelectionBehavior(QAbstractItemView::SelectItems); setContextMenuPolicy(Qt::CustomContextMenu); setDragDropOverwriteMode(false); if(capabilities & CAP_ALLOW_DROPS) setDragDropMode(QAbstractItemView::DropOnly); mUnknownFileIcon = mOgitorMainWindow->mIconProvider.icon(QFileIconProvider::File); mFile = Ogitors::OgitorsRoot::getSingletonPtr()->GetProjectFile(); QTreeWidgetItem* item = 0; QTreeWidgetItem* pItem = new QTreeWidgetItem((QTreeWidget*)0, QStringList(QString("Project"))); pItem->setIcon(0, mOgitorMainWindow->mIconProvider.icon(QFileIconProvider::Folder)); pItem->setTextColor(0, Qt::black); QFont fnt = pItem->font(0); fnt.setBold(true); pItem->setFont(0, fnt); pItem->setWhatsThis(0, QString("/")); addTopLevelItem(pItem); fillTree(pItem, "/"); if(capabilities & CAP_SHOW_FILES) fillTreeFiles(pItem, "/"); expandItem(pItem); if(mSelected == "/") setItemSelected(pItem, true); else { NameTreeWidgetMap::iterator it = mItemMap.find(mSelected); if(it != mItemMap.end()) { clearSelection(); scrollToItem(it->second); setItemSelected(it->second, true); } } connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(onSelectionChanged())); if(capabilities & CAP_SHOW_FILES) { connect(this, SIGNAL(itemCollapsed( QTreeWidgetItem * )), this, SLOT(onItemCollapsed( QTreeWidgetItem * ))); connect(this, SIGNAL(itemExpanded( QTreeWidgetItem * )), this, SLOT(onItemExpanded( QTreeWidgetItem * ))); }
/************************************************************************* Clear the selected state for all items. *************************************************************************/ void Tree::clearAllSelections(void) { // only fire events and update if we actually made any changes if (clearAllSelections_impl()) { TreeEventArgs args(this); onSelectionChanged(args); } }
void SelectionController:: setupGui() { Ui::SaweMainWindow* main = _model->project()->mainWindow(); Ui::MainWindow* ui = main->getItems(); //connect(ui->actionActionAdd_selection, SIGNAL(triggered()), SLOT(receiveAddSelection())); connect(ui->actionActionRemove_selection, SIGNAL(triggered()), SLOT(receiveAddClearSelection())); connect(ui->actionCropSelection, SIGNAL(triggered()), SLOT(receiveCropSelection())); //connect(ui->actionMoveSelection, SIGNAL(toggled(bool)), SLOT(receiveMoveSelection(bool))); //connect(ui->actionMoveSelectionTime, SIGNAL(toggled(bool)), SLOT(receiveMoveSelectionInTime(bool))); ui->actionActionAdd_selection->setEnabled( false ); ui->actionActionRemove_selection->setEnabled( true ); ui->actionCropSelection->setEnabled( true ); ui->actionMoveSelection->setEnabled( false ); ui->actionMoveSelectionTime->setEnabled( false ); Support::ToolBar* toolBarTool = new Support::ToolBar(main); toolBarTool->setObjectName(QString::fromUtf8("toolBarSelectionController")); toolBarTool->setEnabled(true); toolBarTool->setContextMenuPolicy(Qt::NoContextMenu); toolBarTool->setToolButtonStyle(Qt::ToolButtonIconOnly); main->addToolBar(Qt::TopToolBarArea, toolBarTool); connect(ui->actionToggleSelectionToolBox, SIGNAL(toggled(bool)), toolBarTool, SLOT(setVisible(bool))); connect(toolBarTool, SIGNAL(visibleChanged(bool)), ui->actionToggleSelectionToolBox, SLOT(setChecked(bool))); selectionComboBox_ = new Ui::ComboBoxAction(); toolBarTool->addWidget( selectionComboBox_ ); toolBarTool->addAction( ui->actionActionRemove_selection ); toolBarTool->addAction( ui->actionCropSelection ); toolBarTool->setVisible( true ); connect(_model, SIGNAL(selectionChanged()), SLOT(onSelectionChanged())); //connect(_model->project()->head.get(), SIGNAL(headChanged()), SLOT(tryHeadAsSelection())); connect(selectionComboBox_, SIGNAL(toggled(bool)), SLOT(selectionComboBoxToggled())); connect(this, SIGNAL(enabledChanged(bool)), selectionComboBox_, SLOT(setChecked(bool))); deselect_action_ = new QAction(this); connect(deselect_action_, SIGNAL(triggered()), SLOT(deselect())); deselect_action_->setShortcut(Qt::Key_Escape); addAction(deselect_action_); setCurrentSelection(Signal::OperationDesc::ptr()); toolfactory(); renderview_tool_selector->default_tool = this; #ifdef TARGET_hast ui->actionActionRemove_selection->setVisible(false); ui->actionCropSelection->setVisible(false); #endif }
void SensorWidget::traceItemAdded(const QString& item) { SensorWidgetLine* line = new SensorWidgetLine(item); connect(line, SIGNAL(removeTraceItem(QString)), &mWriter, SLOT(remove(QString))); connect(line, SIGNAL(selectionChanged()), SLOT(onSelectionChanged())); connect(line, SIGNAL(sortWidgets(QString,QString,bool)), SLOT(sortWidgets(QString,QString,bool))); mElements[item] = line; ui->elementLayout->addWidget(line); storeSelection(); }
//------------------------------------------------------------------------------ void ctkFileDialogPrivate::init() { Q_Q(ctkFileDialog); this->observeAcceptButton(); QObject::connect(this->listView()->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), q, SLOT(onSelectionChanged())); }
//--------------------------------------------------------------------------- void Choice::select(size_t index) { assert(index < choiceList.size()); if(index == Choice::index) return; Choice::index = mouseover = index; onSelectionChanged(); }
void SourceViewer::setSourceText(const QString &key, const QString &name, const QString &searchText, const QByteArray &sourceTextBuffer) { QTextEdit *logTextEdit = NULL; QTextEditorContextMap::const_iterator i = logTextWidgetMap_.find(key); if(i == logTextWidgetMap_.end()) { // New tab created.. logTextEdit = new QTextEdit(); QObject::connect(logTextEdit, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged())); logTextEdit->setReadOnly(true); SourceViewContext* ctx = new SourceViewContext(); ctx->logTextEdit = logTextEdit; logTextWidgetMap_.insert(key, ctx); ui.tabWidget->insertTab(0, logTextEdit, name); ui.tabWidget->setCurrentIndex(0); } else { // Already the tab exists. logTextEdit = i.value()->logTextEdit; int index = ui.tabWidget->indexOf(logTextEdit); if(index >= 0) { ui.tabWidget->setCurrentIndex(index); } } workingHighlightText_ = true; ui.searchText->setText(searchText); logTextEdit->setText(sourceTextBuffer); logTextEdit->setFocus(); if(searchText.isEmpty() == false) { doHighlightText(searchText, ui.caseSensitiveCheck->isChecked()); QTextDocument::FindFlags flags = 0x0; if(ui.caseSensitiveCheck->isChecked()) flags |= QTextDocument::FindCaseSensitively; logTextEdit->moveCursor(QTextCursor::Start); while(logTextEdit->find(searchText, flags)) { break; } } workingHighlightText_ = false; }
void SensorWidget::traceItemRemoved(const QString &name) { if(mElements.contains(name)) { SensorWidgetLine* line = mElements.take(name); ui->elementLayout->removeWidget(line); delete line; onSelectionChanged(); storeSelection(); } }
AnimationList::AnimationList(QWidget *parent) : QWidget(parent), ui(new Ui::AnimationList) { ui->setupUi(this); QStringListModel* model = new QStringListModel(this); model->setStringList(availableAnimations); ui->availableAnimsListView->setModel(model); connect(ui->availableAnimsListView->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), this, SLOT(onSelectionChanged())); }