void Albums::showFilterBar() { m_filterIcon->setEnabled( false ); AlbumsFilterBar *bar = new AlbumsFilterBar( this ); bar->setContentsMargins( 0, 0, 0, 0 ); QGraphicsLinearLayout *l = static_cast<QGraphicsLinearLayout*>( layout() ); l->setItemSpacing( 1, 0 ); l->addItem( bar ); connect( bar, SIGNAL(filterTextChanged(QString)), this, SLOT(filterTextChanged(QString)) ); connect( bar, SIGNAL(closeRequested()), this, SLOT(closeFilterBar()) ); bar->focusEditor(); }
AlbumsFilterBar::AlbumsFilterBar( QGraphicsItem *parent, Qt::WindowFlags wFlags ) : QGraphicsWidget( parent, wFlags ) , m_editor( new KLineEdit ) , m_closeIcon( new Plasma::IconWidget( KIcon("dialog-close"), QString(), this ) ) { QGraphicsProxyWidget *editProxy = new QGraphicsProxyWidget( this ); editProxy->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ); editProxy->setWidget( m_editor ); m_editor->installEventFilter( this ); m_editor->setAttribute( Qt::WA_NoSystemBackground ); m_editor->setAutoFillBackground( true ); m_editor->setClearButtonShown( true ); m_editor->setClickMessage( i18n( "Filter Albums" ) ); m_editor->setContentsMargins( 0, 0, 0, 0 ); QSizeF iconSize = m_closeIcon->sizeFromIconSize( 16 ); m_closeIcon->setMaximumSize( iconSize ); m_closeIcon->setMinimumSize( iconSize ); QGraphicsLinearLayout *layout = new QGraphicsLinearLayout( Qt::Horizontal, this ); layout->setSpacing( 1 ); layout->addItem( editProxy ); layout->addItem( m_closeIcon ); layout->setStretchFactor( editProxy, 100 ); layout->setAlignment( editProxy, Qt::AlignCenter ); layout->setAlignment( m_closeIcon, Qt::AlignCenter ); layout->setContentsMargins( 0, 2, 0, 0 ); m_closeIcon->setToolTip( i18n( "Close" ) ); connect( m_closeIcon, SIGNAL(clicked()), SIGNAL(closeRequested()) ); connect( m_editor, SIGNAL(textChanged(QString)), SIGNAL(filterTextChanged(QString)) ); }
void Albums::closeFilterBar() { filterTextChanged( QString() ); AlbumsFilterBar *bar = static_cast<AlbumsFilterBar*>( sender() ); QGraphicsLinearLayout *l = static_cast<QGraphicsLinearLayout*>( layout() ); l->removeItem( bar ); bar->deleteLater(); m_filterIcon->setEnabled( true ); }
void djvFileBrowserModel::setFilterText(const QString & text) { if (text == _p->filterText) return; _p->filterText = text; modelUpdate(); Q_EMIT filterTextChanged(_p->filterText); Q_EMIT optionChanged(); }
KateProjectView::KateProjectView (KateProjectPluginView *pluginView, KateProject *project) : QWidget () , m_pluginView (pluginView) , m_project (project) , m_treeView (new KateProjectViewTree(pluginView, project)) , m_filter (new KLineEdit ()) { /** * layout tree view and co. */ QVBoxLayout *layout = new QVBoxLayout (); layout->setSpacing (0); layout->setContentsMargins (0, 0, 0, 0); layout->addWidget (m_treeView); layout->addWidget (m_filter); setLayout (layout); /** * do some stuff if line edit is changed */ connect (m_filter, SIGNAL(textChanged(QString)), this, SLOT(filterTextChanged(QString))); }
void KoTagFilterWidget::onTextChanged(const QString& lineEditText) { d->tagSearchSaveButton->setEnabled(!lineEditText.isEmpty()); emit filterTextChanged(lineEditText); }
void FilterHeader::applyFilter() { emit filterTextChanged( m_filterField->text() ); }
void FilterWidget::emitTextChanged(void) { filterTextChanged(text()); }