DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
SearchComboBox.cpp
Go to the documentation of this file.
1
2#include <QKeyEvent>
5
7 : QComboBox ( parent ),
8 UserText ( QString ( "" ) )
9{
10 connect ( this, SIGNAL ( currentIndexChanged ( const QString & ) ), this,
11 SLOT ( ChangeToolTip ( const QString & ) ) );
12}
13
14void dbe::SearchComboBox::focusInEvent ( QFocusEvent * Event )
15{
16 UserText = currentText();
17 QComboBox::focusInEvent ( Event );
18}
19
20void dbe::SearchComboBox::keyPressEvent ( QKeyEvent * Event )
21{
22 switch ( Event->key() )
23 {
24 case Qt::Key_Return:
25 emit ReturnPressed();
26 return;
27
28 default:
29 break;
30 }
31
32 QComboBox::keyPressEvent ( Event );
33
34 if ( currentText().compare ( UserText ) != 0 )
35 {
36 UserText = currentText();
37 emit TextModified ( currentText() );
38 }
39}
40
41void dbe::SearchComboBox::ChangeToolTip ( const QString & Text )
42{
43 setToolTip ( QString ( "Search mode: %1" ).arg ( Text ) );
44}
void ChangeToolTip(const QString &Text)
SearchComboBox(QWidget *parent=0)
Including QT Headers.
void keyPressEvent(QKeyEvent *Event)
void focusInEvent(QFocusEvent *Event)