1、先看效果

2、上代码补丁

From 08f234148d543a546e6f64ebbba31e379424322a Mon Sep 17 00:00:00 2001
From: rockemd <rockemd2020@163.com>
Date: Wed, 18 Nov 2020 18:19:02 +0800
Subject: [PATCH] qhellotest---app/qhellotest/main.cpp                            | 11 ++++++app/qhellotest/mainwindow.cpp                      | 15 ++++++++app/qhellotest/mainwindow.h                        | 21 ++++++++++app/qhellotest/mainwindow.ui                       | 45 ++++++++++++++++++++++app/qhellotest/qhellotest.pro                      | 28 ++++++++++++++.../rockchip_rv1126_rv1109_facial_gate_defconfig   |  1 +buildroot/package/rockchip/Config.in               |  1 +buildroot/package/rockchip/qhellotest/Config.in    |  4 ++.../package/rockchip/qhellotest/qhellotest.mk      | 23 +++++++++++9 files changed, 149 insertions(+)create mode 100755 app/qhellotest/main.cppcreate mode 100755 app/qhellotest/mainwindow.cppcreate mode 100755 app/qhellotest/mainwindow.hcreate mode 100755 app/qhellotest/mainwindow.uicreate mode 100755 app/qhellotest/qhellotest.promode change 100644 => 100755 buildroot/configs/rockchip_rv1126_rv1109_facial_gate_defconfigmode change 100644 => 100755 buildroot/package/rockchip/Config.increate mode 100755 buildroot/package/rockchip/qhellotest/Config.increate mode 100755 buildroot/package/rockchip/qhellotest/qhellotest.mkdiff --git a/app/qhellotest/main.cpp b/app/qhellotest/main.cpp
new file mode 100755
index 0000000..aff48df
--- /dev/null
+++ b/app/qhellotest/main.cpp
@@ -0,0 +1,11 @@
+#include "mainwindow.h"
+
+#include <QApplication>
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    MainWindow w;
+    w.show();
+    return a.exec();
+}
diff --git a/app/qhellotest/mainwindow.cpp b/app/qhellotest/mainwindow.cpp
new file mode 100755
index 0000000..79c64b9
--- /dev/null
+++ b/app/qhellotest/mainwindow.cpp
@@ -0,0 +1,15 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+
+MainWindow::MainWindow(QWidget *parent)
+    : QMainWindow(parent)
+    , ui(new Ui::MainWindow)
+{
+    ui->setupUi(this);
+}
+
+MainWindow::~MainWindow()
+{
+    delete ui;
+}
+
diff --git a/app/qhellotest/mainwindow.h b/app/qhellotest/mainwindow.h
new file mode 100755
index 0000000..934b0f3
--- /dev/null
+++ b/app/qhellotest/mainwindow.h
@@ -0,0 +1,21 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+
+QT_BEGIN_NAMESPACE
+namespace Ui { class MainWindow; }
+QT_END_NAMESPACE
+
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    MainWindow(QWidget *parent = nullptr);
+    ~MainWindow();
+
+private:
+    Ui::MainWindow *ui;
+};
+#endif // MAINWINDOW_H
diff --git a/app/qhellotest/mainwindow.ui b/app/qhellotest/mainwindow.ui
new file mode 100755
index 0000000..0b7ae14
--- /dev/null
+++ b/app/qhellotest/mainwindow.ui
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>364</width>
+    <height>293</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>MainWindow</string>
+  </property>
+  <widget class="QWidget" name="centralwidget">
+   <widget class="QLabel" name="label">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>100</y>
+      <width>361</width>
+      <height>131</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>rockemd QT!</string>
+    </property>
+   </widget>
+  </widget>
+  <widget class="QMenuBar" name="menubar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>364</width>
+     <height>23</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QStatusBar" name="statusbar"/>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/app/qhellotest/qhellotest.pro b/app/qhellotest/qhellotest.pro
new file mode 100755
index 0000000..4ec32ea
--- /dev/null
+++ b/app/qhellotest/qhellotest.pro
@@ -0,0 +1,28 @@
+QT += widgets
+
+CONFIG += c++11 console
+
+TARGET = qhellotest
+TEMPLATE = app
+
+# The following define makes your compiler emit warnings if you use
+# any feature of Qt which as been marked deprecated (the exact warnings
+# depend on your compiler). Please consult the documentation of the
+# deprecated API in order to know how to port your code away from it.
+#DEFINES += QT_DEPRECATED_WARNINGS
+
+# You can also make your code fail to compile if you use deprecated APIs.
+# In order to do so, uncomment the following line.
+# You can also select to disable deprecated APIs only up to a certain version of Qt.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
+
+SOURCES += \
+    main.cpp \
+    mainwindow.cpp
+
+HEADERS += \
+    mainwindow.h
+
+FORMS += \
+    mainwindow.ui
+
diff --git a/buildroot/configs/rockchip_rv1126_rv1109_facial_gate_defconfig b/buildroot/configs/rockchip_rv1126_rv1109_facial_gate_defconfig
old mode 100644
new mode 100755
index 71e9632..e325a85
--- a/buildroot/configs/rockchip_rv1126_rv1109_facial_gate_defconfig
+++ b/buildroot/configs/rockchip_rv1126_rv1109_facial_gate_defconfig
@@ -24,6 +24,7 @@ BR2_PACKAGE_RKMEDIA_ANR=yBR2_PACKAGE_RKMEDIA_AEC=yBR2_PACKAGE_RKMEDIA_EXAMPLES=yBR2_PACKAGE_QFACIALGATE=y
+BR2_PACKAGE_QHELLOTEST=y# BR2_PACKAGE_MINIGUI_SOFTWARE_SCALE is not setBR2_PACKAGE_RKNPU_USE_MINI_DRIVER=yBR2_PACKAGE_RKFACIAL_USE_WEB_SERVER=y
diff --git a/buildroot/package/rockchip/Config.in b/buildroot/package/rockchip/Config.in
old mode 100644
new mode 100755
index 6735cdc..8cb643b
--- a/buildroot/package/rockchip/Config.in
+++ b/buildroot/package/rockchip/Config.in
@@ -180,6 +180,7 @@ source "package/rockchip/carmachine/Config.in"source "package/rockchip/gallery/Config.in"source "package/rockchip/QLauncher/Config.in"source "package/rockchip/QFacialGate/Config.in"
+source "package/rockchip/qhellotest/Config.in"source "package/rockchip/settings/Config.in"source "package/rockchip/qcamera/Config.in"source "package/rockchip/qfm/Config.in"
diff --git a/buildroot/package/rockchip/qhellotest/Config.in b/buildroot/package/rockchip/qhellotest/Config.in
new file mode 100755
index 0000000..7b18811
--- /dev/null
+++ b/buildroot/package/rockchip/qhellotest/Config.in
@@ -0,0 +1,4 @@
+config BR2_PACKAGE_QHELLOTEST
+  bool "qhellotest"
+  help
+      rockemd qt test
\ No newline at end of file
diff --git a/buildroot/package/rockchip/qhellotest/qhellotest.mk b/buildroot/package/rockchip/qhellotest/qhellotest.mk
new file mode 100755
index 0000000..8a9dbc4
--- /dev/null
+++ b/buildroot/package/rockchip/qhellotest/qhellotest.mk
@@ -0,0 +1,23 @@
+################################################################################
+#
+# qhellotest
+#
+################################################################################
+
+QHELLOTEST_VERSION = 1.0
+QHELLOTEST_SITE = $(TOPDIR)/../app/qhellotest
+QHELLOTEST_SITE_METHOD = local
+
+QHELLOTEST_LICENSE = Apache V2.0
+QHELLOTEST_LICENSE_FILES = NOTICE
+define QHELLOTEST_CONFIGURE_CMDS
+cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake
+endef
+define QHELLOTEST_BUILD_CMDS
+$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
+endef
+
+define QHELLOTEST_INSTALL_TARGET_CMDS
+$(INSTALL) -D -m 0755 $(@D)/qhellotest $(TARGET_DIR)/usr/bin/qhellotest
+endef
+$(eval $(generic-package))
--
2.7.4

