Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4657158

Browse files
committed
Added Qt Quick folder
1 parent 7e0fef8 commit 4657158

File tree

4 files changed

+54
-0
lines changed

4 files changed

+54
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# QtQML/QQmlApplicationEngine
2+
import sys
3+
4+
from PyQt5.QtGui import QGuiApplication
5+
from PyQt5.QtQml import QQmlApplicationEngine
6+
7+
app = QGuiApplication(sys.argv)
8+
engine = QQmlApplicationEngine()
9+
engine.quit.connect(app.quit)
10+
engine.load("Sample_QML.qml")
11+
sys.exit(app.exec_())
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# QtQuick/QQuickView
2+
import sys
3+
4+
# from PyQt5.QtWidgets import QApplication
5+
from PyQt5.QtCore import QUrl
6+
from PyQt5.QtQuick import QQuickView
7+
from PyQt5.QtGui import QGuiApplication
8+
9+
if __name__ == "__main__":
10+
app = QGuiApplication(sys.argv)
11+
view = QQuickView()
12+
view.setSource(QUrl.fromLocalFile("Sample_QML.qml"))
13+
view.show()
14+
sys.exit(app.exec_())
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# QtQuickWidgets/QQuickWidget
2+
import sys
3+
4+
from PyQt5.QtWidgets import QApplication
5+
from PyQt5.QtCore import QUrl
6+
from PyQt5.QtQuickWidgets import QQuickWidget
7+
8+
if __name__ == "__main__":
9+
app = QApplication(sys.argv)
10+
view = QQuickWidget()
11+
view.setSource(QUrl("Sample_QML.qml"))
12+
view.show()
13+
sys.exit(app.exec_())

‎Qt Quick/Hello world!/Sample_QML.qml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import QtQuick 2.15
2+
import QtQuick.Controls 2.15
3+
4+
ApplicationWindow {
5+
visible: true
6+
width: 600
7+
height: 500
8+
title: "HelloApp"
9+
10+
Text {
11+
anchors.centerIn: parent
12+
text: "Hello World"
13+
font.pixelSize: 24
14+
}
15+
16+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /