快速閱讀《QT5.9 c++開發指南》2
阿新 • • 發佈:2019-01-03
1、sample2_2 訊號和槽
MFC中最讓人印象深刻的就是“訊息對映”,這裡有理由相信,“
訊號和槽”是這種功能的發揚和擴充套件。通過簡單的
connect
(
ui
->
rBtnBlack
,
SIGNAL
(clicked()),
this
,
SLOT
(setTextFontColor()));
//訊號與槽的關聯
我們能夠實現很多事情,並且這裡提供了一個很好的管理工具。
功能比較完善。
2、sample 2_4 混合UI設計
這個介面相當不錯,最棒的地方在於提供了工具欄。實際上,這裡背面的是混合UI設計。
step1:新建空程式
step2:新建qrc檔案(資原始檔)
接著目錄就變成這樣:
將需要使用的圖示匯入進來,比較穩妥的方法是
先將圖片拷貝到專案目錄下:
然後新增同樣名稱的“字首”,並且匯入所有圖片。
step3:編寫動作
直接編輯Action Editor,它是有新建的
進行簡單設定,就可以使用
step4:設計選單和工具欄
在叫你輸入的地方進行輸入
並且可以將其拖過去
其實,QT的介面裡面預設提供了3個欄目
基本上就是夠用的了。
來自為知筆記(Wiz)
![](https://img2018.cnblogs.com/blog/508489/201901/508489-20190103212530668-52120854.png)
![](https://img2018.cnblogs.com/blog/508489/201901/508489-20190103212531021-129632217.png)
![](https://img2018.cnblogs.com/blog/508489/201901/508489-20190103212531284-363793216.png)
2、sample 2_4 混合UI設計
![](https://img2018.cnblogs.com/blog/508489/201901/508489-20190103212531906-71482666.png)
![](https://img2018.cnblogs.com/blog/508489/201901/508489-20190103212532197-965023996.png)
step2:新建qrc檔案(資原始檔)
![](https://img2018.cnblogs.com/blog/508489/201901/508489-20190103212532482-1351484506.png)
![](https://img2018.cnblogs.com/blog/508489/201901/508489-20190103212532699-1328303080.png)
![](https://img2018.cnblogs.com/blog/508489/201901/508489-20190103212533428-1846114333.png)
![](https://img2018.cnblogs.com/blog/508489/201901/508489-20190103212533797-1951440846.png)
![](https://img2018.cnblogs.com/blog/508489/201901/508489-20190103212534112-268555170.png)
![](https://img2018.cnblogs.com/blog/508489/201901/508489-20190103212534881-2110523824.png)
![](https://img2018.cnblogs.com/blog/508489/201901/508489-20190103212535422-1785534602.png)
![](https://img2018.cnblogs.com/blog/508489/201901/508489-20190103212535698-1082894801.png)
![](https://img2018.cnblogs.com/blog/508489/201901/508489-20190103212535950-1427940873.png)
![](https://img2018.cnblogs.com/blog/508489/201901/508489-20190103212536189-707837188.png)
來自為知筆記(Wiz)