From e0bbd31d2bffcdaa64b11ffdf6f4c3bf096c6de7 Mon Sep 17 00:00:00 2001 From: nasicurious Date: Sun, 21 Nov 2021 15:44:18 +0330 Subject: [PATCH] Prepare structure of File --- .gitignore | 1 + Plx/Plx.pro | 33 +++++++++++++++++++++++++++++++++ Plx/include/Plx.h | 11 +++++++++++ Plx/include/PlxController.h | 17 +++++++++++++++++ Plx/include/PlxWrapper.h | 17 +++++++++++++++++ Plx/src/Plx.cpp | 6 ++++++ Plx/src/PlxController.cpp | 6 ++++++ Plx/src/PlxWrapper.cpp | 6 ++++++ PlxBoard.pro | 6 ++++++ Test/MainWindow.cpp | 15 +++++++++++++++ Test/MainWindow.h | 21 +++++++++++++++++++++ Test/MainWindow.ui | 22 ++++++++++++++++++++++ Test/Test.pro | 36 ++++++++++++++++++++++++++++++++++++ Test/main.cpp | 11 +++++++++++ 14 files changed, 208 insertions(+) create mode 100644 .gitignore create mode 100644 Plx/Plx.pro create mode 100644 Plx/include/Plx.h create mode 100644 Plx/include/PlxController.h create mode 100644 Plx/include/PlxWrapper.h create mode 100644 Plx/src/Plx.cpp create mode 100644 Plx/src/PlxController.cpp create mode 100644 Plx/src/PlxWrapper.cpp create mode 100644 PlxBoard.pro create mode 100644 Test/MainWindow.cpp create mode 100644 Test/MainWindow.h create mode 100644 Test/MainWindow.ui create mode 100644 Test/Test.pro create mode 100644 Test/main.cpp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..75c107b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pro.user diff --git a/Plx/Plx.pro b/Plx/Plx.pro new file mode 100644 index 0000000..30f2abf --- /dev/null +++ b/Plx/Plx.pro @@ -0,0 +1,33 @@ +QT -= gui + +TEMPLATE = lib +CONFIG += staticlib + +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 += \ + $$files(*.cpp, true) \ + + +HEADERS += \ + $$files(*.h, true) \ + +INCLUDEPATH += $$PWD/include + + +# Default rules for deployment. +unix { + target.path = $$[QT_INSTALL_PLUGINS]/generic +} +!isEmpty(target.path): INSTALLS += target diff --git a/Plx/include/Plx.h b/Plx/include/Plx.h new file mode 100644 index 0000000..cbc010a --- /dev/null +++ b/Plx/include/Plx.h @@ -0,0 +1,11 @@ +#ifndef PLX_H +#define PLX_H + + +class Plx +{ +public: + Plx(); +}; + +#endif // PLX_H diff --git a/Plx/include/PlxController.h b/Plx/include/PlxController.h new file mode 100644 index 0000000..08e7cb6 --- /dev/null +++ b/Plx/include/PlxController.h @@ -0,0 +1,17 @@ +#ifndef PLXCONTROLLER_H +#define PLXCONTROLLER_H + +#include + +class PlxController : public QObject +{ + Q_OBJECT +public: + explicit PlxController(QObject *parent = nullptr); + +signals: + +public slots: +}; + +#endif // PLXCONTROLLER_H diff --git a/Plx/include/PlxWrapper.h b/Plx/include/PlxWrapper.h new file mode 100644 index 0000000..52abbc2 --- /dev/null +++ b/Plx/include/PlxWrapper.h @@ -0,0 +1,17 @@ +#ifndef PLXWRAPPER_H +#define PLXWRAPPER_H + +#include + +class PlxWrapper : public QObject +{ + Q_OBJECT +public: + explicit PlxWrapper(QObject *parent = nullptr); + +signals: + +public slots: +}; + +#endif // PLXWRAPPER_H diff --git a/Plx/src/Plx.cpp b/Plx/src/Plx.cpp new file mode 100644 index 0000000..709f6ba --- /dev/null +++ b/Plx/src/Plx.cpp @@ -0,0 +1,6 @@ +#include "../include/Plx.h" + +Plx::Plx() +{ + +} diff --git a/Plx/src/PlxController.cpp b/Plx/src/PlxController.cpp new file mode 100644 index 0000000..93160dd --- /dev/null +++ b/Plx/src/PlxController.cpp @@ -0,0 +1,6 @@ +#include "../include/PlxController.h" + +PlxController::PlxController(QObject *parent) : QObject(parent) +{ + +} diff --git a/Plx/src/PlxWrapper.cpp b/Plx/src/PlxWrapper.cpp new file mode 100644 index 0000000..5164ce3 --- /dev/null +++ b/Plx/src/PlxWrapper.cpp @@ -0,0 +1,6 @@ +#include "../include/PlxWrapper.h" + +PlxWrapper::PlxWrapper(QObject *parent) : QObject(parent) +{ + +} diff --git a/PlxBoard.pro b/PlxBoard.pro new file mode 100644 index 0000000..def56ee --- /dev/null +++ b/PlxBoard.pro @@ -0,0 +1,6 @@ +TEMPLATE = subdirs + +SUBDIRS += \ + Plx \ + Test +Test.depends += Plx diff --git a/Test/MainWindow.cpp b/Test/MainWindow.cpp new file mode 100644 index 0000000..ff126e8 --- /dev/null +++ b/Test/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/Test/MainWindow.h b/Test/MainWindow.h new file mode 100644 index 0000000..4643e32 --- /dev/null +++ b/Test/MainWindow.h @@ -0,0 +1,21 @@ +#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; +}; +#endif // MAINWINDOW_H diff --git a/Test/MainWindow.ui b/Test/MainWindow.ui new file mode 100644 index 0000000..b232854 --- /dev/null +++ b/Test/MainWindow.ui @@ -0,0 +1,22 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + + + diff --git a/Test/Test.pro b/Test/Test.pro new file mode 100644 index 0000000..17267a1 --- /dev/null +++ b/Test/Test.pro @@ -0,0 +1,36 @@ +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 + +INCLUDEPATH += $$PWD/../Plx/include + +FORMS += \ + MainWindow.ui + +LIBS += -L$$OUT_PWD/../Plx/ -lPlx +PRE_TARGETDEPS += $$OUT_PWD/../Plx/libPlx.a + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target diff --git a/Test/main.cpp b/Test/main.cpp new file mode 100644 index 0000000..0a0916f --- /dev/null +++ b/Test/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(); +}