Split project setup into executable and lib parts
This commit is contained in:
parent
886e42b5c5
commit
a19ead9728
|
@ -0,0 +1,13 @@
|
||||||
|
TEMPLATE = lib
|
||||||
|
CONFIG += staticlib
|
||||||
|
SOURCES = \
|
||||||
|
qtmaterialavatar.cpp \
|
||||||
|
lib/qtmaterialstyle.cpp \
|
||||||
|
lib/qtmaterialtheme.cpp
|
||||||
|
HEADERS = \
|
||||||
|
qtmaterialavatar_p.h \
|
||||||
|
qtmaterialavatar.h \
|
||||||
|
lib/qtmaterialstyle_p.h \
|
||||||
|
lib/qtmaterialstyle.h \
|
||||||
|
lib/qtmaterialtheme_p.h \
|
||||||
|
lib/qtmaterialtheme.h
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef QTMATERIALSTYLE_H
|
#ifndef QTMATERIALSTYLE_H
|
||||||
#define QTMATERIALSTYLE_H
|
#define QTMATERIALSTYLE_H
|
||||||
|
|
||||||
#include <QCommonStyle>
|
#include <QtWidgets/QCommonStyle>
|
||||||
#include "lib/qtmaterialstyle_p.h"
|
#include "lib/qtmaterialstyle_p.h"
|
||||||
|
|
||||||
class QtMaterialTheme;
|
class QtMaterialTheme;
|
|
@ -1,5 +1,5 @@
|
||||||
#include "components/qtmaterialavatar.h"
|
#include "qtmaterialavatar.h"
|
||||||
#include "components/qtmaterialavatar_p.h"
|
#include "qtmaterialavatar_p.h"
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include "lib/qtmaterialstyle.h"
|
#include "lib/qtmaterialstyle.h"
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef QTMATERIALAVATAR_H
|
#ifndef QTMATERIALAVATAR_H
|
||||||
#define QTMATERIALAVATAR_H
|
#define QTMATERIALAVATAR_H
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QtWidgets/QWidget>
|
||||||
#include "lib/qtmaterialtheme.h"
|
#include "lib/qtmaterialtheme.h"
|
||||||
|
|
||||||
class QtMaterialAvatarPrivate;
|
class QtMaterialAvatarPrivate;
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
QT += core gui widgets
|
||||||
|
TEMPLATE = app
|
||||||
|
SOURCES = mainwindow.cpp main.cpp
|
||||||
|
HEADERS = mainwindow.h
|
||||||
|
LIBS += ../components/libcomponents.a
|
||||||
|
INCLUDEPATH += ../components/
|
||||||
|
TARGET = ../examples-exe
|
|
@ -1,11 +1,13 @@
|
||||||
|
#include <QtWidgets/QApplication>
|
||||||
|
#include <QDebug>
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include <QApplication>
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
MainWindow w;
|
|
||||||
w.show();
|
MainWindow window;
|
||||||
|
window.show();
|
||||||
|
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
#include "mainwindow.h"
|
||||||
|
#include <QtWidgets/QVBoxLayout>
|
||||||
|
#include <qtmaterialavatar.h>
|
||||||
|
|
||||||
|
MainWindow::MainWindow(QWidget *parent)
|
||||||
|
: QMainWindow(parent)
|
||||||
|
{
|
||||||
|
QtMaterialAvatar *avatars[3];
|
||||||
|
avatars[0] = new QtMaterialAvatar;
|
||||||
|
avatars[1] = new QtMaterialAvatar('W');
|
||||||
|
avatars[2] = new QtMaterialAvatar;
|
||||||
|
|
||||||
|
QWidget *widget = new QWidget;
|
||||||
|
QVBoxLayout *layout = new QVBoxLayout;
|
||||||
|
|
||||||
|
widget->setLayout(layout);
|
||||||
|
setCentralWidget(widget);
|
||||||
|
|
||||||
|
layout->addWidget(avatars[0]);
|
||||||
|
layout->addWidget(avatars[1]);
|
||||||
|
layout->addWidget(avatars[2]);
|
||||||
|
}
|
||||||
|
|
||||||
|
MainWindow::~MainWindow()
|
||||||
|
{
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef MAINWINDOW_H
|
#ifndef MAINWINDOW_H
|
||||||
#define MAINWINDOW_H
|
#define MAINWINDOW_H
|
||||||
|
|
||||||
#include <QMainWindow>
|
#include <QtWidgets/QMainWindow>
|
||||||
|
|
||||||
class MainWindow : public QMainWindow
|
class MainWindow : public QMainWindow
|
||||||
{
|
{
|
|
@ -1,10 +0,0 @@
|
||||||
#include "mainwindow.h"
|
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent)
|
|
||||||
: QMainWindow(parent)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
|
||||||
{
|
|
||||||
}
|
|
|
@ -1,15 +1,8 @@
|
||||||
#-------------------------------------------------
|
|
||||||
#
|
|
||||||
# Project created by QtCreator 2017-09-28T12:54:30
|
|
||||||
#
|
|
||||||
#-------------------------------------------------
|
|
||||||
|
|
||||||
QT += core gui
|
|
||||||
|
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||||
|
|
||||||
TARGET = qt-material-widgets
|
TARGET = qt-material-widgets
|
||||||
TEMPLATE = app
|
TEMPLATE = subdirs
|
||||||
|
SUBDIRS = components examples
|
||||||
|
|
||||||
# The following define makes your compiler emit warnings if you use
|
# The following define makes your compiler emit warnings if you use
|
||||||
# any feature of Qt which as been marked as deprecated (the exact warnings
|
# any feature of Qt which as been marked as deprecated (the exact warnings
|
||||||
|
@ -21,18 +14,3 @@ DEFINES += QT_DEPRECATED_WARNINGS
|
||||||
# In order to do so, uncomment the following line.
|
# 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.
|
# 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
|
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||||
|
|
||||||
|
|
||||||
SOURCES += main.cpp\
|
|
||||||
mainwindow.cpp \
|
|
||||||
components/qtmaterialavatar.cpp \
|
|
||||||
lib/qtmaterialstyle.cpp \
|
|
||||||
lib/qtmaterialtheme.cpp
|
|
||||||
|
|
||||||
HEADERS += mainwindow.h \
|
|
||||||
components/qtmaterialavatar_p.h \
|
|
||||||
components/qtmaterialavatar.h \
|
|
||||||
lib/qtmaterialstyle_p.h \
|
|
||||||
lib/qtmaterialstyle.h \
|
|
||||||
lib/qtmaterialtheme_p.h \
|
|
||||||
lib/qtmaterialtheme.h
|
|
||||||
|
|
Loading…
Reference in New Issue