C++ 入門指南 4.01
encryptor_gui_demo/main.qml
import QtQuick import QtQuick.Controls ApplicationWindow { id: root width: 350 height: 120 visible: true title: qsTr("編密碼小工具") Column { Row { width: 350 height: 25 Text { width: 50 horizontalAlignment: Text.AlignRight text: qsTr("輸入:") } TextField { id: input width: 300 color: "blue" placeholderText: qsTr("輸入英文句子") text: "" } } Row { width: 350 height: 25 Text { width: 50 horizontalAlignment: Text.AlignRight text: qsTr("輸出:") } TextField { id: output width: 300 color: "red" placeholderText: qsTr("這裡顯示編碼結果") readOnly: true text: "" } } Row { width: 350 height: 35 Button { id: newButton width: 50 text: qsTr("新建") onClicked: { display.text = qsTr("新建按鈕") } } Button { width: 50 text: qsTr("存檔") onClicked: { display.text = qsTr("存檔按鈕") } } Button { width: 50 text: qsTr("載入") onClicked: { display.text = qsTr("載入按鈕") } } Button { width: 50 text: "編碼" onClicked: { display.text = "編碼按鈕" } } Button { width: 50 text: qsTr("解碼") onClicked: { display.text = qsTr("解碼按鈕") } } Button { width: 50 text: qsTr("清除") onClicked: { display.text = qsTr("清除按鈕") } } Button { width: 50 text: qsTr("拷貝") onClicked: { display.text = qsTr("拷貝按鈕") } } } Row { width: 350 height: 50 Text { id: display width: 350 text: qsTr("提示訊息") } } } } /* 《程式語言教學誌》的範例程式 http://kaiching.org/ 檔名:main.qml 功能:示範 Encrypt 類別的 GUI 外觀 作者:張凱慶 */
相關教學影片