Created
February 26, 2020 18:45
-
-
Save alex-eri/cdf0a529d6745eef6b49cb20e684bd37 to your computer and use it in GitHub Desktop.
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
from PySide2.QtWidgets import QApplication | |
from PySide2.QtCore import QUrl | |
import os | |
import sys | |
from PySide2.QtQml import QQmlApplicationEngine | |
# sys.argv += ['--style', 'material'] | |
app = QApplication(sys.argv) | |
qml_file = os.path.join(os.path.dirname(__file__), "main.qml") | |
view =QQmlApplicationEngine(parent=app) | |
view.addImportPath(os.path.dirname(__file__)) | |
view.load(QUrl.fromLocalFile(os.path.abspath(qml_file))) | |
sys.exit(app.exec_()) |
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
import QtQuick 2.14 | |
import QtQuick.Controls 2.14 | |
import QtQuick.Layouts 1.3 | |
import Qt.labs.platform 1.1 as Platform | |
import QtQuick.Window 2.14 | |
import Qt.labs.settings 1.1 | |
import QtQuick.Controls.Material 2.14 | |
import QtGraphicalEffects 1.14 | |
import QtQuick.Dialogs 1.3 as Dialogs | |
ApplicationWindow { | |
flags: Qt.FramelessWindowHint | |
id: main | |
Dialogs.Dialog { | |
title: "Title" | |
id: dialog | |
visible: true | |
standardButtons: Dialog.Cancel | Dialog.Open | |
Label { | |
text: 'Text' | |
} | |
onAccepted: console.log("Ok clicked") | |
onRejected: console.log("Cancel clicked") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment