From ddd9a2f72f895092d4de5f9ea3beab92084a46e6 Mon Sep 17 00:00:00 2001 From: touwoyimuli Date: Tue, 7 Jan 2020 20:09:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=9B=E5=BB=BA=20ExMyStyle=20?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E7=A9=BA=E7=9A=84Qt=E7=9A=84=E5=B7=A5?= =?UTF-8?q?=E7=A8=8B=EF=BC=8C=E7=94=A8=E6=9D=A5=E7=BC=96=E7=A0=81=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=8E=A7=E4=BB=B6=EF=BC=88=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=B1=82=E6=AC=A1=E7=9A=84=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E7=BB=98=E7=94=BB=E6=8E=A7=E4=BB=B6=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QtMyStyleEx/ExMyStyle.cpp | 29 +++++++++++++++++++++++++++++ QtMyStyleEx/ExMyStyle.h | 33 +++++++++++++++++++++++++++++++++ QtMyStyleEx/QtMyStyleEx.pro | 37 +++++++++++++++++++++++++++++++++++++ QtMyStyleEx/main.cpp | 29 +++++++++++++++++++++++++++++ 4 files changed, 128 insertions(+) create mode 100644 QtMyStyleEx/ExMyStyle.cpp create mode 100644 QtMyStyleEx/ExMyStyle.h create mode 100644 QtMyStyleEx/QtMyStyleEx.pro create mode 100644 QtMyStyleEx/main.cpp diff --git a/QtMyStyleEx/ExMyStyle.cpp b/QtMyStyleEx/ExMyStyle.cpp new file mode 100644 index 0000000..6b4f769 --- /dev/null +++ b/QtMyStyleEx/ExMyStyle.cpp @@ -0,0 +1,29 @@ +/* + * Author: touwoyimuli + * blogs: https://touwoyimuli.github.io/ + * + * Copyright 2019 touwoyimuli + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ExMyStyle.h" + +ExMyStyle::ExMyStyle(QWidget *parent) + : QDialog(parent) +{ +} + +ExMyStyle::~ExMyStyle() +{ + +} diff --git a/QtMyStyleEx/ExMyStyle.h b/QtMyStyleEx/ExMyStyle.h new file mode 100644 index 0000000..9a1ebd7 --- /dev/null +++ b/QtMyStyleEx/ExMyStyle.h @@ -0,0 +1,33 @@ +/* + * Author: touwoyimuli + * blogs: https://touwoyimuli.github.io/ + * + * Copyright 2019 touwoyimuli + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef EXMYSTYLE_H +#define EXMYSTYLE_H + +#include + +class ExMyStyle : public QDialog +{ + Q_OBJECT + +public: + ExMyStyle(QWidget *parent = 0); + ~ExMyStyle(); +}; + +#endif // EXMYSTYLE_H diff --git a/QtMyStyleEx/QtMyStyleEx.pro b/QtMyStyleEx/QtMyStyleEx.pro new file mode 100644 index 0000000..571e466 --- /dev/null +++ b/QtMyStyleEx/QtMyStyleEx.pro @@ -0,0 +1,37 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2020-01-07T20:08:35 +# +#------------------------------------------------- + +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = QtMyStyleEx +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 \ + ExMyStyle.cpp + +HEADERS += \ + ExMyStyle.h + +# 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/QtMyStyleEx/main.cpp b/QtMyStyleEx/main.cpp new file mode 100644 index 0000000..1cef55b --- /dev/null +++ b/QtMyStyleEx/main.cpp @@ -0,0 +1,29 @@ +/* + * Author: touwoyimuli + * blogs: https://touwoyimuli.github.io/ + * + * Copyright 2019 touwoyimuli + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ExMyStyle.h" +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + ExMyStyle w; + w.show(); + + return a.exec(); +}