Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manually translated boilerplate main.cpp to PyQt5-friendly main.py
- Loading branch information
1 parent
15dcfd5
commit 0afc467
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import sys | ||
|
||
from PyQt5.QtCore import QCoreApplication, Qt, QUrl | ||
from PyQt5.QtGui import QGuiApplication | ||
from PyQt5.QtQml import QQmlApplicationEngine | ||
|
||
def main(): | ||
QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling) | ||
|
||
global app | ||
app = QGuiApplication(sys.argv) | ||
|
||
engine = QQmlApplicationEngine() | ||
engine.load(QUrl('main.qml')) | ||
if not engine.rootObjects(): | ||
return -1 | ||
|
||
app.exec_() | ||
|
||
if __name__ == '__main__': | ||
main() |