X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/e2b844437e9308a04ddf043ae9d2f5c8ffef97b0..c8d8556950005dfd96ebdb41d2f43ad90356367c:/src/views/tooltips/tooltipmanager.h diff --git a/src/views/tooltips/tooltipmanager.h b/src/views/tooltips/tooltipmanager.h index f8bcd3dfd..b13641109 100644 --- a/src/views/tooltips/tooltipmanager.h +++ b/src/views/tooltips/tooltipmanager.h @@ -44,23 +44,23 @@ class ToolTipManager : public QObject Q_OBJECT public: - explicit ToolTipManager(QAbstractItemView* parent, - DolphinSortFilterProxyModel* model); + explicit ToolTipManager(QWidget* parent); virtual ~ToolTipManager(); -public slots: /** - * Hides the currently shown tooltip. Invoking this method is - * only needed when the tooltip should be hidden although - * an item is hovered. + * Triggers the showing of the tooltip for the item \p item + * where the item has the maximum boundaries of \p itemRect. + * The tooltip manager takes care that the tooltip is shown + * slightly delayed. */ - void hideToolTip(); + void showToolTip(const KFileItem& item, const QRectF& itemRect); -protected: - virtual bool eventFilter(QObject* watched, QEvent* event); + /** + * Hides the currently shown tooltip. + */ + void hideToolTip(); private slots: - void requestToolTip(const QModelIndex& index); void startContentRetrieval(); void setPreviewPix(const KFileItem& item, const QPixmap& pix); void previewFailed(); @@ -68,9 +68,10 @@ private slots: void showToolTip(); private: - QAbstractItemView* m_view; - DolphinModel* m_dolphinModel; - DolphinSortFilterProxyModel* m_proxyModel; + int toolTipMargin() const; + +private: + QWidget* m_parentWidget; /// Timeout from requesting a tooltip until the tooltip /// should be shown