-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
71 lines (55 loc) · 1.61 KB
/
Copy pathmainwindow.cpp
File metadata and controls
71 lines (55 loc) · 1.61 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include "mainwindow.h"
#include "qapplication.h"
#include "qstyle.h"
#include "qdesktopwidget.h"
#include "private/mainwindow_p.h"
namespace shelllet {
}
shelllet::frameless::MainWindow::MainWindow(QWidget* parent /*= nullptr*/, WindowTypeFlags flags /*= WindowFlags()*/)
: MainWindow(*new MainWindowPrivate, parent, flags)
{
}
void shelllet::frameless::MainWindow::moveToCentral()
{
// Q_D(FramelessWindow);
//QSize size = QApplication::primaryScreen()->availableSize() * 0.5;
//LOG_DEBUG(PROJECT_NAME) << "# geometry size: " << geometry() << std::endl;
setGeometry(QStyle::alignedRect(
Qt::LeftToRight,
Qt::AlignCenter,
geometry().size(),
qApp->desktop()->availableGeometry())); ;
}
void shelllet::frameless::MainWindow::setFixedHeight(int h)
{
Q_D(MainWindow);
d->fixedSize = SizePolicy::FixedHeigth;
__super::setFixedHeight(h);
}
void shelllet::frameless::MainWindow::setFixedWidth(int w)
{
Q_D(MainWindow);
d->fixedSize = SizePolicy::FixedWidth;
__super::setFixedWidth(w);
}
void shelllet::frameless::MainWindow::setFixedSize(const QSize& s)
{
Q_D(MainWindow);
d->fixedSize = SizePolicy::FixedAll;
__super::setFixedSize(s);
}
shelllet::frameless::SizePolicyFlags shelllet::frameless::MainWindow::fixedSizeTypes() const
{
Q_D(const MainWindow);
return d->fixedSize;
}
shelllet::frameless::MainWindow::MainWindow(MainWindowPrivate& d, QWidget* parent /*= nullptr*/, WindowTypeFlags flags /*= WindowFlags()*/)
: FramelessWindow(d, parent, flags)
{
}
void shelllet::frameless::MainWindow::setFixedSize(int w, int h)
{
Q_D(MainWindow);
d->fixedSize = SizePolicy::FixedAll;
__super::setFixedSize(w, h);
}