Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. void MainWindow::registerSearchBar( KLineEdit * bar ) {
  2. if ( !bar )
  3. return;
  4. d->searchBar = bar;
  5. bar->setFixedHeight( 0 );
  6. connect( bar, SIGNAL(textChanged(QString)),//SIGNAL(stringFilterChanged(QString)),
  7. this, SLOT(slotSearchBarTextChanged(QString)) );
  8. d->tryToConnectSearchBarToKeyTreeView();
  9. }
  10.  
  11. void MainWindow::Private::slotSearchBarTextChanged( const QString & text ) {
  12. if ( text.isEmpty() && searchBar && searchBar->isVisible() ) {
  13. searchBar->setFixedHeight( 0 );
  14. searchBar->hide();
  15. } else if ( !text.isEmpty() && searchBar && !searchBar->isVisible() ) {
  16. kDebug() << "searchBar->minimumSizeHint()" << searchBar->minimumSizeHint();
  17. searchBar->setFixedHeight( searchBar->minimumSizeHint().height() );
  18. searchBar->show();
  19. searchBar->setFocus();
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement