]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/tooltips/tooltipmanager.h
Fix style-issues in items when not using Oxygen
[dolphin.git] / src / views / tooltips / tooltipmanager.h
index f8bcd3dfdb256e8ac4a7126e7b192d03c98426a9..b13641109f67970f26c9d49ca9524ea025ab9ddb 100644 (file)
@@ -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