
首先開啟 encryptwindow.ui ,專案中副檔名為 .ui 的檔案

這樣就會跳到〔設計〕頁面,從左至右分成三欄,左邊的為小工具區,中間則是編輯視窗區,右邊的則是類別及資料成員區

先看到中間的視窗編輯區,游標移到視窗最上方點擊滑鼠右鍵出現快顯選單

最上方是「選單列」,所以快顯選單有「移除選單列」的選項,下面為「工具列」

這裡點擊「移除工具列」,然後也移除最下方的「狀態列」,就只有保留「選單列」

由邊緣六個藍色正方形可以拖曳視窗大小,我們把視窗拖曳成長方形

接著從左邊的小工具區拖曳小工具到視窗上,首先用滑鼠持續按住 Label ,移動游標到編輯視窗到左上方,然後放開滑鼠左鍵

這樣小工具就放到編輯視窗上了,預設的文字為 TextLabel

快速的對 TextLabel 點兩下,就可以直接修改 Label 的文字

我們把 TextLabel 改成 Input: ,然後往右下方的資料成員區找到 alignment 的水平,將原本預設的「置左對齊」改成「置右對齊」

結果如下圖

再拉兩個 Label 、兩個 Line Edit 、七個 Push Button 到編輯視窗,位置、文字等調整如下,然後看到右邊的類別區

EncryptWindow 資料成員的預設名稱本來是小工具名稱及數字,這裡我們把數字改成相對應的文字,例如 Input: 原本是 label ,改成 label_input ,修改完成如下圖

the end
沒有留言:
張貼留言