git-svn-id: svn://db.shs.com.ru/libs@19 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -17,7 +17,7 @@ foreach(F ${PIP_FOLDERS})
|
|||||||
endforeach(F)
|
endforeach(F)
|
||||||
#message(STATUS "PIP includes = ${PIP_INCLUDES}")
|
#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})
|
foreach(L ${LIST_LIBS})
|
||||||
add_subdirectory(${L})
|
add_subdirectory(${L})
|
||||||
|
|||||||
@@ -15,8 +15,10 @@
|
|||||||
QCodeEdit::QCodeEdit(QWidget * parent): QWidget(parent) {
|
QCodeEdit::QCodeEdit(QWidget * parent): QWidget(parent) {
|
||||||
prev_lc = auto_comp_pl = -1;
|
prev_lc = auto_comp_pl = -1;
|
||||||
textCode = textLines = 0;
|
textCode = textLines = 0;
|
||||||
|
|
||||||
timer = 0;
|
timer = 0;
|
||||||
_ignore_focus_out = false;
|
_ignore_focus_out = false;
|
||||||
|
_first = true;
|
||||||
es_line.format.setBackground(QColor(240, 245, 240));
|
es_line.format.setBackground(QColor(240, 245, 240));
|
||||||
es_line.format.setProperty(QTextFormat::FullWidthSelection, true);
|
es_line.format.setProperty(QTextFormat::FullWidthSelection, true);
|
||||||
completer.setWindowFlags(Qt::Tool | Qt::FramelessWindowHint);
|
completer.setWindowFlags(Qt::Tool | Qt::FramelessWindowHint);
|
||||||
@@ -24,7 +26,6 @@ QCodeEdit::QCodeEdit(QWidget * parent): QWidget(parent) {
|
|||||||
completer.setColumnCount(2);
|
completer.setColumnCount(2);
|
||||||
completer.setRootIsDecorated(false);
|
completer.setRootIsDecorated(false);
|
||||||
completer.setHeaderHidden(true);
|
completer.setHeaderHidden(true);
|
||||||
completer.installEventFilter(this);
|
|
||||||
completer.header()->setDefaultAlignment(Qt::AlignCenter);
|
completer.header()->setDefaultAlignment(Qt::AlignCenter);
|
||||||
completer.header()->
|
completer.header()->
|
||||||
#if (QT_VERSION >= 0x050000)
|
#if (QT_VERSION >= 0x050000)
|
||||||
@@ -42,8 +43,6 @@ QCodeEdit::QCodeEdit(QWidget * parent): QWidget(parent) {
|
|||||||
textCode->setFrameShape(QFrame::NoFrame);
|
textCode->setFrameShape(QFrame::NoFrame);
|
||||||
textCode->setLineWrapMode(QPlainTextEdit::NoWrap);
|
textCode->setLineWrapMode(QPlainTextEdit::NoWrap);
|
||||||
textCode->setTabChangesFocus(false);
|
textCode->setTabChangesFocus(false);
|
||||||
textCode->installEventFilter(this);
|
|
||||||
textCode->viewport()->installEventFilter(this);
|
|
||||||
textLines->setFrameShadow(QFrame::Plain);
|
textLines->setFrameShadow(QFrame::Plain);
|
||||||
textLines->setFrameShape(QFrame::NoFrame);
|
textLines->setFrameShape(QFrame::NoFrame);
|
||||||
textLines->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
|
textLines->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
|
||||||
@@ -54,7 +53,6 @@ QCodeEdit::QCodeEdit(QWidget * parent): QWidget(parent) {
|
|||||||
textLines->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
textLines->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
textLines->viewport()->setAutoFillBackground(false);
|
textLines->viewport()->setAutoFillBackground(false);
|
||||||
textLines->viewport()->setCursor(Qt::ArrowCursor);
|
textLines->viewport()->setCursor(Qt::ArrowCursor);
|
||||||
textLines->viewport()->installEventFilter(this);
|
|
||||||
textLines->setFixedWidth(textLines->fontMetrics().width(" "));
|
textLines->setFixedWidth(textLines->fontMetrics().width(" "));
|
||||||
setLayout(new QBoxLayout(QBoxLayout::BottomToTop));
|
setLayout(new QBoxLayout(QBoxLayout::BottomToTop));
|
||||||
layout()->setContentsMargins(0, 0, 0, 0);
|
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 * ) {
|
void QCodeEdit::timerEvent(QTimerEvent * ) {
|
||||||
parse();
|
parse();
|
||||||
emit parseRequest();
|
emit parseRequest();
|
||||||
|
|||||||
@@ -71,9 +71,10 @@ private:
|
|||||||
QList<QTextEdit::ExtraSelection> es_selected, es_custom;
|
QList<QTextEdit::ExtraSelection> es_selected, es_custom;
|
||||||
QMap<int, ACClass> ac_classes;
|
QMap<int, ACClass> ac_classes;
|
||||||
int prev_lc, auto_comp_pl, timer;
|
int prev_lc, auto_comp_pl, timer;
|
||||||
bool spaces_, _ignore_focus_out;
|
bool spaces_, _ignore_focus_out, _first;
|
||||||
|
|
||||||
bool eventFilter(QObject * o, QEvent * e);
|
bool eventFilter(QObject * o, QEvent * e);
|
||||||
|
void showEvent(QShowEvent * );
|
||||||
void timerEvent(QTimerEvent * );
|
void timerEvent(QTimerEvent * );
|
||||||
void applyExtraSelection();
|
void applyExtraSelection();
|
||||||
void nextCompletition();
|
void nextCompletition();
|
||||||
|
|||||||
Reference in New Issue
Block a user