3、开发调试步骤

3.1、在PC机上安装QT开发环境,新建工程(这里不详细介绍),可参考rockchip官方文档 《docs\Linux\ApplicationNote\Rockchip_Developer_Guide_Linux_Qt_CN.pdf》

3.2、移植QT工程(见补丁)

3.3、编译调试如下:

source build/envsetup.sh72. rockchip_rv1126_rv1109
73. rockchip_rv1126_rv1109_facial_gate
74. rockchip_rv1126_rv1109_libs
75. rockchip_rv1126_rv1109_ramboot_uvcc
76. rockchip_rv1126_rv1109_recovery
77. rockchip_rv1126_rv1109_sl
78. rockchip_rv1126_rv1109_spi_nand
79. rockchip_rv1126_rv1109_systemd
80. rockchip_rv1126_rv1109_toolchain
81. rockchip_rv1126_rv1109_uvcc
82. rockchip_rv1126_rv1109_uvcc_spi_nand
Which would you like? [0]: 73   <--------------------------------------make qhellotest-rebuild编译成功生成可执行程序目录:rv1126_rv1109/buildroot/output/rockchip_rv1126_rv1109_facial_gate/target/usr/bin/qhellotestadb push Z:\rv1126_rv1109\buildroot\output\rockchip_rv1126_rv1109_facial_gate\target\usr\bin\qhellotest \usr\bin\adb shell
[root@ROCKEMD:/]#  chmod 777 /usr/bin/qhellotest
[root@ROCKEMD:/]#  export QT_QPA_FB_DRM=1
[root@ROCKEMD:/]#  export QT_QPA_PLATFORM=linuxfb:rotation=0
[root@ROCKEMD:/]#  qhellotest &

技术交流群: 微信号
===========================================

