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:
@@ -75,9 +75,12 @@ public:
|
||||
|
||||
static ToolTip *instance();
|
||||
|
||||
static void show(const QPoint &pos, const QString &content, QWidget *w = 0, const QRect &rect = QRect());
|
||||
static void show(const QPoint &pos, const QColor &color, QWidget *w = 0, const QRect &rect = QRect());
|
||||
static void show(const QPoint &pos, QWidget *content, QWidget *w = 0, const QRect &rect = QRect());
|
||||
static void show(const QPoint &pos, const QString &content, QWidget *w = 0,
|
||||
const QString &helpId = QString(), const QRect &rect = QRect());
|
||||
static void show(const QPoint &pos, const QColor &color, QWidget *w = 0,
|
||||
const QString &helpId = QString(), const QRect &rect = QRect());
|
||||
static void show(const QPoint &pos, QWidget *content, QWidget *w = 0,
|
||||
const QString &helpId = QString(), const QRect &rect = QRect());
|
||||
static void move(const QPoint &pos, QWidget *w);
|
||||
static void hide();
|
||||
static bool isVisible();
|
||||
@@ -88,12 +91,21 @@ public:
|
||||
// using WidgetContent
|
||||
static bool pinToolTip(QWidget *w, QWidget *parent);
|
||||
|
||||
static QString contextHelpId();
|
||||
|
||||
signals:
|
||||
void shown();
|
||||
void hidden();
|
||||
|
||||
private:
|
||||
void showInternal(const QPoint &pos, const QVariant &content, int typeId, QWidget *w, const QRect &rect);
|
||||
void showInternal(const QPoint &pos, const QVariant &content, int typeId, QWidget *w,
|
||||
const QString &helpId, const QRect &rect);
|
||||
void hideTipImmediately();
|
||||
bool acceptShow(const QVariant &content, int typeId, const QPoint &pos, QWidget *w, const QRect &rect);
|
||||
bool acceptShow(const QVariant &content, int typeId, const QPoint &pos, QWidget *w,
|
||||
const QString &helpId, const QRect &rect);
|
||||
void setUp(const QPoint &pos, QWidget *w, const QRect &rect);
|
||||
bool tipChanged(const QPoint &pos, const QVariant &content, int typeId, QWidget *w) const;
|
||||
bool tipChanged(const QPoint &pos, const QVariant &content, int typeId, QWidget *w,
|
||||
const QString &helpId) const;
|
||||
void setTipRect(QWidget *w, const QRect &rect);
|
||||
void placeTip(const QPoint &pos, QWidget *w);
|
||||
void showTip();
|
||||
@@ -104,6 +116,7 @@ private:
|
||||
QRect m_rect;
|
||||
QTimer m_showTimer;
|
||||
QTimer m_hideDelayTimer;
|
||||
QString m_helpId;
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
|
||||
Reference in New Issue
Block a user