ConstraintStudentsSetNotAvailableTimesForm::ConstraintStudentsSetNotAvailableTimesForm(QWidget* parent): QDialog(parent) { setupUi(this); currentConstraintTextEdit->setReadOnly(true); modifyConstraintPushButton->setDefault(true); constraintsListWidget->setSelectionMode(QAbstractItemView::SingleSelection); connect(constraintsListWidget, SIGNAL(currentRowChanged(int)), this, SLOT(constraintChanged(int))); connect(addConstraintPushButton, SIGNAL(clicked()), this, SLOT(addConstraint())); connect(closePushButton, SIGNAL(clicked()), this, SLOT(close())); connect(removeConstraintPushButton, SIGNAL(clicked()), this, SLOT(removeConstraint())); connect(modifyConstraintPushButton, SIGNAL(clicked()), this, SLOT(modifyConstraint())); connect(studentsComboBox, SIGNAL(activated(QString)), this, SLOT(filterChanged())); connect(constraintsListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(modifyConstraint())); centerWidgetOnScreen(this); restoreFETDialogGeometry(this); QSize tmp2=studentsComboBox->minimumSizeHint(); Q_UNUSED(tmp2); studentsComboBox->addItem(""); for(int i=0; i<gt.rules.yearsList.size(); i++){ StudentsYear* sty=gt.rules.yearsList[i]; studentsComboBox->addItem(sty->name); for(int j=0; j<sty->groupsList.size(); j++){ StudentsGroup* stg=sty->groupsList[j]; studentsComboBox->addItem(stg->name); if(SHOW_SUBGROUPS_IN_COMBO_BOXES) for(int k=0; k<stg->subgroupsList.size(); k++){ StudentsSubgroup* sts=stg->subgroupsList[k]; studentsComboBox->addItem(sts->name); } } } this->filterChanged(); }
/////////////////////////////////////////// // Monitor the next client seen void EQPacket::monitorNextClient() { m_detectingClient = true; showeq_params->ip = AUTOMATIC_CLIENT_IP; struct in_addr ia; inet_aton (showeq_params->ip, &ia); m_client_addr = ia.s_addr; emit clientChanged(m_client_addr); resetEQPacket(); printf("Listening for next client seen. (you must zone for this to work!)\n"); if (!showeq_params->playbackpackets) { m_packetCapture->setFilter(showeq_params->device, NULL, showeq_params->realtime, DEFAULT_ADDRESS_TYPE, 0, 0); emit filterChanged(); } }
void LTMWindow::compareChanged() { if (!amVisible()) { compareDirty = true; return; } if (isCompare()) { // refresh plot handles the compare case refreshPlot(); } else { // forced refresh back to normal stackDirty = dirty = true; filterChanged(); // forces reread etc } repaint(); }
void SpacesSubtabGridView::surfaceTypeFilterChanged(const QString& text) { m_objectsFilteredBySurfaceType.clear(); if (text == ALL) { // nothing to filter } else { for (auto obj : this->m_gridController->getObjectSelector()->m_selectorObjects) { auto surface = obj.optionalCast<model::Surface>(); if (surface) { QString surfaceType(surface->surfaceType().c_str()); if (surfaceType != text) { m_objectsFilteredBySurfaceType.insert(obj); } } } } filterChanged(); }
void AbstractStringFilter::createWidget() { lineEditText = new QString; lineEdit = new QLineEdit; lineEdit->setMinimumWidth(250); connect(lineEdit, SIGNAL(textChanged(QString)), this, SLOT(updateLineEditText(QString))); connect(lineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(filterChanged())); QHBoxLayout * layout = new QHBoxLayout; QMargins margins = layout->contentsMargins(); margins.setTop(0); margins.setBottom(0); layout->setContentsMargins(margins); layout->addWidget(lineEdit); layout->addStretch(); getMainLayout()->addLayout(layout); }
QgsMilXLibrary::QgsMilXLibrary( QgisInterface *iface, QWidget *parent ) : QWidget( parent ), mIface( iface ), mLoader( 0 ) { setWindowFlags( Qt::Popup ); setObjectName( "QgsMilXLibrary" ); setStyleSheet( "QWidget#QgsMilXLibrary { background-color: white;}" ); QVBoxLayout* layout = new QVBoxLayout( this ); layout->setMargin( 2 ); layout->setSpacing( 2 ); setLayout( layout ); mFilterLineEdit = new QgsFilterLineEdit( this ); mFilterLineEdit->setPlaceholderText( tr( "Filter..." ) ); layout->addWidget( mFilterLineEdit ); connect( mFilterLineEdit, SIGNAL( textChanged( QString ) ), this, SLOT( filterChanged( QString ) ) ); mTreeView = new QTreeView( this ); mTreeView->setFrameShape( QTreeView::NoFrame ); mTreeView->setEditTriggers( QTreeView::NoEditTriggers ); mTreeView->setHeaderHidden( true ); mTreeView->setIconSize( QSize( 32, 32 ) ); layout->addWidget( mTreeView ); connect( mTreeView, SIGNAL( clicked( QModelIndex ) ), this, SLOT( itemClicked( QModelIndex ) ) ); mGalleryModel = new QStandardItemModel( this ); mFilterProxyModel = new TreeFilterProxyModel( this ); mFilterProxyModel->setSourceModel( mGalleryModel ); mLoadingModel = new QStandardItemModel( this ); QStandardItem* loadingItem = new QStandardItem( tr( "Loading..." ) ); loadingItem->setEnabled( false ); mLoadingModel->appendRow( loadingItem ); setCursor( Qt::WaitCursor ); mTreeView->setModel( mLoadingModel ); mLoader = new QgsMilXLibraryLoader( this ); connect( mLoader, SIGNAL( finished() ), this, SLOT( loaderFinished() ) ); mLoader->start(); }
/////////////////////////////////////////// // Set the MAC address of the client to monitor void EQPacket::monitorMACClient(const QString& mac) { showeq_params->mac_address = mac; m_detectingClient = true; struct in_addr ia; inet_aton (AUTOMATIC_CLIENT_IP, &ia); m_client_addr = ia.s_addr; emit clientChanged(m_client_addr); resetEQPacket(); printf("Listening for MAC client: %s\n", (const char*)showeq_params->mac_address); if (!showeq_params->playbackpackets) { m_packetCapture->setFilter(showeq_params->device, showeq_params->ip, showeq_params->realtime, IP_ADDRESS_TYPE, 0, 0); emit filterChanged(); } }
void ImageEffectConfigWidget::selectImage() { if (!m_effect) return; KoFileDialog dialog(0, KoFileDialog::OpenFile, "OpenDocument"); dialog.setCaption(i18n("Select image")); dialog.setImageFilters(); QString fname = dialog.filename(); if (fname.isEmpty()) return; QImage newImage; if (!newImage.load(fname)) return; m_effect->setImage(newImage); editFilterEffect(m_effect); emit filterChanged(); }
/////////////////////////////////////////// // Set the MAC address of the client to monitor void EQPacket::monitorMACClient(const QString& mac) { m_mac = mac; m_detectingClient = true; struct in_addr ia; inet_aton (AUTOMATIC_CLIENT_IP, &ia); m_client_addr = ia.s_addr; emit clientChanged(m_client_addr); resetEQPacket(); seqInfo("Listening for MAC client: %s", (const char*)m_mac); if (!m_playbackPackets) { m_packetCapture->setFilter(m_device, m_ip, m_realtime, IP_ADDRESS_TYPE, 0, 0); emit filterChanged(); } }
AttachExternalDialog::AttachExternalDialog(QWidget *parent) : QDialog(parent), m_selfPid(QString::number(QCoreApplication::applicationPid())), m_ui(new Ui::AttachExternalDialog), m_model(new ProcessListFilterModel(this)) { m_ui->setupUi(this); okButton()->setDefault(true); okButton()->setEnabled(false); m_ui->procView->setModel(m_model); m_ui->procView->setSortingEnabled(true); m_ui->procView->sortByColumn(1, Qt::AscendingOrder); connect(m_ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(m_ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject())); QPushButton *refreshButton = new QPushButton(tr("Refresh")); connect(refreshButton, SIGNAL(clicked()), this, SLOT(rebuildProcessList())); m_ui->buttonBox->addButton(refreshButton, QDialogButtonBox::ActionRole); m_ui->filterWidget->setFocus(Qt::TabFocusReason); m_ui->procView->setAlternatingRowColors(true); m_ui->procView->setRootIsDecorated(false); m_ui->procView->setUniformRowHeights(true); // Do not use activated, will be single click in Oxygen connect(m_ui->procView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(procSelected(QModelIndex))); connect(m_ui->procView, SIGNAL(clicked(QModelIndex)), this, SLOT(procClicked(QModelIndex))); connect(m_ui->pidLineEdit, SIGNAL(textChanged(QString)), this, SLOT(pidChanged(QString))); connect(m_ui->filterWidget, SIGNAL(filterChanged(QString)), this, SLOT(setFilterString(QString))); setMinimumHeight(500); rebuildProcessList(); }
FilterBar::FilterBar(QWidget* parent) : QWidget(parent) { // Create close button QToolButton *closeButton = new QToolButton(this); closeButton->setAutoRaise(true); closeButton->setIcon(KIcon("dialog-close")); closeButton->setToolTip(i18nc("@info:tooltip", "Hide Filter Bar")); connect(closeButton, SIGNAL(clicked()), this, SIGNAL(closeRequest())); // Create button to lock text when changing folders m_lockButton = new QToolButton(this); m_lockButton->setAutoRaise(true); m_lockButton->setCheckable(true); m_lockButton->setIcon(KIcon("object-unlocked")); m_lockButton->setToolTip(i18nc("@info:tooltip", "Keep Filter When Changing Folders")); connect(m_lockButton, SIGNAL(toggled(bool)), this, SLOT(slotToggleLockButton(bool))); // Create label QLabel* filterLabel = new QLabel(i18nc("@label:textbox", "Filter:"), this); // Create filter editor m_filterInput = new KLineEdit(this); m_filterInput->setLayoutDirection(Qt::LeftToRight); m_filterInput->setClearButtonShown(true); connect(m_filterInput, SIGNAL(textChanged(QString)), this, SIGNAL(filterChanged(QString))); setFocusProxy(m_filterInput); // Apply layout QHBoxLayout* hLayout = new QHBoxLayout(this); hLayout->setMargin(0); hLayout->addWidget(closeButton); hLayout->addWidget(filterLabel); hLayout->addWidget(m_filterInput); hLayout->addWidget(m_lockButton); filterLabel->setBuddy(m_filterInput); }
void FilterEdit::saveChanges() { if(current == 0L) return; current->setName(mNameLineEdit->text()); int criteria = 0; if(mCompletedCheck->isChecked()) criteria |= CalFilter::HideCompleted; if(mRecurringCheck->isChecked()) criteria |= CalFilter::HideRecurring; if(mCatShowCheck->isChecked()) criteria |= CalFilter::ShowCategories; if(mHideInactiveTodosCheck->isChecked()) criteria |= CalFilter::HideInactiveTodos; if(mHideTodosNotAssignedToMeCheck->isChecked()) criteria |= CalFilter::HideTodosWithoutAttendeeInEmailList; current->setCriteria(criteria); current->setCompletedTimeSpan(mCompletedTimeSpan->value()); QStringList categoryList; for(uint i = 0; i < mCatList->count(); ++i) categoryList.append(mCatList->text(i)); current->setCategoryList(categoryList); emit filterChanged(); }
TopicChooser::TopicChooser(QWidget *parent, const QString &keyword, const QMap<QString, QUrl> &links) : QDialog(parent) , m_filterModel(new QSortFilterProxyModel(this)) { ui.setupUi(this); setFocusProxy(ui.lineEdit); ui.lineEdit->setFiltering(true); ui.lineEdit->installEventFilter(this); ui.lineEdit->setPlaceholderText(tr("Filter")); ui.label->setText(tr("Choose a topic for <b>%1</b>:").arg(keyword)); QStandardItemModel *model = new QStandardItemModel(this); m_filterModel->setSourceModel(model); m_filterModel->setFilterCaseSensitivity(Qt::CaseInsensitive); QMap<QString, QUrl>::const_iterator it = links.constBegin(); for (; it != links.constEnd(); ++it) { m_links.append(it.value()); QStandardItem *item = new QStandardItem(it.key()); item->setToolTip(it.value().toString()); model->appendRow(item); } ui.listWidget->setModel(m_filterModel); ui.listWidget->setUniformItemSizes(true); ui.listWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); if (m_filterModel->rowCount() != 0) ui.listWidget->setCurrentIndex(m_filterModel->index(0, 0)); connect(ui.buttonDisplay, SIGNAL(clicked()), this, SLOT(acceptDialog())); connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(ui.listWidget, SIGNAL(activated(QModelIndex)), this, SLOT(activated(QModelIndex))); connect(ui.lineEdit, SIGNAL(filterChanged(QString)), this, SLOT(setFilter(QString))); }
/////////////////////////////////////////// // Monitor the next client seen void EQPacket::monitorNextClient() { m_detectingClient = true; m_ip = AUTOMATIC_CLIENT_IP; struct in_addr ia; inet_aton (m_ip, &ia); m_client_addr = ia.s_addr; emit clientChanged(m_client_addr); resetEQPacket(); seqInfo("Listening for next client seen. (you must zone for this to work!)"); if (m_playbackPackets == PLAYBACK_OFF || m_playbackPackets == PLAYBACK_FORMAT_TCPDUMP) { m_packetCapture->setFilter(m_device, NULL, m_realtime, DEFAULT_ADDRESS_TYPE, 0, 0); emit filterChanged(); } }
WidgetBox::WidgetBox(QDesignerFormEditorInterface *core, QWidget *parent, Qt::WindowFlags flags) : QDesignerWidgetBox(parent, flags), m_core(core), m_view(new WidgetBoxTreeWidget(m_core)) { QVBoxLayout *l = new QVBoxLayout(this); l->setMargin(0); l->setSpacing(0); // Prevent the filter from grabbing focus since Our view has Qt::NoFocus FilterWidget *filterWidget = new FilterWidget(0, FilterWidget::LayoutAlignNone); filterWidget->setRefuseFocus(true); connect(filterWidget, SIGNAL(filterChanged(QString)), m_view, SLOT(filter(QString))); l->addWidget(filterWidget); // View connect(m_view, SIGNAL(pressed(QString,QString,QPoint)), this, SLOT(handleMousePress(QString,QString,QPoint))); l->addWidget(m_view); setAcceptDrops (true); }
TabManagerWidget::TabManagerWidget(BrowserWindow* mainClass, QWidget* parent, bool defaultWidget) : QWidget(parent) , ui(new Ui::TabManagerWidget) , p_QupZilla(mainClass) , m_webPage(0) , m_isRefreshing(false) , m_refreshBlocked(false) , m_waitForRefresh(false) , m_isDefaultWidget(defaultWidget) { if(s_tldExtractor == 0) { s_tldExtractor = TLDExtractor::instance(); s_tldExtractor->setDataSearchPaths(QStringList() << TabManagerPlugin::settingsPath()); } ui->setupUi(this); ui->treeWidget->setExpandsOnDoubleClick(false); ui->treeWidget->setContextMenuPolicy(Qt::CustomContextMenu); ui->treeWidget->installEventFilter(this); ui->filterBar->installEventFilter(this); QPushButton* closeButton = new QPushButton(ui->filterBar); closeButton->setFlat(true); closeButton->setIcon(style()->standardIcon(QStyle::SP_TitleBarCloseButton)); ui->filterBar->addWidget(closeButton, LineEdit::RightSide); ui->filterBar->hide(); ui->treeWidget->setItemDelegate(new TabFilterDelegate(ui->treeWidget)); connect(closeButton, SIGNAL(clicked(bool)), this, SLOT(filterBarClosed())); connect(ui->filterBar, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString))); connect(ui->treeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(itemDoubleClick(QTreeWidgetItem*,int))); connect(ui->treeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint))); }
// ------------------- FilterWidget FilterWidget::FilterWidget(QWidget *parent, LayoutMode lm) : QWidget(parent), m_button(new QPushButton), m_editor(new HintLineEdit) { m_editor->setHintText(tr("<Filter>")); QHBoxLayout *l = new QHBoxLayout(this); l->setMargin(0); l->setSpacing(0); if (lm == LayoutAlignRight) l->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum)); l->addWidget(m_editor); m_button->setIcon(createIconSet(QLatin1String("resetproperty.png"))); m_button->setIconSize(QSize(8, 8)); m_button->setFlat(true); l->addWidget(m_button); connect(m_button, SIGNAL(clicked()), this, SLOT(reset())); connect(m_editor, SIGNAL(textChanged(QString)), this, SLOT(checkButton(QString))); connect(m_editor, SIGNAL(textEdited(QString)), this, SIGNAL(filterChanged(QString))); }
void HistoryMessagesTab::createModelChain() { ChatsModel = new ChatListModel(TalkableTree); BuddiesModel = new BuddyListModel(TalkableTree); QList<KaduAbstractModel *> models; models.append(ChatsModel); models.append(BuddiesModel); Chain = new ModelChain(TalkableTree); Chain->setBaseModel(MergedProxyModelFactory::createKaduModelInstance(models, Chain)); TalkableProxyModel *proxyModel = new TalkableProxyModel(Chain); proxyModel->setSortByStatusAndUnreadMessages(false); proxyModel->addFilter(new HideTemporaryTalkableFilter(proxyModel)); NameTalkableFilter *nameTalkableFilter = new NameTalkableFilter(NameTalkableFilter::AcceptMatching, proxyModel); connect(FilteredView, SIGNAL(filterChanged(QString)), nameTalkableFilter, SLOT(setName(QString))); proxyModel->addFilter(nameTalkableFilter); Chain->addProxyModel(proxyModel); TalkableTree->setChain(Chain); }
QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWidget *parent, Qt::WindowFlags flags ) : QDialog( parent, flags ) , mDock( nullptr ) , mLayer( theLayer ) , mRubberBand( nullptr ) , mCurrentSearchWidgetWrapper( nullptr ) { setupUi( this ); // Fix selection color on loosing focus (Windows) setStyleSheet( QgisApp::instance()->styleSheet() ); setAttribute( Qt::WA_DeleteOnClose ); QSettings settings; // Initialize the window geometry restoreGeometry( settings.value( "/Windows/BetterAttributeTable/geometry" ).toByteArray() ); QgsAttributeEditorContext context; myDa = new QgsDistanceArea(); myDa->setSourceCrs( mLayer->crs() ); myDa->setEllipsoidalMode( QgisApp::instance()->mapCanvas()->mapSettings().hasCrsTransformEnabled() ); myDa->setEllipsoid( QgsProject::instance()->readEntry( "Measure", "/Ellipsoid", GEO_NONE ) ); context.setDistanceArea( *myDa ); context.setVectorLayerTools( QgisApp::instance()->vectorLayerTools() ); QgsFeatureRequest r; if ( mLayer->geometryType() != QGis::NoGeometry && settings.value( "/qgis/attributeTableBehaviour", QgsAttributeTableFilterModel::ShowAll ).toInt() == QgsAttributeTableFilterModel::ShowVisible ) { QgsMapCanvas *mc = QgisApp::instance()->mapCanvas(); QgsRectangle extent( mc->mapSettings().mapToLayerCoordinates( theLayer, mc->extent() ) ); r.setFilterRect( extent ); QgsGeometry *g = QgsGeometry::fromRect( extent ); mRubberBand = new QgsRubberBand( mc, QGis::Polygon ); mRubberBand->setToGeometry( g, theLayer ); delete g; mActionShowAllFilter->setText( tr( "Show All Features In Initial Canvas Extent" ) ); } // Initialize dual view mMainView->init( mLayer, QgisApp::instance()->mapCanvas(), r, context ); // Initialize filter gui elements mFilterActionMapper = new QSignalMapper( this ); mFilterColumnsMenu = new QMenu( this ); mActionFilterColumnsMenu->setMenu( mFilterColumnsMenu ); mApplyFilterButton->setDefaultAction( mActionApplyFilter ); // Set filter icon in a couple of places QIcon filterIcon = QgsApplication::getThemeIcon( "/mActionFilter.svg" ); mActionShowAllFilter->setIcon( filterIcon ); mActionAdvancedFilter->setIcon( filterIcon ); mActionSelectedFilter->setIcon( filterIcon ); mActionVisibleFilter->setIcon( filterIcon ); mActionEditedFilter->setIcon( filterIcon ); // Connect filter signals connect( mActionAdvancedFilter, SIGNAL( triggered() ), SLOT( filterExpressionBuilder() ) ); connect( mActionShowAllFilter, SIGNAL( triggered() ), SLOT( filterShowAll() ) ); connect( mActionSelectedFilter, SIGNAL( triggered() ), SLOT( filterSelected() ) ); connect( mActionVisibleFilter, SIGNAL( triggered() ), SLOT( filterVisible() ) ); connect( mActionEditedFilter, SIGNAL( triggered() ), SLOT( filterEdited() ) ); connect( mFilterActionMapper, SIGNAL( mapped( QObject* ) ), SLOT( filterColumnChanged( QObject* ) ) ); connect( mFilterQuery, SIGNAL( returnPressed() ), SLOT( filterQueryAccepted() ) ); connect( mActionApplyFilter, SIGNAL( triggered() ), SLOT( filterQueryAccepted() ) ); connect( mSetStyles, SIGNAL( pressed() ), SLOT( openConditionalStyles() ) ); // info from layer to table connect( mLayer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) ); connect( mLayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) ); connect( mLayer, SIGNAL( layerDeleted() ), this, SLOT( close() ) ); connect( mLayer, SIGNAL( selectionChanged() ), this, SLOT( updateTitle() ) ); connect( mLayer, SIGNAL( featureAdded( QgsFeatureId ) ), this, SLOT( updateTitle() ) ); connect( mLayer, SIGNAL( featuresDeleted( QgsFeatureIds ) ), this, SLOT( updateTitle() ) ); connect( mLayer, SIGNAL( attributeAdded( int ) ), this, SLOT( columnBoxInit() ) ); connect( mLayer, SIGNAL( attributeDeleted( int ) ), this, SLOT( columnBoxInit() ) ); // connect table info to window connect( mMainView, SIGNAL( filterChanged() ), this, SLOT( updateTitle() ) ); // info from table to application connect( this, SIGNAL( saveEdits( QgsMapLayer * ) ), QgisApp::instance(), SLOT( saveEdits( QgsMapLayer * ) ) ); bool myDockFlag = settings.value( "/qgis/dockAttributeTable", false ).toBool(); if ( myDockFlag ) { mDock = new QgsAttributeTableDock( tr( "Attribute table - %1 (%n Feature(s))", "feature count", mMainView->featureCount() ).arg( mLayer->name() ), QgisApp::instance() ); mDock->setAllowedAreas( Qt::BottomDockWidgetArea | Qt::TopDockWidgetArea ); mDock->setWidget( this ); connect( this, SIGNAL( destroyed() ), mDock, SLOT( close() ) ); QgisApp::instance()->addDockWidget( Qt::BottomDockWidgetArea, mDock ); } columnBoxInit(); updateTitle(); mRemoveSelectionButton->setIcon( QgsApplication::getThemeIcon( "/mActionUnselectAttributes.png" ) ); mSelectedToTopButton->setIcon( QgsApplication::getThemeIcon( "/mActionSelectedToTop.png" ) ); mCopySelectedRowsButton->setIcon( QgsApplication::getThemeIcon( "/mActionCopySelected.png" ) ); mZoomMapToSelectedRowsButton->setIcon( QgsApplication::getThemeIcon( "/mActionZoomToSelected.svg" ) ); mPanMapToSelectedRowsButton->setIcon( QgsApplication::getThemeIcon( "/mActionPanToSelected.svg" ) ); mInvertSelectionButton->setIcon( QgsApplication::getThemeIcon( "/mActionInvertSelection.png" ) ); mToggleEditingButton->setIcon( QgsApplication::getThemeIcon( "/mActionToggleEditing.svg" ) ); mSaveEditsButton->setIcon( QgsApplication::getThemeIcon( "/mActionSaveEdits.svg" ) ); mDeleteSelectedButton->setIcon( QgsApplication::getThemeIcon( "/mActionDeleteSelected.svg" ) ); mOpenFieldCalculator->setIcon( QgsApplication::getThemeIcon( "/mActionCalculateField.png" ) ); mAddAttribute->setIcon( QgsApplication::getThemeIcon( "/mActionNewAttribute.png" ) ); mRemoveAttribute->setIcon( QgsApplication::getThemeIcon( "/mActionDeleteAttribute.png" ) ); mTableViewButton->setIcon( QgsApplication::getThemeIcon( "/mActionOpenTable.png" ) ); mAttributeViewButton->setIcon( QgsApplication::getThemeIcon( "/mActionPropertyItem.png" ) ); mExpressionSelectButton->setIcon( QgsApplication::getThemeIcon( "/mIconExpressionSelect.svg" ) ); mAddFeature->setIcon( QgsApplication::getThemeIcon( "/mActionNewTableRow.png" ) ); // toggle editing bool canChangeAttributes = mLayer->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeAttributeValues; bool canDeleteFeatures = mLayer->dataProvider()->capabilities() & QgsVectorDataProvider::DeleteFeatures; bool canAddAttributes = mLayer->dataProvider()->capabilities() & QgsVectorDataProvider::AddAttributes; bool canDeleteAttributes = mLayer->dataProvider()->capabilities() & QgsVectorDataProvider::DeleteAttributes; bool canAddFeatures = mLayer->dataProvider()->capabilities() & QgsVectorDataProvider::AddFeatures; mToggleEditingButton->blockSignals( true ); mToggleEditingButton->setCheckable( true ); mToggleEditingButton->setChecked( mLayer->isEditable() ); mToggleEditingButton->setEnabled(( canChangeAttributes || canDeleteFeatures || canAddAttributes || canDeleteAttributes || canAddFeatures ) && !mLayer->isReadOnly() ); mToggleEditingButton->blockSignals( false ); mSaveEditsButton->setEnabled( mToggleEditingButton->isEnabled() && mLayer->isEditable() ); mReloadButton->setEnabled( ! mLayer->isEditable() ); mAddAttribute->setEnabled(( canChangeAttributes || canAddAttributes ) && mLayer->isEditable() ); mDeleteSelectedButton->setEnabled( canDeleteFeatures && mLayer->isEditable() ); mAddFeature->setEnabled( canAddFeatures && mLayer->isEditable() ); mAddFeature->setHidden( !canAddFeatures ); mMainViewButtonGroup->setId( mTableViewButton, QgsDualView::AttributeTable ); mMainViewButtonGroup->setId( mAttributeViewButton, QgsDualView::AttributeEditor ); // Load default attribute table filter QgsAttributeTableFilterModel::FilterMode defaultFilterMode = ( QgsAttributeTableFilterModel::FilterMode ) settings.value( "/qgis/attributeTableBehaviour", QgsAttributeTableFilterModel::ShowAll ).toInt(); switch ( defaultFilterMode ) { case QgsAttributeTableFilterModel::ShowVisible: filterVisible(); break; case QgsAttributeTableFilterModel::ShowSelected: filterSelected(); break; case QgsAttributeTableFilterModel::ShowAll: default: filterShowAll(); break; } mUpdateExpressionText->registerGetExpressionContextCallback( &_getExpressionContext, mLayer ); mFieldModel = new QgsFieldModel( this ); mFieldModel->setLayer( mLayer ); mFieldCombo->setModel( mFieldModel ); connect( mRunFieldCalc, SIGNAL( clicked() ), this, SLOT( updateFieldFromExpression() ) ); connect( mRunFieldCalcSelected, SIGNAL( clicked() ), this, SLOT( updateFieldFromExpressionSelected() ) ); // NW TODO Fix in 2.6 - Doesn't work with field model for some reason. // connect( mUpdateExpressionText, SIGNAL( returnPressed() ), this, SLOT( updateFieldFromExpression() ) ); connect( mUpdateExpressionText, SIGNAL( fieldChanged( QString, bool ) ), this, SLOT( updateButtonStatus( QString, bool ) ) ); mUpdateExpressionText->setLayer( mLayer ); mUpdateExpressionText->setLeftHandButtonStyle( true ); mMainView->setView( QgsDualView::AttributeTable ); editingToggled(); }
GcScopeBar::GcScopeBar(Context *context) : QWidget(context->mainWindow), context(context) { setFixedHeight(23); setContentsMargins(10,0,10,0); layout = new QHBoxLayout(this); layout->setSpacing(2); layout->setContentsMargins(0,0,0,0); searchLabel = new GcLabel(tr("Search/Filter:")); searchLabel->setYOff(1); searchLabel->setFixedHeight(20); searchLabel->setHighlighted(true); QFont font; font.setPointSize(10); font.setWeight(QFont::Black); searchLabel->setFont(font); layout->addWidget(searchLabel); searchLabel->hide(); #ifdef GC_HAVE_LUCENE connect(context, SIGNAL(filterChanged()), this, SLOT(setHighlighted())); #endif connect(context, SIGNAL(compareIntervalsStateChanged(bool)), this, SLOT(setCompare())); connect(context, SIGNAL(compareDateRangesStateChanged(bool)), this, SLOT(setCompare())); // Mac uses QtMacButton - recessed etc #ifdef Q_OS_MAC home = new QtMacButton(this, QtMacButton::Recessed); #ifdef GC_HAVE_ICAL diary = new QtMacButton(this, QtMacButton::Recessed); #endif anal = new QtMacButton(this, QtMacButton::Recessed); #ifdef GC_HAVE_INTERVALS interval = new QtMacButton(this, QtMacButton::Recessed); #endif train = new QtMacButton(this, QtMacButton::Recessed); #else // Windows / Linux uses GcScopeButton - pushbutton home = new GcScopeButton(this); #ifdef GC_HAVE_ICAL diary = new GcScopeButton(this); #endif anal = new GcScopeButton(this); #ifdef GC_HAVE_INTERVALS interval = new GcScopeButton(this); #endif train = new GcScopeButton(this); #endif // now set the text for each one home->setText(tr("Trends")); layout->addWidget(home); connect(home, SIGNAL(clicked(bool)), this, SLOT(clickedHome())); #ifdef GC_HAVE_ICAL diary->setText(tr("Diary")); layout->addWidget(diary); connect(diary, SIGNAL(clicked(bool)), this, SLOT(clickedDiary())); #endif anal->setText(tr("Rides")); anal->setWidth(70); anal->setChecked(true); layout->addWidget(anal); connect(anal, SIGNAL(clicked(bool)), this, SLOT(clickedAnal())); #ifdef GC_HAVE_INTERVALS interval->setText(tr("Intervals")); interval->setWidth(70); layout->addWidget(interval); connect(interval, SIGNAL(clicked(bool)), this, SLOT(clickedInterval())); #endif train->setText(tr("Train")); layout->addWidget(train); connect(train, SIGNAL(clicked(bool)), this, SLOT(clickedTrain())); //layout->addWidget(traintool); //XXX!!! eek // we now need to adjust the buttons according to their text size // this is particularly bad for German's who, as a nation, must // suffer from RSI from typing and writing more than any other nation ;) QFontMetrics fontMetric(font); int width = fontMetric.width(tr("Trends")); home->setWidth(width+20); width = fontMetric.width(tr("Rides")); anal->setWidth(width+20); width = fontMetric.width(tr("Train")); train->setWidth(width+20); #ifdef GC_HAVE_ICAL width = fontMetric.width(tr("Diary")); diary->setWidth(width+20); #endif }
void EventModelFilter::setFilterEndDate( const QDate& date ) { m_end = date; filterChanged(); }
void EventModelFilter::setFilterStartDate( const QDate& date ) { m_start = date; filterChanged(); }
QMediaControl *DirectShowPlayerService::requestControl(const char *name) { if (qstrcmp(name, QMediaPlayerControl_iid) == 0) { return m_playerControl; } else if (qstrcmp(name, QAudioEndpointSelector_iid) == 0) { return m_audioEndpointControl; } else if (qstrcmp(name, QMetaDataReaderControl_iid) == 0) { return m_metaDataControl; } else if (qstrcmp(name, QVideoRendererControl_iid) == 0) { #ifndef Q_WS_SIMULATOR if (!m_videoRendererControl && !m_videoWindowControl) { #else if (!m_videoRendererControl) { #endif m_videoRendererControl = new DirectShowVideoRendererControl(m_loop); connect(m_videoRendererControl, SIGNAL(filterChanged()), this, SLOT(videoOutputChanged())); return m_videoRendererControl; } #ifndef Q_WS_SIMULATOR } else if (qstrcmp(name, QVideoWindowControl_iid) == 0) { if (!m_videoRendererControl && !m_videoWindowControl) { m_videoWindowControl = new Vmr9VideoWindowControl; setVideoOutput(m_videoWindowControl->filter()); return m_videoWindowControl; } #endif } return 0; } void DirectShowPlayerService::releaseControl(QMediaControl *control) { if (!control) { qWarning("QMediaService::releaseControl():" " Attempted release of null control"); } else if (control == m_videoRendererControl) { setVideoOutput(0); delete m_videoRendererControl; m_videoRendererControl = 0; #ifndef Q_WS_SIMULATOR } else if (control == m_videoWindowControl) { setVideoOutput(0); delete m_videoWindowControl; m_videoWindowControl = 0; #endif } } void DirectShowPlayerService::load(const QMediaContent &media, QIODevice *stream) { QMutexLocker locker(&m_mutex); m_pendingTasks = 0; if (m_graph) releaseGraph(); m_resources = media.resources(); m_stream = stream; m_error = QMediaPlayer::NoError; m_errorString = QString(); m_position = 0; m_duration = 0; m_streamTypes = 0; m_executedTasks = 0; m_buffering = false; m_seekable = false; m_atEnd = false; m_metaDataControl->updateGraph(0, 0); if (m_resources.isEmpty() && !stream) { m_pendingTasks = 0; m_graphStatus = NoMedia; m_url.clear(); } else if (stream && (!stream->isReadable() || stream->isSequential())) { m_pendingTasks = 0; m_graphStatus = InvalidMedia; m_error = QMediaPlayer::ResourceError; } else { // {36b73882-c2c8-11cf-8b46-00805f6cef60} static const GUID iid_IFilterGraph2 = { 0x36b73882, 0xc2c8, 0x11cf, {0x8b, 0x46, 0x00, 0x80, 0x5f, 0x6c, 0xef, 0x60} }; m_graphStatus = Loading; m_graph = com_new<IFilterGraph2>(CLSID_FilterGraph, iid_IFilterGraph2); if (stream) m_pendingTasks = SetStreamSource; else m_pendingTasks = SetUrlSource; ::SetEvent(m_taskHandle); } m_playerControl->updateError(m_error, m_errorString); m_playerControl->updateMediaInfo(m_duration, m_streamTypes, m_seekable); m_playerControl->updateState(QMediaPlayer::StoppedState); m_playerControl->updatePosition(m_position); updateStatus(); }
PropertyEditor::PropertyEditor(QDesignerFormEditorInterface *core, QWidget *parent, Qt::WindowFlags flags) : QDesignerPropertyEditor(parent, flags), m_core(core), m_propertySheet(0), m_currentBrowser(0), m_treeBrowser(0), m_propertyManager(new DesignerPropertyManager(m_core, this)), m_dynamicGroup(0), m_updatingBrowser(false), m_stackedWidget(new QStackedWidget), m_filterWidget(new FilterWidget(0, FilterWidget::LayoutAlignNone)), m_buttonIndex(-1), m_treeIndex(-1), m_addDynamicAction(new QAction(createIconSet(QLatin1String("plus.png")), tr("Add Dynamic Property..."), this)), m_removeDynamicAction(new QAction(createIconSet(QLatin1String("minus.png")), tr("Remove Dynamic Property"), this)), m_sortingAction(new QAction(createIconSet(QLatin1String("sort.png")), tr("Sorting"), this)), m_coloringAction(new QAction(createIconSet(QLatin1String("color.png")), tr("Color Groups"), this)), m_treeAction(new QAction(tr("Tree View"), this)), m_buttonAction(new QAction(tr("Drop Down Button View"), this)), m_classLabel(new QLabel), m_sorting(false), m_coloring(false), m_brightness(false) { QVector<QColor> colors; colors.reserve(6); colors.push_back(QColor(255, 230, 191)); colors.push_back(QColor(255, 255, 191)); colors.push_back(QColor(191, 255, 191)); colors.push_back(QColor(199, 255, 255)); colors.push_back(QColor(234, 191, 255)); colors.push_back(QColor(255, 191, 239)); m_colors.reserve(colors.count()); for (int i = 0; i < colors.count(); i++) { QColor c = colors.at(i); m_colors.push_back(qMakePair(c, c.darker(150))); } QColor dynamicColor(191, 207, 255); QColor layoutColor(255, 191, 191); m_dynamicColor = qMakePair(dynamicColor, dynamicColor.darker(150)); m_layoutColor = qMakePair(layoutColor, layoutColor.darker(150)); updateForegroundBrightness(); QActionGroup *actionGroup = new QActionGroup(this); m_treeAction->setCheckable(true); m_treeAction->setIcon(createIconSet(QLatin1String("widgets/listview.png"))); m_buttonAction->setCheckable(true); m_buttonAction->setIcon(createIconSet(QLatin1String("dropdownbutton.png"))); actionGroup->addAction(m_treeAction); actionGroup->addAction(m_buttonAction); connect(actionGroup, SIGNAL(triggered(QAction*)), this, SLOT(slotViewTriggered(QAction*))); QWidget *classWidget = new QWidget; QHBoxLayout *l = new QHBoxLayout(classWidget); l->setContentsMargins(5, 0, 5, 0); l->addWidget(m_classLabel); // Add actions QActionGroup *addDynamicActionGroup = new QActionGroup(this); connect(addDynamicActionGroup, SIGNAL(triggered(QAction*)), this, SLOT(slotAddDynamicProperty(QAction*))); QMenu *addDynamicActionMenu = new QMenu(this); m_addDynamicAction->setMenu(addDynamicActionMenu); m_addDynamicAction->setEnabled(false); QAction *addDynamicAction = addDynamicActionGroup->addAction(tr("String...")); addDynamicAction->setData(static_cast<int>(QVariant::String)); addDynamicActionMenu->addAction(addDynamicAction); addDynamicAction = addDynamicActionGroup->addAction(tr("Bool...")); addDynamicAction->setData(static_cast<int>(QVariant::Bool)); addDynamicActionMenu->addAction(addDynamicAction); addDynamicActionMenu->addSeparator(); addDynamicAction = addDynamicActionGroup->addAction(tr("Other...")); addDynamicAction->setData(static_cast<int>(QVariant::Invalid)); addDynamicActionMenu->addAction(addDynamicAction); // remove m_removeDynamicAction->setEnabled(false); connect(m_removeDynamicAction, SIGNAL(triggered()), this, SLOT(slotRemoveDynamicProperty())); // Configure QAction *configureAction = new QAction(tr("Configure Property Editor"), this); configureAction->setIcon(createIconSet(QLatin1String("configure.png"))); QMenu *configureMenu = new QMenu(this); configureAction->setMenu(configureMenu); m_sortingAction->setCheckable(true); connect(m_sortingAction, SIGNAL(toggled(bool)), this, SLOT(slotSorting(bool))); m_coloringAction->setCheckable(true); connect(m_coloringAction, SIGNAL(toggled(bool)), this, SLOT(slotColoring(bool))); configureMenu->addAction(m_sortingAction); configureMenu->addAction(m_coloringAction); #if QT_VERSION >= 0x040600 configureMenu->addSeparator(); configureMenu->addAction(m_treeAction); configureMenu->addAction(m_buttonAction); #endif // Assemble toolbar QToolBar *toolBar = new QToolBar; toolBar->addWidget(classWidget); toolBar->addWidget(m_filterWidget); toolBar->addWidget(createDropDownButton(m_addDynamicAction)); toolBar->addAction(m_removeDynamicAction); toolBar->addWidget(createDropDownButton(configureAction)); // Views QScrollArea *buttonScroll = new QScrollArea(m_stackedWidget); m_buttonBrowser = new QtButtonPropertyBrowser(buttonScroll); buttonScroll->setWidgetResizable(true); buttonScroll->setWidget(m_buttonBrowser); m_buttonIndex = m_stackedWidget->addWidget(buttonScroll); connect(m_buttonBrowser, SIGNAL(currentItemChanged(QtBrowserItem*)), this, SLOT(slotCurrentItemChanged(QtBrowserItem*))); m_treeBrowser = new QtTreePropertyBrowser(m_stackedWidget); m_treeBrowser->setRootIsDecorated(false); m_treeBrowser->setPropertiesWithoutValueMarked(true); m_treeBrowser->setResizeMode(QtTreePropertyBrowser::Interactive); m_treeIndex = m_stackedWidget->addWidget(m_treeBrowser); connect(m_treeBrowser, SIGNAL(currentItemChanged(QtBrowserItem*)), this, SLOT(slotCurrentItemChanged(QtBrowserItem*))); connect(m_filterWidget, SIGNAL(filterChanged(QString)), this, SLOT(setFilter(QString))); QVBoxLayout *layout = new QVBoxLayout(this); layout->addWidget(toolBar); layout->addWidget(m_stackedWidget); layout->setMargin(0); layout->setSpacing(0); m_treeFactory = new DesignerEditorFactory(m_core, this); m_treeFactory->setSpacing(0); m_groupFactory = new DesignerEditorFactory(m_core, this); QtVariantPropertyManager *variantManager = m_propertyManager; m_buttonBrowser->setFactoryForManager(variantManager, m_groupFactory); m_treeBrowser->setFactoryForManager(variantManager, m_treeFactory); m_stackedWidget->setCurrentIndex(m_treeIndex); m_currentBrowser = m_treeBrowser; m_treeAction->setChecked(true); connect(m_groupFactory, SIGNAL(resetProperty(QtProperty*)), this, SLOT(slotResetProperty(QtProperty*))); connect(m_treeFactory, SIGNAL(resetProperty(QtProperty*)), this, SLOT(slotResetProperty(QtProperty*))); connect(variantManager, SIGNAL(valueChanged(QtProperty*,QVariant,bool)), this, SLOT(slotValueChanged(QtProperty*,QVariant,bool))); // retrieve initial settings QDesignerSettingsInterface *settings = m_core->settingsManager(); settings->beginGroup(QLatin1String(SettingsGroupC)); #if QT_VERSION >= 0x040500 const SettingsView view = settings->value(QLatin1String(ViewKeyC), TreeView).toInt() == TreeView ? TreeView : ButtonView; #endif // Coloring not available unless treeview and not sorted m_sorting = settings->value(QLatin1String(SortedKeyC), false).toBool(); m_coloring = settings->value(QLatin1String(ColorKeyC), true).toBool(); const QVariantMap expansionState = settings->value(QLatin1String(ExpansionKeyC), QVariantMap()).toMap(); settings->endGroup(); // Apply settings m_sortingAction->setChecked(m_sorting); m_coloringAction->setChecked(m_coloring); #if QT_VERSION >= 0x040500 switch (view) { case TreeView: m_currentBrowser = m_treeBrowser; m_stackedWidget->setCurrentIndex(m_treeIndex); m_treeAction->setChecked(true); break; case ButtonView: m_currentBrowser = m_buttonBrowser; m_stackedWidget->setCurrentIndex(m_buttonIndex); m_buttonAction->setChecked(true); break; } #endif // Restore expansionState from QVariant map if (!expansionState.empty()) { const QVariantMap::const_iterator cend = expansionState.constEnd(); for (QVariantMap::const_iterator it = expansionState.constBegin(); it != cend; ++it) m_expansionState.insert(it.key(), it.value().toBool()); } updateActionsState(); }
/** Constructor */ IdDialog::IdDialog(QWidget *parent) : RsGxsUpdateBroadcastPage(rsIdentity, parent), ui(new Ui::IdDialog) { ui->setupUi(this); mIdQueue = NULL; /* Setup UI helper */ mStateHelper = new UIStateHelper(this); // mStateHelper->addWidget(IDDIALOG_IDLIST, ui->idTreeWidget); mStateHelper->addLoadPlaceholder(IDDIALOG_IDLIST, ui->idTreeWidget, false); mStateHelper->addClear(IDDIALOG_IDLIST, ui->idTreeWidget); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_Nickname); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_KeyId); // mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_GpgHash); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_GpgId); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_GpgName); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_Type); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_LastUsed); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->toolButton_Reputation); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->line_RatingOverall); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->line_RatingImplicit); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->line_RatingOwn); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->line_RatingPeers); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->repModButton); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->repMod_Accept); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->repMod_Ban); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->repMod_Negative); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->repMod_Positive); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->repMod_Custom); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->repMod_spinBox); mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_Nickname); mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_GpgName); mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_KeyId); // mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_GpgHash); mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_GpgId); mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_Type); mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_GpgName); mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_LastUsed); mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->line_RatingOverall); mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->line_RatingImplicit); mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->line_RatingOwn); mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->line_RatingPeers); mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_Nickname); mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_KeyId); // mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_GpgHash); mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_GpgId); mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_Type); mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_GpgName); mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_LastUsed); mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->line_RatingOverall); mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->line_RatingImplicit); mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->line_RatingOwn); mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->line_RatingPeers); //mStateHelper->addWidget(IDDIALOG_REPLIST, ui->treeWidget_RepList); //mStateHelper->addLoadPlaceholder(IDDIALOG_REPLIST, ui->treeWidget_RepList); //mStateHelper->addClear(IDDIALOG_REPLIST, ui->treeWidget_RepList); /* Connect signals */ connect(ui->toolButton_NewId, SIGNAL(clicked()), this, SLOT(addIdentity())); connect(ui->todoPushButton, SIGNAL(clicked()), this, SLOT(todo())); connect(ui->removeIdentity, SIGNAL(triggered()), this, SLOT(removeIdentity())); connect(ui->editIdentity, SIGNAL(triggered()), this, SLOT(editIdentity())); connect(ui->chatIdentity, SIGNAL(triggered()), this, SLOT(chatIdentity())); connect(ui->idTreeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(updateSelection())); connect(ui->idTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(IdListCustomPopupMenu(QPoint))); connect(ui->filterComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(filterComboBoxChanged())); connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString))); connect(ui->repModButton, SIGNAL(clicked()), this, SLOT(modifyReputation())); connect(ui->messageButton, SIGNAL(clicked()), this, SLOT(sendMsg())); ui->avlabel->setPixmap(QPixmap(":/images/user/friends64.png")); ui->headerTextLabel->setText(tr("People")); /* Initialize splitter */ ui->splitter->setStretchFactor(0, 1); ui->splitter->setStretchFactor(1, 0); QList<int> sizes; sizes << width() << 500; // Qt calculates the right sizes ui->splitter->setSizes(sizes); /* Add filter types */ ui->filterComboBox->addItem(tr("All"), RSID_FILTER_ALL); ui->filterComboBox->addItem(tr("Owned by you"), RSID_FILTER_OWNED_BY_YOU); ui->filterComboBox->addItem(tr("Linked to your node"), RSID_FILTER_YOURSELF); ui->filterComboBox->addItem(tr("Linked to neighbor nodes"), RSID_FILTER_FRIENDS); ui->filterComboBox->addItem(tr("Linked to distant nodes"), RSID_FILTER_OTHERS); ui->filterComboBox->addItem(tr("Anonymous"), RSID_FILTER_PSEUDONYMS); ui->filterComboBox->setCurrentIndex(0); /* Add filter actions */ QTreeWidgetItem *headerItem = ui->idTreeWidget->headerItem(); QString headerText = headerItem->text(RSID_COL_NICKNAME); ui->filterLineEdit->addFilter(QIcon(), headerText, RSID_COL_NICKNAME, QString("%1 %2").arg(tr("Search"), headerText)); headerText = headerItem->text(RSID_COL_KEYID); ui->filterLineEdit->addFilter(QIcon(), headerItem->text(RSID_COL_KEYID), RSID_COL_KEYID, QString("%1 %2").arg(tr("Search"), headerText)); /* Setup tree */ ui->idTreeWidget->sortByColumn(RSID_COL_NICKNAME, Qt::AscendingOrder); ui->idTreeWidget->enableColumnCustomize(true); ui->idTreeWidget->setColumnCustomizable(RSID_COL_NICKNAME, false); /* Set initial column width */ int fontWidth = QFontMetricsF(ui->idTreeWidget->font()).width("W"); ui->idTreeWidget->setColumnWidth(RSID_COL_NICKNAME, 18 * fontWidth); ui->idTreeWidget->setColumnWidth(RSID_COL_KEYID, 25 * fontWidth); ui->idTreeWidget->setColumnWidth(RSID_COL_IDTYPE, 18 * fontWidth); mIdQueue = new TokenQueue(rsIdentity->getTokenService(), this); mStateHelper->setActive(IDDIALOG_IDDETAILS, false); mStateHelper->setActive(IDDIALOG_REPLIST, false); // Hiding RepList until that part is finished. //ui->treeWidget_RepList->setVisible(false); ui->toolButton_Reputation->setVisible(false); #ifndef UNFINISHED ui->todoPushButton->hide() ; #endif QString hlp_str = tr( " <h1><img width=\"32\" src=\":/icons/help_64.png\"> Identities</h1> \ <p>In this tab you can create/edit pseudo-anonymous identities. \ </p> \ <p>Identities are used to securely identify your data: sign forum and channel posts,\ and receive feedback using Retroshare built-in email system, post comments \ after channel posts, etc.</p> \ <p> \ Identities can optionally be signed by your Retroshare node's certificate. \ Signed identities are easier to trust but are easily linked to your node's IP address. \ </p> \ <p> \ Anonymous identities allow you to anonymously interact with other users. They cannot be \ spoofed, but noone can prove who really owns a given identity. \ </p> \ ") ; registerHelpButton(ui->helpButton, hlp_str) ; // load settings processSettings(true); // hide reputation sice it's currently unused ui->reputationGroupBox->hide(); ui->tweakGroupBox->hide(); }
QgsWFSSourceSelect::QgsWFSSourceSelect( QWidget* parent, Qt::WindowFlags fl, bool embeddedMode ) : QDialog( parent, fl ) , mCapabilities( nullptr ) , mSQLComposerDialog( nullptr ) { setupUi( this ); if ( embeddedMode ) { buttonBox->button( QDialogButtonBox::Close )->hide(); } mAddButton = new QPushButton( tr( "&Add" ) ); mAddButton->setEnabled( false ); mBuildQueryButton = new QPushButton( tr( "&Build query" ) ); mBuildQueryButton->setToolTip( tr( "Build query" ) ); mBuildQueryButton->setDisabled( true ); buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole ); connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addLayer() ) ); buttonBox->addButton( mBuildQueryButton, QDialogButtonBox::ActionRole ); connect( mBuildQueryButton, SIGNAL( clicked() ), this, SLOT( buildQueryButtonClicked() ) ); connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) ); connect( btnNew, SIGNAL( clicked() ), this, SLOT( addEntryToServerList() ) ); connect( btnEdit, SIGNAL( clicked() ), this, SLOT( modifyEntryOfServerList() ) ); connect( btnDelete, SIGNAL( clicked() ), this, SLOT( deleteEntryOfServerList() ) ); connect( btnConnect, SIGNAL( clicked() ), this, SLOT( connectToServer() ) ); connect( btnChangeSpatialRefSys, SIGNAL( clicked() ), this, SLOT( changeCRS() ) ); connect( lineFilter, SIGNAL( textChanged( QString ) ), this, SLOT( filterChanged( QString ) ) ); populateConnectionList(); mProjectionSelector = new QgsGenericProjectionSelector( this ); mProjectionSelector->setMessage(); mItemDelegate = new QgsWFSItemDelegate( treeView ); treeView->setItemDelegate( mItemDelegate ); QSettings settings; QgsDebugMsg( "restoring settings" ); restoreGeometry( settings.value( "/Windows/WFSSourceSelect/geometry" ).toByteArray() ); cbxUseTitleLayerName->setChecked( settings.value( "/Windows/WFSSourceSelect/UseTitleLayerName", false ).toBool() ); cbxFeatureCurrentViewExtent->setChecked( settings.value( "/Windows/WFSSourceSelect/FeatureCurrentViewExtent", true ).toBool() ); mHoldDialogOpen->setChecked( settings.value( "/Windows/WFSSourceSelect/HoldDialogOpen", false ).toBool() ); mModel = new QStandardItemModel(); mModel->setHorizontalHeaderItem( MODEL_IDX_TITLE, new QStandardItem( "Title" ) ); mModel->setHorizontalHeaderItem( MODEL_IDX_NAME, new QStandardItem( "Name" ) ); mModel->setHorizontalHeaderItem( MODEL_IDX_ABSTRACT, new QStandardItem( "Abstract" ) ); mModel->setHorizontalHeaderItem( MODEL_IDX_SQL, new QStandardItem( "Sql" ) ); mModelProxy = new QSortFilterProxyModel( this ); mModelProxy->setSourceModel( mModel ); mModelProxy->setSortCaseSensitivity( Qt::CaseInsensitive ); treeView->setModel( mModelProxy ); connect( treeView, SIGNAL( doubleClicked( const QModelIndex& ) ), this, SLOT( treeWidgetItemDoubleClicked( const QModelIndex& ) ) ); connect( treeView->selectionModel(), SIGNAL( currentRowChanged( QModelIndex, QModelIndex ) ), this, SLOT( treeWidgetCurrentRowChanged( const QModelIndex&, const QModelIndex& ) ) ); }
LTMWindow::LTMWindow(Context *context) : GcChartWindow(context), context(context), dirty(true), stackDirty(true), compareDirty(true) { useToToday = useCustom = false; plotted = DateRange(QDate(01,01,01), QDate(01,01,01)); // the plot QVBoxLayout *mainLayout = new QVBoxLayout; ltmPlot = new LTMPlot(this, context, true); // the stack of plots QPalette palette; palette.setBrush(QPalette::Background, QBrush(GColor(CPLOTBACKGROUND))); plotsWidget = new QWidget(this); plotsWidget->setPalette(palette); plotsLayout = new QVBoxLayout(plotsWidget); plotsLayout->setSpacing(0); plotsLayout->setContentsMargins(0,0,0,0); plotArea = new QScrollArea(this); #ifdef Q_OS_WIN QStyle *cde = QStyleFactory::create(OS_STYLE); plotArea->setStyle(cde); #endif plotArea->setAutoFillBackground(false); plotArea->setWidgetResizable(true); plotArea->setWidget(plotsWidget); plotArea->setFrameStyle(QFrame::NoFrame); plotArea->setContentsMargins(0,0,0,0); plotArea->setPalette(palette); // the data table dataSummary = new QWebView(this); dataSummary->setContentsMargins(0,0,0,0); dataSummary->page()->view()->setContentsMargins(0,0,0,0); dataSummary->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); dataSummary->setAcceptDrops(false); QFont defaultFont; // mainwindow sets up the defaults.. we need to apply dataSummary->settings()->setFontSize(QWebSettings::DefaultFontSize, defaultFont.pointSize()+1); dataSummary->settings()->setFontFamily(QWebSettings::StandardFont, defaultFont.family()); // compare plot page compareplotsWidget = new QWidget(this); compareplotsWidget->setPalette(palette); compareplotsLayout = new QVBoxLayout(compareplotsWidget); compareplotsLayout->setSpacing(0); compareplotsLayout->setContentsMargins(0,0,0,0); compareplotArea = new QScrollArea(this); #ifdef Q_OS_WIN cde = QStyleFactory::create(OS_STYLE); compareplotArea->setStyle(cde); #endif compareplotArea->setAutoFillBackground(false); compareplotArea->setWidgetResizable(true); compareplotArea->setWidget(compareplotsWidget); compareplotArea->setFrameStyle(QFrame::NoFrame); compareplotArea->setContentsMargins(0,0,0,0); compareplotArea->setPalette(palette); // the stack stackWidget = new QStackedWidget(this); stackWidget->addWidget(ltmPlot); stackWidget->addWidget(dataSummary); stackWidget->addWidget(plotArea); stackWidget->addWidget(compareplotArea); stackWidget->setCurrentIndex(0); mainLayout->addWidget(stackWidget); setChartLayout(mainLayout); // reveal controls QHBoxLayout *revealLayout = new QHBoxLayout; revealLayout->setContentsMargins(0,0,0,0); revealLayout->addStretch(); revealLayout->addWidget(new QLabel(tr("Group by"),this)); rGroupBy = new QxtStringSpinBox(this); QStringList strings; strings << tr("Days") << tr("Weeks") << tr("Months") << tr("Years") << tr("Time Of Day") << tr("All"); rGroupBy->setStrings(strings); rGroupBy->setValue(0); revealLayout->addWidget(rGroupBy); rData = new QCheckBox(tr("Data Table"), this); rStack = new QCheckBox(tr("Stacked"), this); QVBoxLayout *checks = new QVBoxLayout; checks->setSpacing(2); checks->setContentsMargins(0,0,0,0); checks->addWidget(rData); checks->addWidget(rStack); revealLayout->addLayout(checks); revealLayout->addStretch(); setRevealLayout(revealLayout); // the controls QWidget *c = new QWidget; c->setContentsMargins(0,0,0,0); QVBoxLayout *cl = new QVBoxLayout(c); cl->setContentsMargins(0,0,0,0); cl->setSpacing(0); setControls(c); // the popup popup = new GcPane(); ltmPopup = new LTMPopup(context); QVBoxLayout *popupLayout = new QVBoxLayout(); popupLayout->addWidget(ltmPopup); popup->setLayout(popupLayout); ltmTool = new LTMTool(context, &settings); // initialise settings.ltmTool = ltmTool; settings.data = NULL; settings.groupBy = LTM_DAY; settings.legend = ltmTool->showLegend->isChecked(); settings.events = ltmTool->showEvents->isChecked(); settings.shadeZones = ltmTool->shadeZones->isChecked(); settings.showData = ltmTool->showData->isChecked(); settings.stack = ltmTool->showStack->isChecked(); settings.stackWidth = ltmTool->stackSlider->value(); rData->setChecked(ltmTool->showData->isChecked()); rStack->setChecked(ltmTool->showStack->isChecked()); cl->addWidget(ltmTool); connect(this, SIGNAL(dateRangeChanged(DateRange)), this, SLOT(dateRangeChanged(DateRange))); connect(ltmTool, SIGNAL(filterChanged()), this, SLOT(filterChanged())); connect(context, SIGNAL(homeFilterChanged()), this, SLOT(filterChanged())); connect(ltmTool->groupBy, SIGNAL(currentIndexChanged(int)), this, SLOT(groupBySelected(int))); connect(rGroupBy, SIGNAL(valueChanged(int)), this, SLOT(rGroupBySelected(int))); connect(ltmTool->applyButton, SIGNAL(clicked(bool)), this, SLOT(applyClicked(void))); connect(ltmTool->shadeZones, SIGNAL(stateChanged(int)), this, SLOT(shadeZonesClicked(int))); connect(ltmTool->showData, SIGNAL(stateChanged(int)), this, SLOT(showDataClicked(int))); connect(rData, SIGNAL(stateChanged(int)), this, SLOT(showDataClicked(int))); connect(ltmTool->showStack, SIGNAL(stateChanged(int)), this, SLOT(showStackClicked(int))); connect(rStack, SIGNAL(stateChanged(int)), this, SLOT(showStackClicked(int))); connect(ltmTool->stackSlider, SIGNAL(valueChanged(int)), this, SLOT(zoomSliderChanged())); connect(ltmTool->showLegend, SIGNAL(stateChanged(int)), this, SLOT(showLegendClicked(int))); connect(ltmTool->showEvents, SIGNAL(stateChanged(int)), this, SLOT(showEventsClicked(int))); connect(ltmTool, SIGNAL(useCustomRange(DateRange)), this, SLOT(useCustomRange(DateRange))); connect(ltmTool, SIGNAL(useThruToday()), this, SLOT(useThruToday())); connect(ltmTool, SIGNAL(useStandardRange()), this, SLOT(useStandardRange())); connect(ltmTool, SIGNAL(curvesChanged()), this, SLOT(refresh())); connect(context, SIGNAL(filterChanged()), this, SLOT(refresh())); // comparing things connect(context, SIGNAL(compareDateRangesStateChanged(bool)), this, SLOT(compareChanged())); connect(context, SIGNAL(compareDateRangesChanged()), this, SLOT(compareChanged())); connect(context, SIGNAL(rideAdded(RideItem*)), this, SLOT(refresh(void))); connect(context, SIGNAL(rideDeleted(RideItem*)), this, SLOT(refresh(void))); connect(context, SIGNAL(configChanged()), this, SLOT(configChanged())); connect(context, SIGNAL(presetSelected(int)), this, SLOT(presetSelected(int))); configChanged(); }
ItemLibraryWidget::ItemLibraryWidget(QWidget *parent) : QFrame(parent), m_iconProvider(m_resIconSize), m_itemIconSize(24, 24), m_resIconSize(24, 24), m_itemsView(new QDeclarativeView(this)), m_resourcesView(new Internal::ItemLibraryTreeView(this)), m_filterFlag(QtBasic) { setWindowTitle(tr("Library", "Title of library view")); /* create Items view and its model */ m_itemsView->setAttribute(Qt::WA_OpaquePaintEvent); m_itemsView->setAttribute(Qt::WA_NoSystemBackground); m_itemsView->setAcceptDrops(false); m_itemsView->setFocusPolicy(Qt::ClickFocus); m_itemsView->setResizeMode(QDeclarativeView::SizeRootObjectToView); m_itemLibraryModel = new Internal::ItemLibraryModel(QDeclarativeEnginePrivate::getScriptEngine(m_itemsView->engine()), this); m_itemLibraryModel->setItemIconSize(m_itemIconSize); QDeclarativeContext *rootContext = m_itemsView->rootContext(); rootContext->setContextProperty(QLatin1String("itemLibraryModel"), m_itemLibraryModel.data()); rootContext->setContextProperty(QLatin1String("itemLibraryIconWidth"), m_itemIconSize.width()); rootContext->setContextProperty(QLatin1String("itemLibraryIconHeight"), m_itemIconSize.height()); QColor highlightColor = palette().highlight().color(); if (0.5*highlightColor.saturationF()+0.75-highlightColor.valueF() < 0) highlightColor.setHsvF(highlightColor.hsvHueF(),0.1 + highlightColor.saturationF()*2.0, highlightColor.valueF()); m_itemsView->rootContext()->setContextProperty(QLatin1String("highlightColor"), highlightColor); // loading the qml has to come after all needed context properties are set m_itemsView->setSource(QUrl("qrc:/ItemLibrary/qml/ItemsView.qml")); QDeclarativeItem *rootItem = qobject_cast<QDeclarativeItem*>(m_itemsView->rootObject()); connect(rootItem, SIGNAL(itemSelected(int)), this, SLOT(showItemInfo(int))); connect(rootItem, SIGNAL(itemDragged(int)), this, SLOT(startDragAndDrop(int))); connect(this, SIGNAL(scrollItemsView(QVariant)), rootItem, SLOT(scrollView(QVariant))); connect(this, SIGNAL(resetItemsView()), rootItem, SLOT(resetView())); /* create Resources view and its model */ m_resourcesFileSystemModel = new QFileSystemModel(this); m_resourcesFileSystemModel->setIconProvider(&m_iconProvider); m_resourcesView->setModel(m_resourcesFileSystemModel.data()); m_resourcesView->setIconSize(m_resIconSize); /* create image provider for loading item icons */ m_itemsView->engine()->addImageProvider(QLatin1String("qmldesigner_itemlibrary"), new Internal::ItemLibraryImageProvider); /* other widgets */ QTabBar *tabBar = new QTabBar(this); tabBar->addTab(tr("Items", "Title of library items view")); tabBar->addTab(tr("Resources", "Title of library resources view")); tabBar->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); m_lineEdit = new Utils::FilterLineEdit(this); m_lineEdit->setObjectName(QLatin1String("itemLibrarySearchInput")); m_lineEdit->setPlaceholderText(tr("<Filter>", "Library search input hint text")); m_lineEdit->setDragEnabled(false); m_lineEdit->setMinimumWidth(75); m_lineEdit->setTextMargins(0, 0, 20, 0); QWidget *lineEditFrame = new QWidget(this); lineEditFrame->setObjectName(QLatin1String("itemLibrarySearchInputFrame")); QGridLayout *lineEditLayout = new QGridLayout(lineEditFrame); lineEditLayout->setMargin(2); lineEditLayout->setSpacing(0); lineEditLayout->addItem(new QSpacerItem(5, 3, QSizePolicy::Fixed, QSizePolicy::Fixed), 0, 0, 1, 3); lineEditLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Fixed, QSizePolicy::Fixed), 1, 0); lineEditLayout->addWidget(m_lineEdit.data(), 1, 1, 1, 1); lineEditLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Fixed, QSizePolicy::Fixed), 1, 2); connect(m_lineEdit.data(), SIGNAL(filterChanged(QString)), this, SLOT(setSearchFilter(QString))); m_stackedWidget = new QStackedWidget(this); m_stackedWidget->addWidget(m_itemsView.data()); m_stackedWidget->addWidget(m_resourcesView.data()); connect(tabBar, SIGNAL(currentChanged(int)), m_stackedWidget.data(), SLOT(setCurrentIndex(int))); connect(tabBar, SIGNAL(currentChanged(int)), this, SLOT(updateSearch())); QWidget *spacer = new QWidget(this); spacer->setObjectName(QLatin1String("itemLibrarySearchInputSpacer")); spacer->setFixedHeight(4); QGridLayout *layout = new QGridLayout(this); layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(0); layout->addWidget(tabBar, 0, 0, 1, 1); layout->addWidget(spacer, 1, 0); layout->addWidget(lineEditFrame, 2, 0, 1, 1); layout->addWidget(m_stackedWidget.data(), 3, 0, 1, 1); setResourcePath(QDir::currentPath()); setSearchFilter(QString()); /* style sheets */ setStyleSheet(QLatin1String(Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css"))); m_resourcesView->setStyleSheet( QLatin1String(Utils::FileReader::fetchQrc(":/qmldesigner/scrollbar.css"))); }
void ParallelPlane::set_filtered(const bool& b){ is_filtered_ = b; emit filterChanged(); }
void SearchFilter::showEvent(QShowEvent *ev) { if(! mEnabled) { mEnabled = true; emit filterChanged(); } }