forked from qt-creator/qt-creator
QuickToolBar: do not show QuickToolBar as tooltip anymore.
Most users perceived this as a bug and found it annoying in practice. So this feature gets removed. Reviewed-by: Roberto Raggi
This commit is contained in:
@@ -84,7 +84,6 @@ enum {
|
||||
UPDATE_DOCUMENT_DEFAULT_INTERVAL = 100,
|
||||
UPDATE_USES_DEFAULT_INTERVAL = 150,
|
||||
UPDATE_OUTLINE_INTERVAL = 500, // msecs after new semantic info has been arrived / cursor has moved
|
||||
TOOLTIP_TIMER_INTERVAL = 1000 // delay after we show the Quick ToolBar after a tooltip
|
||||
};
|
||||
|
||||
using namespace QmlJS;
|
||||
@@ -680,7 +679,6 @@ QmlJSTextEditor::QmlJSTextEditor(QWidget *parent) :
|
||||
m_modelManager(0),
|
||||
m_contextPane(0),
|
||||
m_updateSelectedElements(false),
|
||||
m_toolTipPosition(0),
|
||||
m_findReferences(new FindReferences(this))
|
||||
{
|
||||
qRegisterMetaType<QmlJSEditor::Internal::SemanticInfo>("QmlJSEditor::Internal::SemanticInfo");
|
||||
@@ -728,11 +726,6 @@ QmlJSTextEditor::QmlJSTextEditor(QWidget *parent) :
|
||||
m_cursorPositionTimer->setSingleShot(true);
|
||||
connect(m_cursorPositionTimer, SIGNAL(timeout()), this, SLOT(updateCursorPositionNow()));
|
||||
|
||||
m_toolTipTimer = new QTimer(this);
|
||||
m_toolTipTimer->setInterval(TOOLTIP_TIMER_INTERVAL);
|
||||
m_toolTipTimer->setSingleShot(true);
|
||||
connect(m_toolTipTimer, SIGNAL(timeout()), this, SLOT(updateToolTipNow()));
|
||||
|
||||
baseTextDocument()->setSyntaxHighlighter(new Highlighter(document()));
|
||||
|
||||
m_modelManager = ExtensionSystem::PluginManager::instance()->getObject<ModelManagerInterface>();
|
||||
@@ -1476,40 +1469,6 @@ void QmlJSTextEditor::performQuickFix(int index)
|
||||
op->perform();
|
||||
}
|
||||
|
||||
void QmlJSTextEditor::onTooltipRequested(TextEditor::ITextEditor* /* editor */, QPoint /* point */, int position)
|
||||
{
|
||||
m_toolTipPosition = position;
|
||||
if (m_contextPane) {
|
||||
m_toolTipTimer->start();
|
||||
}
|
||||
}
|
||||
|
||||
void QmlJSTextEditor::updateToolTipNow()
|
||||
{
|
||||
if (!TextEditor::ToolTip::instance()->isVisible())
|
||||
return;
|
||||
|
||||
if (m_contextPane && m_semanticInfo.isValid()) {
|
||||
Node *newNode = m_semanticInfo.declaringMemberNoProperties(m_toolTipPosition);
|
||||
if (m_contextPane->isAvailable(editableInterface(), m_semanticInfo.lookupContext(), newNode)) {
|
||||
if (UiQualifiedId *q = qualifiedTypeNameId(newNode)) {
|
||||
const int start = q->identifierToken.begin();
|
||||
for (; q; q = q->next) {
|
||||
if (! q->next) {
|
||||
const int end = q->identifierToken.end();
|
||||
if (m_toolTipPosition >= start && m_toolTipPosition <= end) {
|
||||
m_contextPane->apply(editableInterface(), m_semanticInfo.lookupContext(), newNode, false, true);
|
||||
m_oldCursorPosition = m_toolTipPosition;
|
||||
QList<TextEditor::Internal::RefactorMarker> markers;
|
||||
setRefactorMarkers(markers);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QmlJSTextEditor::contextMenuEvent(QContextMenuEvent *e)
|
||||
{
|
||||
QMenu *menu = new QMenu();
|
||||
|
||||
Reference in New Issue
Block a user