git-svn-id: svn://db.shs.com.ru/libs@367 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2018-03-22 10:41:05 +00:00
parent 60a3439550
commit 31f2be6981
4 changed files with 33 additions and 5 deletions

View File

@@ -19,6 +19,8 @@ QCodeEdit::QCodeEdit(QWidget * parent): QWidget(parent) {
ui = new Ui::QCodeEdit();
ui->setupUi(this);
ui->widgetSearch->hide();
ui->comboSearch->installEventFilter(this);
ui->comboReplace->installEventFilter(this);
prev_lc = auto_comp_pl = cur_search_ind = pos_press = pos_el_press = -1;
timer = 0;
_ignore_focus_out = _destructor = _replacing = false;
@@ -334,6 +336,20 @@ bool QCodeEdit::eventFilter(QObject * o, QEvent * e) {
//qDebug() << e;
return QWidget::eventFilter(o, e);
}
if (o == ui->comboSearch || o == ui->comboReplace) {
//qDebug() << o << e;
if (e->type() == QEvent::KeyPress) {
if (((QKeyEvent * )e)->key() == Qt::Key_Escape) {
hideHelp();
if (completer->isVisible())
completer->hide();
else
hideSearch();
}
}
//qDebug() << e;
return QWidget::eventFilter(o, e);
}
if (ui->textCode) {
if (o == ui->textCode->viewport()) {
if (e->type() == QEvent::MouseButtonPress) {
@@ -343,7 +359,7 @@ bool QCodeEdit::eventFilter(QObject * o, QEvent * e) {
return QWidget::eventFilter(o, e);
}
if (o == ui->textCode) {
//qDebug() << o << e;
//qDebug() << e;
QMetaObject::invokeMethod(this, "syncScrolls", Qt::QueuedConnection);
QKeyEvent * ke;
QChar kc(0);