218
218
KTreeWidgetSearchLine::KTreeWidgetSearchLine( QWidget *q, QTreeWidget *treeWidget )
219
219
: KLineEdit( q ), d( new Private( this ) )
221
connect( this, SIGNAL( textChanged( const QString& ) ),
222
this, SLOT( _k_queueSearch( const QString& ) ) );
221
connect( this, SIGNAL(textChanged(QString)),
222
this, SLOT(_k_queueSearch(QString)) );
224
224
setClearButtonShown( true );
225
225
setTreeWidget( treeWidget );
233
233
const QList<QTreeWidget *> &treeWidgets )
234
234
: KLineEdit( q ), d( new Private( this ) )
236
connect( this, SIGNAL( textChanged( const QString& ) ),
237
this, SLOT( _k_queueSearch( const QString& ) ) );
236
connect( this, SIGNAL(textChanged(QString)),
237
this, SLOT(_k_queueSearch(QString)) );
239
239
setClearButtonShown( true );
240
240
setTreeWidgets( treeWidgets );
420
420
QMenu *subMenu = popup->addMenu( i18n("Search Columns") );
422
422
QAction* allVisibleColumnsAction = subMenu->addAction( i18n("All Visible Columns"),
423
this, SLOT( _k_slotAllVisibleColumns() ) );
423
this, SLOT(_k_slotAllVisibleColumns()) );
424
424
allVisibleColumnsAction->setCheckable( true );
425
425
allVisibleColumnsAction->setChecked( !d->searchColumns.count() );
426
426
subMenu->addSeparator();
430
430
QActionGroup* group = new QActionGroup( popup );
431
431
group->setExclusive( false );
432
connect( group, SIGNAL( triggered( QAction* ) ), SLOT( _k_slotColumnActivated( QAction* ) ) );
432
connect( group, SIGNAL(triggered(QAction*)), SLOT(_k_slotColumnActivated(QAction*)) );
434
434
QHeaderView* const header = d->treeWidgets.first()->header();
435
435
for ( int j = 0; j < header->count(); j++ ) {
465
465
void KTreeWidgetSearchLine::connectTreeWidget( QTreeWidget *treeWidget )
467
connect( treeWidget, SIGNAL( destroyed( QObject* ) ),
468
this, SLOT( _k_treeWidgetDeleted( QObject* ) ) );
467
connect( treeWidget, SIGNAL(destroyed(QObject*)),
468
this, SLOT(_k_treeWidgetDeleted(QObject*)) );
470
connect( treeWidget->model(), SIGNAL( rowsInserted( const QModelIndex&, int, int) ),
471
this, SLOT( _k_rowsInserted( const QModelIndex&, int, int ) ) );
470
connect( treeWidget->model(), SIGNAL(rowsInserted(QModelIndex,int,int)),
471
this, SLOT(_k_rowsInserted(QModelIndex,int,int)) );
474
474
void KTreeWidgetSearchLine::disconnectTreeWidget( QTreeWidget *treeWidget )
476
disconnect( treeWidget, SIGNAL( destroyed( QObject* ) ),
477
this, SLOT( _k_treeWidgetDeleted( QObject* ) ) );
476
disconnect( treeWidget, SIGNAL(destroyed(QObject*)),
477
this, SLOT(_k_treeWidgetDeleted(QObject*)) );
479
disconnect( treeWidget->model(), SIGNAL( rowsInserted( const QModelIndex&, int, int) ),
480
this, SLOT( _k_rowsInserted( const QModelIndex&, int, int ) ) );
479
disconnect( treeWidget->model(), SIGNAL(rowsInserted(QModelIndex,int,int)),
480
this, SLOT(_k_rowsInserted(QModelIndex,int,int)) );
483
483
bool KTreeWidgetSearchLine::canChooseColumnsCheck()
548
548
queuedSearches++;
549
549
search = _search;
551
QTimer::singleShot( 200, q, SLOT( _k_activateSearch() ) );
551
QTimer::singleShot( 200, q, SLOT(_k_activateSearch()) );
554
554
void KTreeWidgetSearchLine::Private::_k_activateSearch()