提交 708c1c3f 编写于 作者: mahuifa's avatar mahuifa

新功能:增加QTransform示例

上级 d2899728
...@@ -5,4 +5,5 @@ SUBDIRS += Imagecomposition # QPainter图像合成Demo ...@@ -5,4 +5,5 @@ SUBDIRS += Imagecomposition # QPainter图像合成Demo
SUBDIRS += Concentriccircles # QPainter绘制时【数据类型】和【抗锯齿】对效果的影响 SUBDIRS += Concentriccircles # QPainter绘制时【数据类型】和【抗锯齿】对效果的影响
SUBDIRS += PainterPaths # QPainterPath使用示例 SUBDIRS += PainterPaths # QPainterPath使用示例
SUBDIRS += Transformations # QPainter偏移原点、旋转、缩放功能Demo SUBDIRS += Transformations # QPainter偏移原点、旋转、缩放功能Demo
SUBDIRS += TransformDemo # QPainter偏移原点、旋转、缩放功能Demo
SUBDIRS += PlayImage # 使用 QPainter绘制图片 SUBDIRS += PlayImage # 使用 QPainter绘制图片
#---------------------------------------------------------------------------------------
# @功能: 使用QTransform类示例
# @编译器: Desktop Qt 5.12.5 MSVC2017 64bit(也支持其它编译器)
# @Qt IDE D:/Qt/Qt5.12.5/Tools/QtCreator/share/qtcreator
#
# @开发者 mhf
# @邮箱 1603291350@qq.com
# @时间 2022-09-21 17:02:31
# @备注
#---------------------------------------------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked 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 it uses 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
SOURCES += \
main.cpp \
renderarea.cpp \
widget.cpp
HEADERS += \
renderarea.h \
widget.h
FORMS += \
widget.ui
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
contains(QT_ARCH, i386){ # 使用32位编译器
DESTDIR = $$PWD/../bin # 程序输出路径
}else{
DESTDIR = $$PWD/../bin64 # 使用64位编译器
}
# msvc 编译器使用utf-8编码(好像只在msvc2017以后才有效
msvc {
QMAKE_CFLAGS += /utf-8
QMAKE_CXXFLAGS += /utf-8
}
#include "widget.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Widget w;
w.show();
return a.exec();
}
#include "widget.h"
#include "ui_widget.h"
Widget::Widget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::Widget)
{
ui->setupUi(this);
}
Widget::~Widget()
{
delete ui;
}
#ifndef WIDGET_H
#define WIDGET_H
#include <QWidget>
QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE
class Widget : public QWidget
{
Q_OBJECT
public:
Widget(QWidget *parent = nullptr);
~Widget();
private:
Ui::Widget *ui;
};
#endif // WIDGET_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Widget</class>
<widget class="QWidget" name="Widget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>Widget</string>
</property>
</widget>
<resources/>
<connections/>
</ui>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册