-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathmain.cpp
29 lines (23 loc) · 832 Bytes
/
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
#include <QFile>
#include "MainWindow.h"
int main( int argc, char *argv[] ) {
QApplication application( argc, argv );
// Stylesheet
QFile stylesheet( ":/SystemMenu/BorderlessWindow.css" );
if ( stylesheet.open( QFile::ReadOnly ) ) {
QString styleSheet = stylesheet.readAll();
application.setStyleSheet( styleSheet );
}
// Font
QFont mainFont = application.font();
mainFont.setStyleStrategy( QFont::PreferAntialias );
application.setFont( mainFont );
// Background color
// This is only for WinApi window, Qt widgets use BorderlessWindow.css stylesheet
HBRUSH windowBackground = CreateSolidBrush( RGB( 255, 255, 255 ) );
// Create window
BorderlessWindow window( &application, windowBackground, 100, 100, 1024, 768 );
window.setMinimumSize( 800, 600 );
// Launch
application.exec();
}