forked from qt-creator/qt-creator
Fix wrong context help if tool tip was not shown for focus widget
The tool tip never has focus, so it cannot become the IContext that is checked for context help. So, integrate the help id into Utils::ToolTip and check the tool tip first when checking for context help. As a side effect the [F1] button and help id for the tool tip is now also available for use outside of the text editors. Task-number: QTCREATORBUG-5345 Change-Id: Id975703caf161d1183c247e8ad8bb693b90fd306 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -56,7 +56,12 @@ public:
|
||||
virtual int showTime() const = 0;
|
||||
virtual void configure(const QPoint &pos, QWidget *w) = 0;
|
||||
virtual bool canHandleContentReplacement(int typeId) const = 0;
|
||||
virtual bool equals(int typeId, const QVariant &other) const = 0;
|
||||
virtual bool equals(int typeId, const QVariant &other, const QString &helpId) const = 0;
|
||||
virtual void setHelpId(const QString &id);
|
||||
virtual QString helpId() const;
|
||||
|
||||
private:
|
||||
QString m_helpId;
|
||||
};
|
||||
|
||||
class TextTip : public QTipLabel
|
||||
@@ -68,7 +73,7 @@ public:
|
||||
virtual void configure(const QPoint &pos, QWidget *w);
|
||||
virtual bool canHandleContentReplacement(int typeId) const;
|
||||
virtual int showTime() const;
|
||||
virtual bool equals(int typeId, const QVariant &other) const;
|
||||
virtual bool equals(int typeId, const QVariant &other, const QString &otherHelpId) const;
|
||||
virtual void paintEvent(QPaintEvent *event);
|
||||
virtual void resizeEvent(QResizeEvent *event);
|
||||
|
||||
@@ -85,7 +90,7 @@ public:
|
||||
virtual void configure(const QPoint &pos, QWidget *w);
|
||||
virtual bool canHandleContentReplacement(int typeId) const;
|
||||
virtual int showTime() const { return 4000; }
|
||||
virtual bool equals(int typeId, const QVariant &other) const;
|
||||
virtual bool equals(int typeId, const QVariant &other, const QString &otherHelpId) const;
|
||||
virtual void paintEvent(QPaintEvent *event);
|
||||
|
||||
private:
|
||||
@@ -105,7 +110,7 @@ public:
|
||||
virtual void configure(const QPoint &pos, QWidget *w);
|
||||
virtual bool canHandleContentReplacement(int typeId) const;
|
||||
virtual int showTime() const { return 30000; }
|
||||
virtual bool equals(int typeId, const QVariant &other) const;
|
||||
virtual bool equals(int typeId, const QVariant &other, const QString &otherHelpId) const;
|
||||
virtual bool isInteractive() const { return true; }
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user