Make Windows attached to the Mainwindow snap to Windows they get near and move the mainwindow accordingly
This commit is contained in:
parent
553138578d
commit
989d699372
3 changed files with 157 additions and 96 deletions
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue