• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            Cpper
            C/C++高級工程師 Android高級軟件工程師 IT集成工程師 音頻工程師 熟悉c,c++,java,c#,py,js,asp等多種語言 程序猿
                auto box = new QVBoxLayout();
                qml = new QQuickWidget();
                setLayout(box);

                qml->setResizeMode(QQuickWidget::SizeRootObjectToView);
                qml->setClearColor(Qt::gray);

                QMLObjectInterface* face = new QMLObjectInterface(this);
                qml->engine()->rootContext()->setContextProperty("cplusplusObject",face);

                qml->setSource(QUrl("QML.qml"));
                foreach(auto error, qml->errors())
                    qDebug() << "error:" << error;

                auto object = qml->rootObject();
                object->setProperty("width",480);
               
                auto items = object->findChildren<QQuickItem*>("button");
               
                if (!items.isEmpty())
                    items[0]->setProperty("text",QStringLiteral("按鍵"));
             

                box->addWidget(qml);
            QML
            import QtQuick 2.11
            import QtQuick.Controls 2.1
            import QtQuick.Controls.Styles 1.4
            import QtQuick.Layouts 1.3
            import QtQuick.Window 2.11
            import "qmls" as QMLS
            import cplusplus 1.0

            Rectangle
            {
                id: base
                width:640
                height:480

                ColumnLayout
                {
                    anchors.fill:parent
                    anchors.margins: 6
                    spacing: 4

                    Rectangle
                    {
                        id:image
                        Layout.fillWidth: true
                        Layout.fillHeight: true
                        color:"#cdcdc0"

                        TextEdit
                        {
                            id:text
                            anchors.centerIn: parent
                            width:parent.width
                            text:"請點擊下方按鍵"
                            verticalAlignment: Text.AlignVCenter
                            horizontalAlignment: Text.AlignHCenter
                            wrapMode: Text.WordWrap
                            font.pointSize: 12
                        }
                    }

                    RowLayout
                    {
                        Rectangle
                        {
                            Layout.fillWidth: true
                        }

                        Button
                        {
                            id:button
                            property int index: 0
                            property string buttonText:"Click"
                            text:buttonText
                            objectName: "button"
                            onClicked:
                            {
                                text.text = cplusplusObject.getString()
                            }
                        }

                    }
                }
            }
            posted on 2019-08-15 09:40 ccsdu2009 閱讀(115) 評論(0)  編輯 收藏 引用 所屬分類: QT編程
             
            亚洲国产精品久久66| 欧美精品久久久久久久自慰| 99蜜桃臀久久久欧美精品网站| 久久播电影网| 亚洲国产精品狼友中文久久久 | 人妻无码久久一区二区三区免费| 亚洲欧美成人综合久久久 | 99久久精品国产麻豆| 国产精品一区二区久久精品无码| 久久99久国产麻精品66| 久久这里只有精品首页| 亚洲精品tv久久久久久久久| 久久久一本精品99久久精品88| 亚洲国产成人久久综合野外| 国产精品久久午夜夜伦鲁鲁| 久久久精品人妻一区二区三区四| 国产日韩久久久精品影院首页| 欧洲精品久久久av无码电影| 久久精品成人欧美大片| 久久香蕉国产线看观看乱码| 中文字幕精品久久| 精品免费久久久久国产一区| 久久久久无码精品国产| 久久天天躁夜夜躁狠狠躁2022| 精品久久国产一区二区三区香蕉 | 亚洲国产天堂久久综合网站| 亚洲精品国产字幕久久不卡| 久久人妻少妇嫩草AV无码蜜桃| 18岁日韩内射颜射午夜久久成人| 亚洲精品乱码久久久久久蜜桃不卡 | 伊人久久精品无码av一区 | 午夜不卡888久久| 韩国无遮挡三级久久| av午夜福利一片免费看久久 | 欧美麻豆久久久久久中文| 久久久国产精品| 精品综合久久久久久97超人| 国产精品久久波多野结衣| 精品久久香蕉国产线看观看亚洲| 久久香蕉超碰97国产精品| 人妻精品久久无码专区精东影业|