您好,登錄后才能下訂單哦!
本篇內(nèi)容介紹了“SV806 QT UI開發(fā)方法是什么”的有關(guān)知識(shí),在實(shí)際案例的操作過(guò)程中,不少人都會(huì)遇到這樣的困境,接下來(lái)就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!
#關(guān)于SV806
SV810是一款具有用于視頻監(jiān)控產(chǎn)品的神經(jīng)網(wǎng)絡(luò)加速(NPU)的專業(yè)AI SoC。它支持1080p 60fps高質(zhì)量數(shù)字視頻錄制和播放。 基本性能基本對(duì)標(biāo)的Hi3516DV300/CV500; 主要用于人臉識(shí)別終端開發(fā),這里主要介紹一下在SV806上面使用QT開發(fā)的基本工作, 把QT的相關(guān)的操作做一個(gè)簡(jiǎn)單的記錄。
#QT編譯
這里使用用QT的版本,其SDK里使用了QT4.8的庫(kù),因?yàn)橹暗娜四樧R(shí)別終端其他平臺(tái)使用的是QT5, 所以這里也使用QT5的版本了。從QT官網(wǎng)上下載一份QT5(我這里用的是QT5.5). 把QT5解壓出來(lái)后,在mkspace里加一個(gè)SV806的配置,在配置里指定SV806對(duì)應(yīng)的編譯工具鏈。
在Qt目錄執(zhí)行例如下的配置(根據(jù)自已的需求對(duì)應(yīng)的修改吧):
./configure -release -opensource -xplatform arm-linux-for-sv806 \ -release -no-c++11 -prefix /usr/local/qt5.5.1 -no-largefile -no-accessibility -mtdev -no-journald -no-openssl -no-libproxy -no-eglfs -no-opengl -qt-sql-sqlite -I/home/ubuntu/sv806/third_party/usr/include -L/home/ubuntu/sv806/third_party/usr/lib -libinput -no-xcb-xlib -no-qml-debug -no-alsa -no-gtkstyle -no-nis -no-cups -widgets -no-icu -no-dbus -no-xcb -no-eglfs -no-kms -no-gstreamer -no-slog2 -no-pps -no-imf -no-lgmon -qt-libpng -qt-libjpeg -qt-freetype -tslib -skip qtcanvas3d -skip qt3d -skip qtwebkit-examples -confirm-license -opensource
正常編譯通過(guò)后,在板端配置好環(huán)境變量,路徑,就可以執(zhí)行示例看到效果了。
#QT相關(guān)代碼修改
在開發(fā)視頻與UI結(jié)果顯示時(shí),需要修改一下linuxfb里的代碼,主要修改如下: 在linuxfb中的 qlinuxfbscreen.cpp 修改為不繪制背景,這樣UI層才能透過(guò)看到視頻顯示層。 ```
QRegion QLinuxFbScreen::doRedraw() { QRegion touched = QFbScreen::doRedraw();
if (touched.isEmpty()) return touched; if (!mBlitter) mBlitter = new QPainter(&mFbScreenImage); QVector<QRect> rects = touched.rects(); for (int i = 0; i < rects.size(); i++) { mBlitter->setCompositionMode(QPainter::CompositionMode_Source); mBlitter->drawImage(rects[i], *mScreenImage, rects[i]); mBlitter->setCompositionMode(QPainter::CompositionMode_SourceOver); } return touched;
} ```
fbconvenience\qfbscreen.cpp
mCompositePainter->fillRect(rect, Qt::black); 修改為 mCompositePainter->setCompositionMode(QPainter::CompositionMode_Source); mCompositePainter->fillRect(rect, Qt::transparent); mCompositePainter->setCompositionMode(QPainter::CompositionMode_SourceOver);
完成后,在應(yīng)用里,把桌面設(shè)置 Qt::WA_TranslucentBackground 即可!
“SV806 QT UI開發(fā)方法是什么”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí)可以關(guān)注億速云網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。