1 #include "mainwindow.h"
2 #include "workmodedialog.h"
3 #include "ui_workmodedialog.h"
5 WorkModeDialog::WorkModeDialog(QWidget
*parent
) :
7 m_ui(new Ui::WorkModeDialog
),
11 setWindowFlags( Qt::WindowStaysOnTopHint
| Qt::Tool
);
13 p
= ( MainWindow
* )parent
;
15 m_ui
->treeView
->setModel( &p
->model
);
16 m_ui
->treeView
->expandAll();
18 connect( m_ui
->searchLineEdit
, SIGNAL( textChanged( QString
) ),
19 p
, SLOT( on_searchLineEdit_textChanged( QString
) ) );
21 shortcut
.setKey( QKeySequence( "F5" ) );
23 connect( &shortcut
, SIGNAL( activated() ), p
, SLOT( on_action_Normal_activated() ) );
28 WorkModeDialog::~WorkModeDialog()
33 void WorkModeDialog::changeEvent(QEvent
*e
)
36 case QEvent::LanguageChange
:
37 m_ui
->retranslateUi(this);
44 void WorkModeDialog::hideSnippets() {
46 m_ui
->treeView
->hide();
47 this->setFixedHeight( m_ui
->searchLineEdit
->height() + 4 );
51 void WorkModeDialog::showSnippets() {
52 m_ui
->treeView
->show();
53 this->setFixedHeight( m_ui
->searchLineEdit
->height() + 350 );
56 void WorkModeDialog::enterEvent( QEvent
* ) {
60 void WorkModeDialog::leaveEvent( QEvent
* ) {