QT 學習錯誤總結
1、 cannot open *** file 可能是沒有關掉剛剛執行的視窗
2、 ** dose not name a type 可能是沒有包含標頭檔案
3、 視窗一閃而過
4、 QT登入視窗呼叫主視窗一閃而過有關問題
www.MyException.Cn 釋出於:2012-11-1110:07:57 瀏覽:72次
QT登入視窗呼叫主視窗一閃而過問題
原始碼:
//如果登入成功
{
index mainForm;
mainForm.show();
this->hide();
}
主視窗一閃而過
修改為:
//如果登入成功
{
index mainForm = new inde();
mainForm.show();
this->hide();
}
程式報錯
修改為:
/如果登入成功
{
index *mainForm;
mainForm = new index();
mainForm->show();
this->hide();
}
成功顯示主視窗。
總結:
index mainForm;
mainForm.show();
mainForm建立在stack上,生命期是大括號內
index *mainForm;
mainForm = new index();
mainForm 通過new建立在heap上,在程式退出時才會被析構
5、 connect
connect(enterBtn,SIGNAL(QPushButton::clicked()),this,SLOT(newmain()));這句話錯了,應該是connect(enterBtn,SIGNAL(clicked()),this,SLOT(newmain()));
相關文章
- Polar mask錯誤總結
- Python部分錯誤總結Python
- Hadoop安裝錯誤總結Hadoop
- 2024.11.12-2024.11.13錯誤總結
- spring 快取 @Cacheable 錯誤總結Spring快取
- 對MediaPlayer的錯誤使用總結
- Shell:常見錯誤總結(一)
- 機器學習實驗出錯總結機器學習
- 從錯誤中學習
- 應用程式邏輯錯誤總結
- Select2.js錯誤點總結JS
- 學習Rust 錯誤處理Rust
- 學習總結
- Qt 錯誤記錄registered using qRegisterMetaType().QT
- Harbor企業級倉庫錯誤總結
- PbootCMS網站常見錯誤提示總結boot網站
- hadoop(二)—hadoop配置、執行錯誤總結Hadoop
- 深度學習/計算機視覺常見的8個錯誤總結及避坑指南深度學習計算機視覺
- ConstraintLayout 學習總結AI
- BOM學習總結
- tkinter學習總結
- vue學習總結Vue
- HSF學習總結
- ElasticSearch 學習總結Elasticsearch
- Storm學習總結ORM
- vue 學習總結Vue
- lua 學習總結
- Angularjs 學習總結AngularJS
- WebRTC學習總結Web
- GCD 學習總結GC
- CompletableFuture學習總結
- awk 學習總結
- MyBatis 學習總結MyBatis
- Maven學習總結Maven
- Ajax學習總結
- JVM學習總結JVM
- mysqlimport學習總結MySqlImport
- WorkFlow學習總結
- JNI 學習總結