From 9aa223ac685599479fb8c6d578245a6dedd06b2a Mon Sep 17 00:00:00 2001 From: leichaojian Date: Sun, 16 Nov 2014 12:59:30 +0800 Subject: [PATCH] add splitter --- splitter/main.cpp | 42 ++++++ splitter/mainwindow.cpp | 14 ++ splitter/mainwindow.h | 22 ++++ splitter/mainwindow.ui | 24 ++++ splitter/splitter.pro | 20 +++ splitter/splitter.pro.user | 255 +++++++++++++++++++++++++++++++++++++ 6 files changed, 377 insertions(+) create mode 100644 splitter/main.cpp create mode 100644 splitter/mainwindow.cpp create mode 100644 splitter/mainwindow.h create mode 100644 splitter/mainwindow.ui create mode 100644 splitter/splitter.pro create mode 100644 splitter/splitter.pro.user diff --git a/splitter/main.cpp b/splitter/main.cpp new file mode 100644 index 0000000..3f01c86 --- /dev/null +++ b/splitter/main.cpp @@ -0,0 +1,42 @@ +#include "mainwindow.h" +#include +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + + QTextEdit *editor1 = new QTextEdit; + QTextEdit *editor2 = new QTextEdit; + QTextEdit *editor3 = new QTextEdit; + + QSplitter splitter(Qt::Horizontal); + splitter.addWidget(editor1); + splitter.addWidget(editor2); + splitter.addWidget(editor3); + + editor1->setPlainText("Mon enfant, ma soeur,\n" + "Songe la douceur\n" + "D'aller l-bas vivre ensemble,\n" + "Aimer loisir,\n" + "Aimer et mourir\n" + "Au pays qui te ressemble."); + editor2->setPlainText("My child, my sister,\n" + "think of the sweetness\n" + "of going there to live together!\n" + "To love at leisure,\n" + "to love and to die\n" + "in a country that is the image of you!"); + editor3->setPlainText("Mein Kind, meine Schwester,\n" + "denke an den Traum\n" + "dort hin(unter) zu gehen um zusammen\n" + "zu leben und in aller Ruhe zu lieben,\n" + "Zu lieben und zu sterben\n" + "in dem Land, das dir gleicht."); + + splitter.setWindowTitle(QObject::tr("Splitter")); + splitter.show(); + + return a.exec(); +} diff --git a/splitter/mainwindow.cpp b/splitter/mainwindow.cpp new file mode 100644 index 0000000..49d64fc --- /dev/null +++ b/splitter/mainwindow.cpp @@ -0,0 +1,14 @@ +#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/splitter/mainwindow.h b/splitter/mainwindow.h new file mode 100644 index 0000000..a3948a9 --- /dev/null +++ b/splitter/mainwindow.h @@ -0,0 +1,22 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + +private: + Ui::MainWindow *ui; +}; + +#endif // MAINWINDOW_H diff --git a/splitter/mainwindow.ui b/splitter/mainwindow.ui new file mode 100644 index 0000000..6050363 --- /dev/null +++ b/splitter/mainwindow.ui @@ -0,0 +1,24 @@ + + MainWindow + + + + 0 + 0 + 400 + 300 + + + + MainWindow + + + + + + + + + + + diff --git a/splitter/splitter.pro b/splitter/splitter.pro new file mode 100644 index 0000000..2825a27 --- /dev/null +++ b/splitter/splitter.pro @@ -0,0 +1,20 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2014-11-16T12:52:26 +# +#------------------------------------------------- + +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = splitter +TEMPLATE = app + + +SOURCES += main.cpp\ + mainwindow.cpp + +HEADERS += mainwindow.h + +FORMS += mainwindow.ui diff --git a/splitter/splitter.pro.user b/splitter/splitter.pro.user new file mode 100644 index 0000000..d995e7f --- /dev/null +++ b/splitter/splitter.pro.user @@ -0,0 +1,255 @@ + + + + + + EnvironmentId + {a8c18b7e-8020-49b9-a0ef-0165c784344f} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.3 MinGW 32bit + Desktop Qt 5.3 MinGW 32bit + qt.53.win32_mingw482_kit + 0 + 0 + 0 + + C:/Users/fzyz_sb/Desktop/build-splitter-Desktop_Qt_5_3_MinGW_32bit-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + + 2 + 构建 + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + + 1 + 清理 + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + C:/Users/fzyz_sb/Desktop/build-splitter-Desktop_Qt_5_3_MinGW_32bit-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + + 2 + 构建 + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + + 1 + 清理 + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 2 + + + 0 + 部署 + + ProjectExplorer.BuildSteps.Deploy + + 1 + 在本地部署 + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + splitter + + Qt4ProjectManager.Qt4RunConfiguration:C:/Users/fzyz_sb/Desktop/splitter/splitter.pro + + splitter.pro + false + false + + 3768 + false + true + false + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 16 + + + Version + 16 + +