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

This commit is contained in:
2015-05-27 16:26:16 +00:00
parent 5246b56958
commit 52316d9af5
3 changed files with 15 additions and 6 deletions

View File

@@ -17,7 +17,7 @@ foreach(F ${PIP_FOLDERS})
endforeach(F)
#message(STATUS "PIP includes = ${PIP_INCLUDES}")
set(LIST_LIBS pip qad_widgets qad_utils qad_application qad_blockview qad_graphic qad_sql_table piqt mbricks kx_tools piqt_tools qglview touch_widgets)
set(LIST_LIBS pip qad_widgets qad_utils qad_application qad_blockview qad_graphic qad_sql_table piqt mbricks kx_tools piqt_tools touch_widgets)
foreach(L ${LIST_LIBS})
add_subdirectory(${L})

View File

@@ -15,8 +15,10 @@
QCodeEdit::QCodeEdit(QWidget * parent): QWidget(parent) {
prev_lc = auto_comp_pl = -1;
textCode = textLines = 0;
timer = 0;
_ignore_focus_out = false;
_first = true;
es_line.format.setBackground(QColor(240, 245, 240));
es_line.format.setProperty(QTextFormat::FullWidthSelection, true);
completer.setWindowFlags(Qt::Tool | Qt::FramelessWindowHint);
@@ -24,7 +26,6 @@ QCodeEdit::QCodeEdit(QWidget * parent): QWidget(parent) {
completer.setColumnCount(2);
completer.setRootIsDecorated(false);
completer.setHeaderHidden(true);
completer.installEventFilter(this);
completer.header()->setDefaultAlignment(Qt::AlignCenter);
completer.header()->
#if (QT_VERSION >= 0x050000)
@@ -42,8 +43,6 @@ QCodeEdit::QCodeEdit(QWidget * parent): QWidget(parent) {
textCode->setFrameShape(QFrame::NoFrame);
textCode->setLineWrapMode(QPlainTextEdit::NoWrap);
textCode->setTabChangesFocus(false);
textCode->installEventFilter(this);
textCode->viewport()->installEventFilter(this);
textLines->setFrameShadow(QFrame::Plain);
textLines->setFrameShape(QFrame::NoFrame);
textLines->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
@@ -54,7 +53,6 @@ QCodeEdit::QCodeEdit(QWidget * parent): QWidget(parent) {
textLines->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
textLines->viewport()->setAutoFillBackground(false);
textLines->viewport()->setCursor(Qt::ArrowCursor);
textLines->viewport()->installEventFilter(this);
textLines->setFixedWidth(textLines->fontMetrics().width(" "));
setLayout(new QBoxLayout(QBoxLayout::BottomToTop));
layout()->setContentsMargins(0, 0, 0, 0);
@@ -311,6 +309,16 @@ bool QCodeEdit::eventFilter(QObject * o, QEvent * e) {
}
void QCodeEdit::showEvent(QShowEvent * ) {
if (!_first) return;
_first = false;
completer.installEventFilter(this);
textCode->installEventFilter(this);
textCode->viewport()->installEventFilter(this);
textLines->viewport()->installEventFilter(this);
}
void QCodeEdit::timerEvent(QTimerEvent * ) {
parse();
emit parseRequest();

View File

@@ -71,9 +71,10 @@ private:
QList<QTextEdit::ExtraSelection> es_selected, es_custom;
QMap<int, ACClass> ac_classes;
int prev_lc, auto_comp_pl, timer;
bool spaces_, _ignore_focus_out;
bool spaces_, _ignore_focus_out, _first;
bool eventFilter(QObject * o, QEvent * e);
void showEvent(QShowEvent * );
void timerEvent(QTimerEvent * );
void applyExtraSelection();
void nextCompletition();