Py学习  »  Python

如何将qml文件从V-Play转换为python?

U10-Forward • 5 年前 • 1576 次点击  

我有一个qml文件,如下所示(由 V-Play

import VPlayApps 1.0
import QtQuick 2.0

App {
    // You get free licenseKeys from https://v-play.net/licenseKey
    // With a licenseKey you can:
    //  * Publish your games & apps for the app stores
    //  * Remove the V-Play Splash Screen or set a custom one (available with the Pro Licenses)
    //  * Add plugins to monetize, analyze & improve your apps (available with the Pro Licenses)
    //licenseKey: "<generate one from https://v-play.net/licenseKey>"

    NavigationStack {

        Page {
            title: qsTr("My page")

        }

        AppTextField {
            id: appTextField
            x: 0
            y: 329
            width: 256
            height: 19
            anchors.centerIn: parent
        }

        AppTextField {
            id: appTextField1
            x: 0
            y: 329
            width: 256
            height: 19
            anchors.verticalCenterOffset: 50
            anchors.centerIn: parent
        }

        Text {
            id: text1
            x: 0
            y: 620
            width: 24
            height: 20
            text: qsTr("A")
            font.pixelSize: 25
            anchors.horizontalCenter: appTextField1.horizontalCenter
        }

        AppButton {
            id: button
            x: 0
            y: 575
            width: 24
            height: 20
            text: qsTr("Click me please!")
            anchors.horizontalCenter: appTextField1.horizontalCenter
        }
    }
}

我用Qt设计器创建了许多PyQt5应用程序,因此它将是一个.ui文件,我可以通过 pyuic5 ,但这是我第一次使用V-Play Qt Creator。

如何将其转换为python文件(.py),如您在代码中看到的,我创建了两个输入区域( AppTextField ),我希望它成为一个python文件,这样我就可以添加在输入区域中对数字进行相加的函数,我尝试了一些东西,但都没有成功,我查看了这个, Developing Python applications in Qt Creator ,还有一些,但他们没有达到我的目标。

我该怎么做呢?

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/54757
 
1576 次点击  
文章 [ 1 ]  |  最新文章 5 年前