-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
46 lines (36 loc) · 1.14 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "mainwindow.h"
#include <QApplication>
#include <QDebug>
#include "anchors.h"
#include "dragwidget.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Anchors<MainWindow> w = new MainWindow;
w->resize(500, 500);
Anchors<DragWidget> ww = new DragWidget(w);
ww->setAutoFillBackground(true);
ww->resize(100, 100);
ww->setStyleSheet("QWidget{background-color:green;}");
ww->show();
Anchors<DragWidget> widget = new DragWidget(w);
widget->setStyleSheet("QWidget{background-color:red;}");
widget->resize(100, 100);
//ww.setBottom(w.bottom());
// ww.setBottomMargin(10);
//ww.setVerticalCenter(widget.bottom());
//ww.setTop(widget.bottom());
ww.setRight(widget.right());
//ww.setBottom(widget.bottom());
//ww.setTopMargin(-1);
//ww.setVerticalCenterOffset(10);
ww.setMargins(10);
ww.setTopMargin(5);
//ww->raise();
qDebug()<<ww.errorString();
//ww.setRightMargin(-1);
//ww.moveLeft(widget->rect().right());
//widget.setVerticalCenter(100, Qt::AnchorTop);
w->show();
return a.exec();
}