diff --git a/src/libs/utils/tooltip/tooltip.cpp b/src/libs/utils/tooltip/tooltip.cpp index de3c536c5fe..b4735c25eec 100644 --- a/src/libs/utils/tooltip/tooltip.cpp +++ b/src/libs/utils/tooltip/tooltip.cpp @@ -263,6 +263,7 @@ void ToolTip::showInternal(const QPoint &pos, const QVariant &content, m_tip = new WidgetTip(target); break; } + m_tip->setObjectName("qcToolTip"); m_tip->setContent(content); m_tip->setContextHelp(contextHelp); setUp(pos, w, rect); diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py index 87c51a523c5..a6cf0cea4cb 100644 --- a/tests/system/shared/editor_utils.py +++ b/tests/system/shared/editor_utils.py @@ -147,7 +147,7 @@ def verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, e for ty in additionalKeyPresses: type(editor, ty) rect = editor.cursorRect(editor.textCursor()) - expectedToolTip = "{type='QTipLabel' visible='1'}" + expectedToolTip = "{type='QLabel' objectName='qcToolTip' visible='1'}" # wait for similar tooltips to disappear checkIfObjectExists(expectedToolTip, False, 1000, True) sendEvent("QMouseEvent", editor, QEvent.MouseMove, rect.x+rect.width/2, rect.y+rect.height/2, Qt.NoButton, 0) diff --git a/tests/system/suite_editors/tst_qml_editor/test.py b/tests/system/suite_editors/tst_qml_editor/test.py index e43545a5541..c66c8b8bbad 100644 --- a/tests/system/suite_editors/tst_qml_editor/test.py +++ b/tests/system/suite_editors/tst_qml_editor/test.py @@ -124,10 +124,10 @@ def testHovering(): additionalKeyPresses = [home, ""] expectedTypes = ["TextTip", "TextTip"] expectedValues = [ - {'text':'
FocusScope\n

Explicitly ' - 'creates a focus scope

  
'}, - {'text':'
Rectangle\n

Paints a filled rectangle with an ' - 'optional border

  
'} + {'text':'

FocusScope


\n

Explicitly ' + 'creates a focus scope

  
'}, + {'text':'

Rectangle


\n

Paints a filled rectangle with an ' + 'optional border

  
'} ] alternativeValues = [{"text":"FocusScope"}, {"text":"Rectangle"}] verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, expectedValues, alternativeValues) @@ -137,23 +137,26 @@ def testHovering(): lines = ['focus:\s*true', 'color:\s*"black"', 'states:\s*State\s*\{', 'transitions:\s*Transition\s*\{'] expectedTypes = ["TextTip", "TextTip", "TextTip", "TextTip"] expectedValues = [ - {'text':'
boolean

This property indicates whether the item has focus ' + {'text':'

boolean


This property indicates whether the item has focus ' 'within the enclosing focus scope. If true, this item will gain active focus when the enclosing ' 'focus scope gains active focus. In the following example, input will be given active focus ' - 'when scope gains active focus.

  scope gains active focus.

  
'}, - {'text':'
string

This property holds the color used to fill the rectangle.' - '

  
'}, - {'text':'
State

This property holds the list of possible states for this item. ' + {'text':'

string


This property holds the color used to fill the rectangle.' + '

  
'}, + {'text':'

State


This property holds the list of possible states for this item. ' 'To change the state of this item, set the state property to one of these states, or set the state property ' 'to an empty string to revert the item to its default state.' - '

  
'}, - {'text':'
Transition

This property holds the list of transitions for this item. ' + '

  
'}, + {'text':'

Transition


This property holds the list of transitions for this item. ' 'These define the transitions to be applied to the item whenever it changes its state.' - '

  
'} + '

  
'} ] - alternativeValues = [{"text":"Rectangle" if JIRA.isBugStillOpen(20020) else "boolean"}, - {"text":"string"}, {"text":"State"}, {"text":"Transition"}] + alternativeValues = [{"text":"boolean"}, {"text":"string"}, {"text":"State"}, {"text":"Transition"}] + if JIRA.isBugStillOpen(20020): + expectedValues[0] = {'text':'
Rectangle  ' + '
'} + alternativeValues[0] = {"text":"Rectangle"} verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, expectedValues, alternativeValues) test.log("Testing hovering expressions") openDocument(focusDocumentPath % "focus\\.qml") @@ -169,7 +172,7 @@ def testHovering(): lines=['Rectangle\s*\{.*color:\s*"#D1DBBD"', 'NumberAnimation\s*\{\s*.*Easing.OutQuint\s*\}'] additionalKeyPresses = ["", "", "", ""] expectedTypes = ["ColorTip", "TextTip"] - expectedValues = ["#D1DBBD", {"text":"number"}] + expectedValues = ["#D1DBBD", {"text":'
number  
'}] alternativeValues = ["#D6DBBD", None] verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, expectedValues, alternativeValues)