發表文章

目前顯示的是有「qt」標籤的文章

Qt, QPointer vs QScopedPointer

QScopedPointer 當scope失效,自動delete物件 http://doc.qt.io/qt-5/qscopedpointer.html QPointer 只是個weak pointer,讓你檢查別人擁有的物件是否還有效 http://doc.qt.io/qt-5/qpointer.html OBS誤用了 QPointer,其實應該用QScopedPointer,所以造成一些memory leak

Qt style note

暫存區,還會修改 QWidget. setStyle() 不會拿ownership,要用setParent()才會一起清掉 我修正OBS一個memory leak ? QString styleName = slider->style()->objectName(); QStyle *style; style = QStyleFactory::create(styleName); if (!style) {     style = new SliderAbsoluteSetStyle(); } else {     style = new SliderAbsoluteSetStyle(style); } style->setParent(slider); slider->setStyle(style);

Qt debug

CDE install from windows sdk (no option in visualstudio2017 installer, 2018/1/23) https://developercommunity.visualstudio.com/content/problem/127056/cdb-in-visual-studio-build-tools.html https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/ Qt defines QT_NO_DEBUG for release builds. Otherwise QT_DEBUG is defined.

Qt and VS2017 32bit

圖片
據說VS2015 VS2017 ABI相容,所以Qt似乎不打算令外出2017的 要產生VS2017 32bit build Qt Creator內要改設定才能用到2015 要設定2017的compiler (應該要能自動抓才對?) AppVeyor的狀況 (目前還沒把 msvc2015放進VS2017的image,沒得用) Build started cd C:\Qt\5.9 dir Volume in drive C has no label. Volume Serial Number is 1CB8-D4AA Directory of C:\Qt\5.9 07/04/2017 01:52 PM <DIR> . 07/04/2017 01:52 PM <DIR> .. 07/04/2017 01:53 PM <DIR> msvc2017_64 07/04/2017 01:51 PM <DIR> winrt_armv7_msvc2017 07/04/2017 01:52 PM <DIR> winrt_x64_msvc2017 07/04/2017 01:52 PM <DIR> winrt_x86_msvc2017 0 File(s) 0 bytes 6 Dir(s) 27,699,412,992 bytes free