RV1126RV1109 buildroot 增加QT程序相关推荐

  1. RV1126RV1109 buildroot 增加串口屏测试

    一.运行效果: [root@ROCKEMD:/]# dwuart Usage: dwuart /dev/ttyS* data +-------data--------+ | c - clear | | ...

  2. RV1126RV1109 buildroot 增加GPIO测试程序

    补丁 Author: rockemd <rockemd2020@163.com> Date: Wed Jan 6 16:30:33 2021 +08001.add iotestdiff - ...

  3. RV1126RV1109 buildroot 增加USB双摄支持(一)

    1.默认SDK配置UVC驱动 diff --git a/kernel/arch/arm/configs/rv1126_defconfig b/kernel/arch/arm/configs/rv112 ...

  4. Qt 程序打包发布总结

      1.  概述 当我们用QT写好了一个软件,要把你的程序分享出去的时候,不可能把编译的目录拷贝给别人去运行.编译好的程序应该是一个主程序,加一些资源文件,再加一些动态链接库,高大上一些的还可以做一个 ...

  5. buildroot自带程序(库)编译并安装

    前几天情绪有点低落,经过周末的调整重新恢复状态,谢谢有爱的朋友们留言和点赞,有你们的陪伴我会更加努力,让我们一起开心写程序..... buildroot简介: 引用官方的简述: Buildroot是一 ...

  6. qt程序报错error C2248: “ThreadTest::ThreadTest”: 无法访问 private 成员(在“ThreadTest”类中声明)

    问题: 在qt程序中新增一个类,未继承任何类,后来增加继承类的时候,添加继承类和Q_OBJECT宏后编译报错: error C2248: "ThreadTest::ThreadTest&qu ...

  7. 让Qt程序适配高分辨率屏幕,解决软件界面错乱异常

    让Qt程序适配高分辨率屏幕,解决软件界面错乱异常 一.问题 二.原因 三.解决方案 1.更改显示器分辨率或者不使用缩放 2.使用"高DIP缩放替代" 3.修改软件,使之自动适配 a ...

  8. Qt开发北斗定位系统融合百度地图API及Qt程序打包发布

    Qt开发北斗定位系统融合百度地图API及Qt程序打包发布 1.上位机介绍 最近有个接了一个小型项目,内容很简单,就是解析北斗GPS的串口数据然后输出经纬度,但接过来觉得太简单,就发挥了主观能动性,增加 ...

  9. linux qt make文件或目录,rpm,linux_为Qt程序制作rpm包的spec文件里的路径问题,rpm,linux,qt,rpmbuild,spec - phpStudy...

    为Qt程序制作rpm包的spec文件里的路径问题 我对Qt和rpm都不怎么熟悉,所以在为Qt程序制作rpm包的时候被路径问题纠结到了. Qt的.pro文件的相关部分是这么写的,其中AppName是我的 ...

最新文章

  1. arm-none-linux-gnueabi,安装交叉编译器arm-none-linux-gnueabi-gcc 过程
  2. php 发送微信请求失败的原因,微信小程序模拟正常 真机服务器请求出错
  3. 表单验证的完美解决方案Validform
  4. leader选举的源码分析-FastLeaderElection
  5. js整体缩小网页_SEO网页优化的原则是什么?
  6. java选择安装路径的功能怎么实现_水槽怎么选择,从安装方式,材质功能,江水平给你一次性说清楚...
  7. 【androidjniNDk】详细介绍每一步,让你轻松掌握android JNI NDk
  8. 长途货运4大痛,Uber新上的「自动驾驶卡车」如何改善?
  9. 最新前端中高级面试题
  10. oracle中print,oracle中print_table存储过程实例介绍
  11. 【Python爬虫+js逆向】使用Python爬取腾讯漫画的逆向分析(典型签名验证反爬虫的解决方案)——以腾讯动漫《一人之下》第一话为例
  12. kafka 修改分区_kafka分区
  13. 路由器密码重置(更改寄存器的值)
  14. android终端模拟器运行命令可以进行adb connect
  15. 笔记本电脑键盘被锁如何解锁
  16. Xilinx Zynq实现任意波形发生器仿真
  17. Spring5 里边的新玩法!这种 URL 请求让我涨见识了!
  18. 真正的宽带上网加速方法
  19. Python:垃圾分类小游戏
  20. boss直聘项目说明

热门文章

  1. 浏览器兼容性工具 Spoon Browser Sandbox
  2. linux下安装mariadb
  3. MATLAB处理矩阵的一些命令
  4. 28、利用稳压芯片设计一个恒流源
  5. Android 方向感应器实现指南针
  6. Vlan(虚拟局域网配置)
  7. QPython+uiautomator2安卓手机自动化脚本编写
  8. android USB OTG功能实现
  9. 福建省一级计算机考试文字录入,2015福建省机关事业工勤人员计算机文字录入员工作总结.doc...
  10. FTP连接时出现“227 Entering Passive Mode” 的解决方法(附加实际案例)