From 7e0abc7cde4a9c02fabc27cc2b6506bd41f0588d Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 23 Oct 2010 15:09:49 +0200 Subject: Fix hover issues Hopefully this commit fixes all issues with hovering over items. First, only use QCursor::pos() to determine the position of the hover window and fix position calculation accordingly. For that SmGlobals now return a QSize of the actual cursor size. Introduced a hoverOffeset to HoverWindow defaulting to SmGlobals::cursorSize() + 30 to prevent a HoverLeave event on showing the HoverWindow. Also fixed Qt::WindowFlags of HoverWindow. We don't want the HoverWindow to show in the taskbar or get sent to background when clicking on an item. --- smglobals.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'smglobals.h') diff --git a/smglobals.h b/smglobals.h index e1683ee..06d7b43 100644 --- a/smglobals.h +++ b/smglobals.h @@ -9,6 +9,7 @@ #define SMUBERMODELSINGLETON_H #include +#include class QAbstractItemModel; class PictureViewer; @@ -20,7 +21,7 @@ class SmGlobals : public QObject { static SmGlobals *instance(); QAbstractItemModel *model(const QString &which); PictureViewer *pictureViewer(); - int cursorOffset(); + QSize cursorSize(); private: SmGlobals(); @@ -29,7 +30,7 @@ class SmGlobals : public QObject { static SmGlobals *mInstance; QHash mModels; PictureViewer *mPictureViewer; - int mCursorOffset; + QSize mCursorSize; }; #endif -- cgit v1.2.3-70-g09d2