Version 1.13.0
This commit is contained in:
@@ -65,6 +65,7 @@ void QCodeEditCompleter::addItems(QFont f, const QCodeEdit::ACClass & cl, const
|
||||
ni->setIcon(0, cl.icon);
|
||||
ni->setText(0, s.type);
|
||||
ni->setText(1, s.name);
|
||||
ni->setData(0, Qt::UserRole, s.help_href);
|
||||
addTopLevelItem(ni);
|
||||
}
|
||||
}
|
||||
@@ -95,6 +96,26 @@ QString QCodeEditCompleter::currentValue() const {
|
||||
}
|
||||
|
||||
|
||||
void QCodeEditCompleter::keyPressEvent(QKeyEvent * e) {
|
||||
switch (e->key()) {
|
||||
case Qt::Key_Escape:
|
||||
hide();
|
||||
break;
|
||||
case Qt::Key_Return:
|
||||
emit commit();
|
||||
break;
|
||||
case Qt::Key_F1:
|
||||
if (currentItem()) {
|
||||
QString href = currentItem()->data(0, Qt::UserRole).toString();
|
||||
emit gotoHRef(QCodeEdit::ACEntry().addHelpHRef(href));
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
QTreeWidget::keyPressEvent(e);
|
||||
}
|
||||
|
||||
|
||||
void QCodeEditCompleter::adjust() {
|
||||
int sz = sizeHint().width();
|
||||
resize(sz, fontHeight() * 16);
|
||||
|
||||
Reference in New Issue
Block a user