Make Windows attached to the Mainwindow snap to Windows they get near and move the mainwindow accordingly

This commit is contained in:
Thomas Frauendorfer 2008-02-29 18:23:06 +01:00
parent 553138578d
commit 989d699372
3 changed files with 157 additions and 96 deletions

View file

@ -18,11 +18,16 @@
#define __BASEWINDOW_H__
#include <QMainWindow>
#include <QPoint>
#include <QMap>
class QMouseEvent;
class QPoint;
class MainWindow;
class BaseWindow;
typedef QMap<BaseWindow *, QPoint> AttachedWindowMap;
class BaseWindow : public QMainWindow {
Q_OBJECT
@ -37,7 +42,7 @@ class BaseWindow : public QMainWindow {
void mouseReleaseEvent (QMouseEvent *event);
void mouseMoveEvent (QMouseEvent *event);
QPoint snapWindow (QPoint pos, QWidgetList ignore = QWidgetList());
QPoint snapWindow (QPoint pos, AttachedWindowMap attached = AttachedWindowMap());
QPoint m_diff;
};