Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mahuifa
QMDemo
提交
6082e46c
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,体验更适合开发者的 AI 搜索 >>
提交
6082e46c
编写于
2月 12, 2023
作者:
mahuifa
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'Dev'
上级
c7df1cbc
f86f9f87
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
37 addition
and
17 deletion
+37
-17
FFmpegDemo/AVIOReading/AVIOReading.pro
FFmpegDemo/AVIOReading/AVIOReading.pro
+1
-1
FFmpegDemo/AVIOReading/widget.cpp
FFmpegDemo/AVIOReading/widget.cpp
+1
-1
FFmpegDemo/AVIOReading/widget.h
FFmpegDemo/AVIOReading/widget.h
+1
-1
FFmpegDemo/Screencap/Screencap.pro
FFmpegDemo/Screencap/Screencap.pro
+1
-1
FFmpegDemo/Screencap/Screencap/readthread.cpp
FFmpegDemo/Screencap/Screencap/readthread.cpp
+10
-0
FFmpegDemo/Screencap/widget.cpp
FFmpegDemo/Screencap/widget.cpp
+6
-4
FFmpegDemo/Screencap/widget.h
FFmpegDemo/Screencap/widget.h
+1
-1
FunctionalModule/FunctionalModule.pro
FunctionalModule/FunctionalModule.pro
+2
-2
FunctionalModule/NtpClient/NtpClient.pro
FunctionalModule/NtpClient/NtpClient.pro
+1
-1
FunctionalModule/NtpClient/ntpclient.cpp
FunctionalModule/NtpClient/ntpclient.cpp
+1
-1
OpenCVDemo/OpenCVDemo.pro
OpenCVDemo/OpenCVDemo.pro
+1
-2
QMDemo.pro
QMDemo.pro
+1
-1
QtChartsDemo/Audio/xyseriesiodevice.cpp
QtChartsDemo/Audio/xyseriesiodevice.cpp
+0
-1
QtChartsDemo/Audio/xyseriesiodevice.h
QtChartsDemo/Audio/xyseriesiodevice.h
+1
-0
Web/QtWebExamples/QtWebExamples.pro
Web/QtWebExamples/QtWebExamples.pro
+9
-0
未找到文件。
FFmpegDemo/AVIOReading/AVIOReading.pro
浏览文件 @
6082e46c
...
...
@@ -35,7 +35,7 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
!
isEmpty
(
target
.
path
)
:
INSTALLS
+=
target
#
定义程序版本号
VERSION
=
1.0
.
1
VERSION
=
1.0
.
2
DEFINES
+=
APP_VERSION
=
\\\
"$$VERSION\\\"
TARGET
=
AVIOReading
...
...
FFmpegDemo/AVIOReading/widget.cpp
浏览文件 @
6082e46c
...
...
@@ -14,7 +14,7 @@ extern "C" { // 用C规则编译指定的代码
typedef
struct
BufferData
{
uchar
*
ptr
;
quint64
size
;
// 缓冲区中剩余的大小
size_t
size
;
// 缓冲区中剩余的大小
}
BufferData
;
Widget
::
Widget
(
QWidget
*
parent
)
...
...
FFmpegDemo/AVIOReading/widget.h
浏览文件 @
6082e46c
...
...
@@ -37,7 +37,7 @@ private:
AVFormatContext
*
m_formatContext
=
nullptr
;
AVIOContext
*
m_avioContext
=
nullptr
;
uchar
*
m_buffer
=
nullptr
;
// 保存打开的媒体文件的所有数据
quint64
m_bufSize
=
0
;
// 打开的文件的总大小
size_t
m_bufSize
=
0
;
// 打开的文件的总大小
uchar
*
m_avioBuffer
=
nullptr
;
// 从m_buffer中一次读取的数据
int
m_avioBufSize
=
4096
;
// 从m_buffer中一次读取的数据长度
};
...
...
FFmpegDemo/Screencap/Screencap.pro
浏览文件 @
6082e46c
...
...
@@ -37,7 +37,7 @@ include(./Screencap/Screencap.pri)
INCLUDEPATH
+=
.
/
Screencap
#
定义程序版本号
VERSION
=
1.0
.
2
VERSION
=
1.0
.
3
DEFINES
+=
APP_VERSION
=
\\\
"$$VERSION\\\"
contains
(
QT_ARCH
,
i386
){
#
使用
32
位编译器
...
...
FFmpegDemo/Screencap/Screencap/readthread.cpp
浏览文件 @
6082e46c
...
...
@@ -6,6 +6,8 @@
#include <QTimer>
#include <QDebug>
#include <qimage.h>
#include <QFileInfo>
#include <QMessageBox>
ReadThread
::
ReadThread
(
QObject
*
parent
)
:
QThread
(
parent
)
{
...
...
@@ -31,6 +33,12 @@ void ReadThread::setPath(const QString &path)
{
if
(
path
.
isEmpty
())
return
;
if
(
QFileInfo
(
path
).
suffix
().
isEmpty
())
{
QMessageBox
::
warning
(
nullptr
,
"注意~"
,
"输入文件没有后缀名,无法使用"
);
m_path
.
clear
();
return
;
}
m_path
=
path
;
}
...
...
@@ -78,6 +86,8 @@ void sleepMsec(int msec)
void
ReadThread
::
run
()
{
if
(
m_path
.
isEmpty
())
return
;
bool
ret
=
m_videoDecode
->
open
(
m_url
);
// 打开网络流时会比较慢,如果放到Ui线程会卡
if
(
ret
)
{
...
...
FFmpegDemo/Screencap/widget.cpp
浏览文件 @
6082e46c
...
...
@@ -33,7 +33,7 @@ void Widget::on_but_open_clicked()
{
if
(
ui
->
but_open
->
text
()
==
"开始录屏"
)
{
setSavePath
()
;
if
(
!
setSavePath
())
return
;
#if defined(Q_OS_WIN)
m_readThread
->
open
(
"desktop"
);
#elif defined(Q_OS_LINUX)
...
...
@@ -70,18 +70,20 @@ void Widget::on_playState(ReadThread::PlayState state)
/**
* @brief 设置文件保存路径
*/
void
Widget
::
setSavePath
()
bool
Widget
::
setSavePath
()
{
QString
strDefault
=
QString
(
"%1/%2"
).
arg
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
MoviesLocation
))
// 如果不指定文件后缀则在linux下默认保存的视频文件没有后缀,就无法通过后缀名推测视频保存格式
QString
strDefault
=
QString
(
"%1/%2.mp4"
).
arg
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
MoviesLocation
))
.
arg
(
QDateTime
::
currentDateTime
().
toString
(
"yyyy-MM-dd HH-mm-ss"
));
QString
strPath
=
QFileDialog
::
getSaveFileName
(
this
,
"视频保存到~"
,
strDefault
,
"常用视频文件 (*.mp4 *.avi *.mov *.wmv *.flv *.h264 *.h265);;"
"其它文件格式 (*)"
);
if
(
strPath
.
isEmpty
())
return
;
if
(
strPath
.
isEmpty
())
return
false
;
ui
->
line_path
->
setText
(
strPath
);
m_readThread
->
setPath
(
strPath
);
return
true
;
}
/**
...
...
FFmpegDemo/Screencap/widget.h
浏览文件 @
6082e46c
...
...
@@ -21,7 +21,7 @@ private slots:
void
on_but_open_clicked
();
void
on_playState
(
ReadThread
::
PlayState
state
);
void
setSavePath
();
bool
setSavePath
();
void
on_timeout
();
private:
...
...
FunctionalModule/FunctionalModule.pro
浏览文件 @
6082e46c
...
...
@@ -10,15 +10,15 @@
#---------------------------------------------------------------------------------------
TEMPLATE
=
subdirs
SUBDIRS
+=
QMWidget
#
qt自定义窗口
SUBDIRS
+=
WindowRect
#
使用透明窗口框选鼠标所在窗口范围
SUBDIRS
+=
SnippingTool
#
Qt
实现截图工具
SUBDIRS
+=
DeviceManagement
#
串口、鼠标、键盘热插拔检测模块
SUBDIRS
+=
QLog
#
自定义日志系统
SUBDIRS
+=
QMPlayer
#
视频播放器界面
SUBDIRS
+=
NtpClient
#
NTP
时间同步客户端(需要管理员权限
/
超级用户权限打开)
SUBDIRS
+=
MouseKeyEvent
#
自定义全局鼠标键盘事件监听器
win32
{
SUBDIRS
+=
QMWidget
#
qt自定义窗口
SUBDIRS
+=
QMPlayer
#
视频播放器界面
SUBDIRS
+=
TestCrashHandler
#
windows下Qt程序崩溃问题定位Demo
(只在
msvc编译下有效
)
}
FunctionalModule/NtpClient/NtpClient.pro
浏览文件 @
6082e46c
...
...
@@ -49,7 +49,7 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
!
isEmpty
(
target
.
path
)
:
INSTALLS
+=
target
#
定义程序版本号
VERSION
=
1.0
.
1
VERSION
=
1.0
.
2
DEFINES
+=
APP_VERSION
=
\\\
"$$VERSION\\\"
contains
(
QT_ARCH
,
i386
){
#
使用
32
位编译器
...
...
FunctionalModule/NtpClient/ntpclient.cpp
浏览文件 @
6082e46c
...
...
@@ -202,7 +202,7 @@ void NtpClient::setDateTime(QDateTime& dateTime)
struct
timeval
tv
;
tptr
.
tm_year
=
date
.
year
()
-
1900
;
// 这里必须-1900,否则设置不成功
tptr
.
tm_mon
=
date
.
month
()
;
tptr
.
tm_mon
=
date
.
month
()
-
1
;
// 月份取值范围为[0-11]
tptr
.
tm_mday
=
date
.
day
();
tptr
.
tm_hour
=
time
.
hour
();
tptr
.
tm_min
=
time
.
minute
();
...
...
OpenCVDemo/OpenCVDemo.pro
浏览文件 @
6082e46c
...
...
@@ -10,5 +10,4 @@
#---------------------------------------------------------------------------------------
TEMPLATE
=
subdirs
SUBDIRS
+=
\
VideoPlay
SUBDIRS
+=
VideoPlay
QMDemo.pro
浏览文件 @
6082e46c
...
...
@@ -23,6 +23,6 @@ SUBDIRS += XlsxDemo # Qt使用QXlsx读写Excel Demo
SUBDIRS
+=
QtChartsDemo
#
Qt
使用
QtCharts
绘制图表
Demo
SUBDIRS
+=
QSqlDemo
#
Qt
使用数据库
Demo
SUBDIRS
+=
PaintingDemo
#
使用
QPainter
绘制图片
SUBDIRS
+=
Web
#
Qt
并发编程示例
SUBDIRS
+=
Web
#
Qt
+
web编程
SUBDIRS
+=
ConcurrentExamples
#
Qt
并发编程示例
QtChartsDemo/Audio/xyseriesiodevice.cpp
浏览文件 @
6082e46c
#
include
"xyseriesiodevice.h"
#include <QLineSeries>
#include <QPointF>
#include <qdebug.h>
#include <qvalueaxis.h>
...
...
QtChartsDemo/Audio/xyseriesiodevice.h
浏览文件 @
6082e46c
...
...
@@ -15,6 +15,7 @@
#include <QChartGlobal>
#include <QVector>
#include <QElapsedTimer>
#include <QPointF>
QT_CHARTS_BEGIN_NAMESPACE
class
QXYSeries
;
...
...
Web/QtWebExamples/QtWebExamples.pro
浏览文件 @
6082e46c
#---------------------------------------------------------------------
#
模块功能:
QWebEngineView
、
QtWebChannel
使用示例
#
支持编译器:
#
开发者:
mhf
#
邮箱
1603291350
@
qq
.
com
#
时间:
2023
/
02
/
03
#
错误解决:如果在
linux下编译报错
:-
1
:
error
:
/
opt
/
Qt5
.
14.2
/
5.14
.
2
/
gcc_64
/
lib
/
libQt5WebEngineCore
.
so
:
.
dynsym
local
symbol
at
index
3
(
>=
sh_info
of
3
)
#
则执行命令
sudo
ln
-
sf
/
usr
/
bin
/
x86_64
-
linux
-
gnu
-
ld
.
gold
/
usr
/
bin
/
ld
#---------------------------------------------------------------------
TEMPLATE
=
subdirs
#
只有当前系统、编译器支持
webenginewidgets模块才编译下列程序
(
MinGW
没有),这里
{
不能换行
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录