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

This commit is contained in:
2018-03-19 09:20:34 +00:00
parent d15c84e686
commit 60a3439550
2 changed files with 4 additions and 3 deletions

View File

@@ -101,6 +101,7 @@ QCodeEdit::QCodeEdit(QWidget * parent): QWidget(parent) {
connect(completer, SIGNAL(itemDoubleClicked(QTreeWidgetItem * ,int)), this, SLOT(commitCompletition()));
connect(ui->textCode->verticalScrollBar(), SIGNAL(valueChanged(int)), ui->textLines->verticalScrollBar(), SLOT(setValue(int)));
connect(ui->textCode->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(hideHelp()));
connect(ui->textCode, SIGNAL(textChanged()), this, SLOT(textEdit_textChanged()));
connect(ui->textCode, SIGNAL(textChanged()), this, SIGNAL(textChanged()));
connect(ui->textCode, SIGNAL(cursorPositionChanged()), this, SLOT(textEdit_cursorPositionChanged()));
@@ -643,7 +644,7 @@ void QCodeEdit::search_triggered() {
void QCodeEdit::syncScrolls() {
ui->textLines->verticalScrollBar()->setValue(ui->textCode->verticalScrollBar()->value());
ui->textLines->setHorizontalScrollBarPolicy(ui->textCode->horizontalScrollBar()->isVisible() ? Qt::ScrollBarAlwaysOn : Qt::ScrollBarAlwaysOff);
hideHelp();
//qDebug() << "!!!";
}
@@ -943,7 +944,6 @@ QString QCodeEdit::selectArg(QString s, int arg) {
void QCodeEdit::raiseHelp(QTextCursor tc, int arg) {
bool ok;
QPair<QStringList, QString> scope = getScope(tc, &ok);
//qDebug() << "help" << scope;
QString st = tc.selectedText();
if (arg >= 0) st = scope.second;
if (!ok || st.isEmpty()) {
@@ -980,6 +980,7 @@ void QCodeEdit::raiseHelp(QTextCursor tc, int arg) {
hideHelp();
return;
}
//qDebug() << "help found" << tc.selectionStart() << tc.selectionEnd();
es_cursor.cursor = tc;
applyExtraSelection();
//tc.movePosition(QTextCursor::StartOfWord, QTextCursor::MoveAnchor);