feat: MDI(Multi-document Interface)

This commit is contained in:
touwoyimuli
2019-11-07 22:29:45 +08:00
parent 8b38169dc0
commit 1942cabb62
12 changed files with 152 additions and 1684 deletions

37
QtMDIEx/ExMDI.cpp Normal file
View File

@@ -0,0 +1,37 @@
/*
* Copyright (C) 2019 ~ 2019 touwoyimuli. All rights reserved.
*
* Author: touwoyimuli <touwoyimuli@gmai.com>
*
* github: https://github.com/touwoyimuli
* blogs: https://touwoyimuli.github.io/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://touwoyimuli.github.io/>.
*/
#include "ExMDI.h"
#include "ui_ExMDI.h"
ExMDI::ExMDI(QWidget *parent) :
QWidget(parent),
ui(new Ui::ExMDI)
{
ui->setupUi(this);
}
ExMDI::~ExMDI()
{
delete ui;
}

44
QtMDIEx/ExMDI.h Normal file
View File

@@ -0,0 +1,44 @@
/*
* Copyright (C) 2019 ~ 2019 touwoyimuli. All rights reserved.
*
* Author: touwoyimuli <touwoyimuli@gmai.com>
*
* github: https://github.com/touwoyimuli
* blogs: https://touwoyimuli.github.io/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://touwoyimuli.github.io/>.
*/
#ifndef EXMDI_H
#define EXMDI_H
#include <QWidget>
namespace Ui {
class ExMDI;
}
class ExMDI : public QWidget
{
Q_OBJECT
public:
explicit ExMDI(QWidget *parent = nullptr);
~ExMDI();
private:
Ui::ExMDI *ui;
};
#endif // EXMDI_H

20
QtMDIEx/ExMDI.ui Normal file
View File

@@ -0,0 +1,20 @@
<ui version="4.0">
<class>ExMDI</class>
<widget class="QWidget" name="ExMDI" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle" >
<string>ExMDI</string>
</property>
</widget>
<layoutDefault spacing="6" margin="11" />
<pixmapfunction></pixmapfunction>
<resources/>
<connections/>
</ui>

40
QtMDIEx/QtMDIEx.pro Normal file
View File

@@ -0,0 +1,40 @@
#-------------------------------------------------
#
# Project created by QtCreator 2019-11-07T01:01:30
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = QtMDIEx
TEMPLATE = app
# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as 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 you use 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
CONFIG += c++11
SOURCES += \
main.cpp \
ExMDI.cpp
HEADERS += \
ExMDI.h
FORMS += \
ExMDI.ui
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

11
QtMDIEx/main.cpp Normal file
View File

@@ -0,0 +1,11 @@
#include "ExMDI.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
ExMDI w;
w.show();
return a.exec();
}