diff --git a/package/starfive/Config.in b/package/starfive/Config.in index f250104d..aacce74b 100644 --- a/package/starfive/Config.in +++ b/package/starfive/Config.in @@ -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" diff --git a/package/starfive/qt_test/Config.in b/package/starfive/qt_test/Config.in new file mode 100644 index 00000000..f05595bd --- /dev/null +++ b/package/starfive/qt_test/Config.in @@ -0,0 +1,6 @@ +comment "qt test package" + +config BR2_PACKAGE_QT_TEST + bool "qt_test" + help + Utility for testing qt project diff --git a/package/starfive/qt_test/qt_test.mk b/package/starfive/qt_test/qt_test.mk new file mode 100644 index 00000000..f90edbe1 --- /dev/null +++ b/package/starfive/qt_test/qt_test.mk @@ -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)) diff --git a/package/starfive/qt_test/src/main.cpp b/package/starfive/qt_test/src/main.cpp new file mode 100755 index 00000000..fd3e5334 --- /dev/null +++ b/package/starfive/qt_test/src/main.cpp @@ -0,0 +1,11 @@ +#include "mainwindow.h" + +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; + w.show(); + return a.exec(); +} diff --git a/package/starfive/qt_test/src/mainwindow.cpp b/package/starfive/qt_test/src/mainwindow.cpp new file mode 100755 index 00000000..485d3fa5 --- /dev/null +++ b/package/starfive/qt_test/src/mainwindow.cpp @@ -0,0 +1,21 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" +#include + +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 ); +} diff --git a/package/starfive/qt_test/src/mainwindow.h b/package/starfive/qt_test/src/mainwindow.h new file mode 100755 index 00000000..1d606d4c --- /dev/null +++ b/package/starfive/qt_test/src/mainwindow.h @@ -0,0 +1,25 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +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 diff --git a/package/starfive/qt_test/src/mainwindow.ui b/package/starfive/qt_test/src/mainwindow.ui new file mode 100755 index 00000000..c26771df --- /dev/null +++ b/package/starfive/qt_test/src/mainwindow.ui @@ -0,0 +1,95 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + 310 + 220 + 106 + 30 + + + + PushButton + + + + + + 520 + 220 + 110 + 27 + + + + CheckBox + + + + + + 520 + 280 + 133 + 27 + + + + RadioButton + + + + + + + 0 + 0 + 800 + 26 + + + + + Menu + + + + + + Setting + + + + + + + + + + Langue + + + + + About + + + + + + diff --git a/package/starfive/qt_test/src/qt_test.pro b/package/starfive/qt_test/src/qt_test.pro new file mode 100755 index 00000000..688ba9d3 --- /dev/null +++ b/package/starfive/qt_test/src/qt_test.pro @@ -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