qt_test: add qt test example package

Signed-off-by: Andy Hu <andy.hu@starfivetech.com>
This commit is contained in:
Andy Hu
2023-08-04 18:32:48 +08:00
parent 2584ef7236
commit 74bd59a052
8 changed files with 205 additions and 0 deletions
+1
View File
@@ -16,3 +16,4 @@ source "package/starfive/drm_test/Config.in"
source "package/starfive/pm/Config.in"
source "package/starfive/v4l2_dec_test/Config.in"
source "package/starfive/starfive-firmware/Config.in"
source "package/starfive/qt_test/Config.in"
+6
View File
@@ -0,0 +1,6 @@
comment "qt test package"
config BR2_PACKAGE_QT_TEST
bool "qt_test"
help
Utility for testing qt project
+15
View File
@@ -0,0 +1,15 @@
################################################################################
#
# qttest
#
################################################################################
QT_TEST_VERSION:=1.0.0
QT_TEST_SITE=$(TOPDIR)/package/starfive/qt_test/src
QT_TEST_SITE_METHOD=local
QT_TEST_DEPENDENCIES = qt5base
define QT_TEST_INSTALL_TARGET_CMDS
cd $(@D); $(TARGET_MAKE_ENV) $(MAKE) INSTALL_ROOT=$(TARGET_DIR) install
endef
$(eval $(qmake-package))
+11
View File
@@ -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();
}
+21
View File
@@ -0,0 +1,21 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QMessageBox>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_pushButton1_clicked()
{
QMessageBox::information(this , "information" , "Welcome to Riscv World!",
QMessageBox::Ok|QMessageBox::Default );
}
+25
View File
@@ -0,0 +1,25 @@
#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;
private slots:
void on_pushButton1_clicked();
};
#endif // MAINWINDOW_H
+95
View File
@@ -0,0 +1,95 @@
<?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>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="QPushButton" name="pushButton1">
<property name="geometry">
<rect>
<x>310</x>
<y>220</y>
<width>106</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>PushButton</string>
</property>
</widget>
<widget class="QCheckBox" name="checkBox">
<property name="geometry">
<rect>
<x>520</x>
<y>220</y>
<width>110</width>
<height>27</height>
</rect>
</property>
<property name="text">
<string>CheckBox</string>
</property>
</widget>
<widget class="QRadioButton" name="radioButton">
<property name="geometry">
<rect>
<x>520</x>
<y>280</y>
<width>133</width>
<height>27</height>
</rect>
</property>
<property name="text">
<string>RadioButton</string>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>26</height>
</rect>
</property>
<widget class="QMenu" name="menuMenu">
<property name="title">
<string>Menu</string>
</property>
<addaction name="actionLangue"/>
</widget>
<widget class="QMenu" name="menuSetting">
<property name="title">
<string>Setting</string>
</property>
<addaction name="actionAbout"/>
</widget>
<addaction name="menuMenu"/>
<addaction name="menuSetting"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="actionLangue">
<property name="text">
<string>Langue</string>
</property>
</action>
<action name="actionAbout">
<property name="text">
<string>About</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>
+31
View File
@@ -0,0 +1,31 @@
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
# The following define makes your compiler emit warnings if you use
# any Qt feature that has 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 it uses 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
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /root/bin
!isEmpty(target.path): INSTALLS += target