Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void MainWindow::registerSearchBar( KLineEdit * bar ) {
- if ( !bar )
- return;
- d->searchBar = bar;
- bar->setFixedHeight( 0 );
- connect( bar, SIGNAL(textChanged(QString)),//SIGNAL(stringFilterChanged(QString)),
- this, SLOT(slotSearchBarTextChanged(QString)) );
- d->tryToConnectSearchBarToKeyTreeView();
- }
- void MainWindow::Private::slotSearchBarTextChanged( const QString & text ) {
- if ( text.isEmpty() && searchBar && searchBar->isVisible() ) {
- searchBar->setFixedHeight( 0 );
- searchBar->hide();
- } else if ( !text.isEmpty() && searchBar && !searchBar->isVisible() ) {
- kDebug() << "searchBar->minimumSizeHint()" << searchBar->minimumSizeHint();
- searchBar->setFixedHeight( searchBar->minimumSizeHint().height() );
- searchBar->show();
- searchBar->setFocus();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement