add cmake
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
project( http_client )
|
||||||
|
cmake_minimum_required( VERSION 3.0 )
|
||||||
|
|
||||||
|
set (CMAKE_CXX_COMPILER g++)
|
||||||
|
|
||||||
|
# Widgets finds its own dependencies.
|
||||||
|
find_package ( Qt5 COMPONENTS Widgets Charts QuickWidgets REQUIRED )
|
||||||
|
|
||||||
|
set ( CMAKE_AUTOMOC ON )
|
||||||
|
set ( CMAKE_AUTORCC ON )
|
||||||
|
set ( CMAKE_INCLUDE_CURRENT_DIR ON )
|
||||||
|
|
||||||
|
file ( GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp )
|
||||||
|
file ( GLOB_RECURSE MOC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h* )
|
||||||
|
|
||||||
|
set ( UIS uis/mainwindow.ui )
|
||||||
|
|
||||||
|
QT5_WRAP_UI ( UI_HEADERS ${UIS} )
|
||||||
|
|
||||||
|
include_directories ( ${CMAKE_CURRENT_SOURCE_DIR}/include )
|
||||||
|
|
||||||
|
add_executable ( http_client ${SOURCES} ${MOC_SRCS} ${UI_HEADERS} ${MOC_HEADERS} ${RESOURCES})
|
||||||
|
qt5_use_modules ( http_client Widgets Charts Quick )
|
||||||
|
target_link_libraries( http_client Qt5::QuickWidgets Qt5::Quick Qt5::Widgets )
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#ifndef MAINWINDOW_H
|
||||||
|
#define MAINWINDOW_H
|
||||||
|
|
||||||
|
#include <QMainWindow>
|
||||||
|
#include <QtCharts>
|
||||||
|
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class MainWindow;
|
||||||
|
}
|
||||||
|
|
||||||
|
class MainWindow : public QMainWindow
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit MainWindow(QWidget *parent = nullptr);
|
||||||
|
~MainWindow();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::MainWindow *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // MAINWINDOW_H
|
||||||
@@ -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();
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#include "mainwindow.h"
|
||||||
|
#include "ui_mainwindow.h"
|
||||||
|
|
||||||
|
|
||||||
|
MainWindow::MainWindow(QWidget *parent) :
|
||||||
|
QMainWindow(parent),
|
||||||
|
ui(new Ui::MainWindow)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
MainWindow::~MainWindow()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?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>1332</width>
|
||||||
|
<height>987</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>MainWindow</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="centralWidget">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_5"/>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
Reference in New Issue
Block a user