pqImageTip.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 
5 #ifndef pqImageTip_h
6 #define pqImageTip_h
7 
8 #include "pqComponentsModule.h"
9 #include <QLabel>
10 #include <QtGlobal>
11 
12 class QBasicTimer;
13 class QPixmap;
14 class QPoint;
15 
19 class PQCOMPONENTS_EXPORT pqImageTip : public QLabel
20 {
21  Q_OBJECT
22 
23 public:
27  static void showTip(const QPixmap& image, const QPoint& pos);
28 
29 private:
30  pqImageTip(const QPixmap& image, QWidget* parent);
31  ~pqImageTip() override;
32 
33  QBasicTimer* const hideTimer;
34 
35  bool eventFilter(QObject*, QEvent*) override;
36 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
37  void enterEvent(QEvent*) override;
38 #else
39  void enterEvent(QEnterEvent*) override;
40 #endif
41  void timerEvent(QTimerEvent* e) override;
42  void paintEvent(QPaintEvent* e) override;
43 };
44 
45 #endif
#define PQCOMPONENTS_EXPORT
Provides tooltip-like behavior, but displays an image instead of text.
Definition: pqImageTip.h:19
image