Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mahuifa
QMDemo
提交
ee36f95c
Q
QMDemo
项目概览
mahuifa
/
QMDemo
通知
1
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
QMDemo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ee36f95c
编写于
7月 13, 2022
作者:
mahuifa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加PaintingDemo
上级
0f2a44bb
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
374 addition
and
0 deletion
+374
-0
PaintingDemo/PaintingDemo.pro
PaintingDemo/PaintingDemo.pro
+3
-0
PaintingDemo/basicdrawing/basicdrawing.pro
PaintingDemo/basicdrawing/basicdrawing.pro
+50
-0
PaintingDemo/basicdrawing/main.cpp
PaintingDemo/basicdrawing/main.cpp
+11
-0
PaintingDemo/basicdrawing/renderarea.cpp
PaintingDemo/basicdrawing/renderarea.cpp
+18
-0
PaintingDemo/basicdrawing/renderarea.h
PaintingDemo/basicdrawing/renderarea.h
+22
-0
PaintingDemo/basicdrawing/widget.cpp
PaintingDemo/basicdrawing/widget.cpp
+20
-0
PaintingDemo/basicdrawing/widget.h
PaintingDemo/basicdrawing/widget.h
+24
-0
PaintingDemo/basicdrawing/widget.ui
PaintingDemo/basicdrawing/widget.ui
+226
-0
未找到文件。
PaintingDemo/PaintingDemo.pro
0 → 100644
浏览文件 @
ee36f95c
TEMPLATE
=
subdirs
SUBDIRS
+=
basicdrawing
PaintingDemo/basicdrawing/basicdrawing.pro
0 → 100644
浏览文件 @
ee36f95c
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
=
0
x060000
#
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
#
程序版本
VERSION
=
1.0
.
0.0
#
程序图标
#
RC_ICONS
=
app
.
ico
#
公司名称
QMAKE_TARGET_COMPANY
=
"company"
#
程序说明
QMAKE_TARGET_DESCRIPTION
=
"test app"
#
版权信息
QMAKE_TARGET_COPYRIGHT
=
"Copyright(C) 2017"
#
程序名称
QMAKE_TARGET_PRODUCT
=
"app"
#
程序语言
#
0
x0800代表和系统当前语言一致
RC_LANG
=
0
x0800
PaintingDemo/basicdrawing/main.cpp
0 → 100644
浏览文件 @
ee36f95c
#include "widget.h"
#include <QApplication>
int
main
(
int
argc
,
char
*
argv
[])
{
QApplication
a
(
argc
,
argv
);
Widget
w
;
w
.
show
();
return
a
.
exec
();
}
PaintingDemo/basicdrawing/renderarea.cpp
0 → 100644
浏览文件 @
ee36f95c
#include "renderarea.h"
#include <QDebug>
#include <QFile>
#include <QPainter>
#include <QTextDocument>
RenderArea
::
RenderArea
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
// 设置背景填充色
this
->
setBackgroundRole
(
QPalette
::
Base
);
this
->
setAutoFillBackground
(
true
);
}
void
RenderArea
::
paintEvent
(
QPaintEvent
*
event
)
{
}
PaintingDemo/basicdrawing/renderarea.h
0 → 100644
浏览文件 @
ee36f95c
#ifndef RENDERAREA_H
#define RENDERAREA_H
#include <QWidget>
class
RenderArea
:
public
QWidget
{
Q_OBJECT
public:
explicit
RenderArea
(
QWidget
*
parent
=
nullptr
);
signals:
public
slots
:
protected:
void
paintEvent
(
QPaintEvent
*
event
)
override
;
QByteArray
m_html
;
};
#endif // RENDERAREA_H
PaintingDemo/basicdrawing/widget.cpp
0 → 100644
浏览文件 @
ee36f95c
#include "widget.h"
#include "ui_widget.h"
Widget
::
Widget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
,
ui
(
new
Ui
::
Widget
)
{
ui
->
setupUi
(
this
);
}
Widget
::~
Widget
()
{
delete
ui
;
}
void
Widget
::
init
()
{
}
PaintingDemo/basicdrawing/widget.h
0 → 100644
浏览文件 @
ee36f95c
#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:
void
init
();
private:
Ui
::
Widget
*
ui
;
};
#endif // WIDGET_H
PaintingDemo/basicdrawing/widget.ui
0 → 100644
浏览文件 @
ee36f95c
<?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>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"0"
column=
"0"
>
<widget
class=
"RenderArea"
name=
"widget"
native=
"true"
/>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QDockWidget"
name=
"dockWidget"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Fixed"
vsizetype=
"Preferred"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
250
</width>
<height>
524287
</height>
</size>
</property>
<widget
class=
"QWidget"
name=
"dockWidgetContents"
>
<layout
class=
"QGridLayout"
name=
"gridLayout_3"
>
<item
row=
"0"
column=
"0"
colspan=
"2"
>
<layout
class=
"QGridLayout"
name=
"gridLayout_2"
>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
形状:
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
</set>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QComboBox"
name=
"com_shape"
/>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
<string>
画笔样式:
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
</set>
</property>
</widget>
</item>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QComboBox"
name=
"comboBox_2"
/>
</item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_4"
>
<property
name=
"text"
>
<string>
笔帽样式:
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
</set>
</property>
</widget>
</item>
<item
row=
"2"
column=
"1"
>
<widget
class=
"QComboBox"
name=
"comboBox_3"
/>
</item>
<item
row=
"3"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_5"
>
<property
name=
"text"
>
<string>
笔连接样式:
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
</set>
</property>
</widget>
</item>
<item
row=
"3"
column=
"1"
>
<widget
class=
"QComboBox"
name=
"comboBox_4"
/>
</item>
<item
row=
"4"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_6"
>
<property
name=
"text"
>
<string>
笔刷样式:
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
</set>
</property>
</widget>
</item>
<item
row=
"4"
column=
"1"
>
<widget
class=
"QComboBox"
name=
"comboBox_5"
/>
</item>
<item
row=
"5"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_3"
>
<property
name=
"text"
>
<string>
画笔粗细:
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
</set>
</property>
</widget>
</item>
<item
row=
"5"
column=
"1"
>
<widget
class=
"QSpinBox"
name=
"spinBox"
>
<property
name=
"value"
>
<number>
1
</number>
</property>
</widget>
</item>
<item
row=
"6"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_8"
>
<property
name=
"text"
>
<string>
原点水平偏移:
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
</set>
</property>
</widget>
</item>
<item
row=
"6"
column=
"1"
>
<widget
class=
"QSlider"
name=
"horizontalSlider_2"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
</widget>
</item>
<item
row=
"7"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_9"
>
<property
name=
"text"
>
<string>
原点垂直偏移:
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
</set>
</property>
</widget>
</item>
<item
row=
"7"
column=
"1"
>
<widget
class=
"QSlider"
name=
"horizontalSlider_3"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
</widget>
</item>
<item
row=
"8"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_7"
>
<property
name=
"text"
>
<string>
缩放:
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
</set>
</property>
</widget>
</item>
<item
row=
"8"
column=
"1"
>
<widget
class=
"QSlider"
name=
"horizontalSlider"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
</widget>
</item>
<item
row=
"9"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_10"
>
<property
name=
"text"
>
<string>
旋转:
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
</set>
</property>
</widget>
</item>
<item
row=
"9"
column=
"1"
>
<widget
class=
"QSlider"
name=
"horizontalSlider_4"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
</widget>
</item>
</layout>
</item>
<item
row=
"2"
column=
"1"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
247
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"1"
column=
"0"
colspan=
"2"
>
<widget
class=
"QCheckBox"
name=
"checkBox"
>
<property
name=
"text"
>
<string>
抗锯齿
</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>
RenderArea
</class>
<extends>
QWidget
</extends>
<header>
renderarea.h
</header>
<container>
1
</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录