commit e3d690912ac2696bdbb23515a725523eda563a33 Author: nasicurious Date: Tue Nov 2 12:04:13 2021 +0330 Create Project Template diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..444078f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.pro.user + diff --git a/Servo/Servo.pro b/Servo/Servo.pro new file mode 100644 index 0000000..cae823f --- /dev/null +++ b/Servo/Servo.pro @@ -0,0 +1,31 @@ +QT -= gui + +TEMPLATE = lib +DEFINES += SERVO_LIBRARY + +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 += \ + Servo.cpp + +HEADERS += \ + Servo_global.h \ + Servo.h + +# Default rules for deployment. +unix { + target.path = /usr/lib +} +!isEmpty(target.path): INSTALLS += target diff --git a/ServoApplication.pro b/ServoApplication.pro new file mode 100644 index 0000000..50728cd --- /dev/null +++ b/ServoApplication.pro @@ -0,0 +1,7 @@ +TEMPLATE = subdirs + +SUBDIRS += \ + Servo \ + Test + +Test.depends += Servo diff --git a/Test/MainWindow.cpp b/Test/MainWindow.cpp new file mode 100644 index 0000000..ec12972 --- /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..274dd1b --- /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..7d0737c --- /dev/null +++ b/Test/Test.pro @@ -0,0 +1,34 @@ +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 + +LIBS += -L$$OUT_PWD/../Servo/ -lServo +PRE_TARGETDEPS += $$OUT_PWD/../Servo/libServo.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..723a9ab --- /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(); +}