chunkstream version fixedleaselication
git-svn-id: svn://db.shs.com.ru/libs@3 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -24,7 +24,13 @@ QCodeEdit::QCodeEdit(QWidget * parent): QWidget(parent) {
|
||||
completer.setHeaderHidden(true);
|
||||
completer.installEventFilter(this);
|
||||
completer.header()->setDefaultAlignment(Qt::AlignCenter);
|
||||
completer.header()->setResizeMode(QHeaderView::ResizeToContents);
|
||||
completer.header()->
|
||||
#if (QT_VERSION >= 0x050000)
|
||||
setSectionResizeMode
|
||||
#else
|
||||
setResizeMode
|
||||
#endif
|
||||
(QHeaderView::ResizeToContents);
|
||||
completer.header()->setStretchLastSection(true);
|
||||
//completer.setColumnWidth(0, 180);
|
||||
completer.resize(500, 200);
|
||||
@@ -129,8 +135,8 @@ bool QCodeEdit::matchWritten(QString s, QString w) {
|
||||
QChar wc(w[i].toLower());
|
||||
bool ns = false, bl = true;
|
||||
while (sp < s.size()) {
|
||||
if (ns || s[sp].toAscii() == '_') {
|
||||
if (s[sp].toAscii() == '_') {sp++; bl = false; continue;}
|
||||
if (ns || s[sp].toLatin1() == '_') {
|
||||
if (s[sp].toLatin1() == '_') {sp++; bl = false; continue;}
|
||||
if (s[sp].isLower() && bl) {sp++; continue;}
|
||||
if (s[sp].toLower() != wc) return false;
|
||||
}
|
||||
@@ -265,7 +271,7 @@ bool QCodeEdit::eventFilter(QObject * o, QEvent * e) {
|
||||
completer.hide();
|
||||
QMetaObject::invokeMethod(this, "invokeAutoCompletition", Qt::QueuedConnection, Q_ARG(bool, false));
|
||||
} else {
|
||||
if ((kc.isLetterOrNumber() || kc.toAscii() == '_') && completer.isVisible())
|
||||
if ((kc.isLetterOrNumber() || kc.toLatin1() == '_') && completer.isVisible())
|
||||
QMetaObject::invokeMethod(this, "invokeAutoCompletition", Qt::QueuedConnection, Q_ARG(bool, false));
|
||||
}
|
||||
break;
|
||||
@@ -694,7 +700,7 @@ void QCodeEdit::commitCompletition() {
|
||||
tc.movePosition(QTextCursor::Right, QTextCursor::KeepAnchor);
|
||||
}
|
||||
if (!tc.selectedText().isEmpty())
|
||||
if (tc.selectedText()[0].toAscii() == '(')
|
||||
if (tc.selectedText()[0].toLatin1() == '(')
|
||||
ins_br = false;
|
||||
}
|
||||
if (ins.contains("("))
|
||||
|
||||
Reference in New Issue
Block a user