Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
尘离序散
obs-studio
提交
efb09d4f
O
obs-studio
项目概览
尘离序散
/
obs-studio
与 Fork 源项目一致
从无法访问的项目Fork
通知
30
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
obs-studio
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
efb09d4f
编写于
4月 13, 2019
作者:
C
Colin Edwards
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
UI: Remove SourceListWidget
上级
975aed83
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
0 addition
and
70 deletion
+0
-70
UI/CMakeLists.txt
UI/CMakeLists.txt
+0
-2
UI/source-list-widget.cpp
UI/source-list-widget.cpp
+0
-46
UI/source-list-widget.hpp
UI/source-list-widget.hpp
+0
-22
未找到文件。
UI/CMakeLists.txt
浏览文件 @
efb09d4f
...
...
@@ -241,7 +241,6 @@ set(obs_SOURCES
vertical-scroll-area.cpp
visibility-item-widget.cpp
slider-absoluteset-style.cpp
source-list-widget.cpp
qt-display.cpp
crash-report.cpp
hotkey-edit.cpp
...
...
@@ -296,7 +295,6 @@ set(obs_HEADERS
vertical-scroll-area.hpp
visibility-item-widget.hpp
slider-absoluteset-style.hpp
source-list-widget.hpp
qt-display.hpp
crash-report.hpp
hotkey-edit.hpp
...
...
UI/source-list-widget.cpp
已删除
100644 → 0
浏览文件 @
975aed83
#include <QMouseEvent>
#include <vector>
#include "qt-wrappers.hpp"
#include "source-list-widget.hpp"
Q_DECLARE_METATYPE
(
OBSSceneItem
);
void
SourceListWidget
::
mouseDoubleClickEvent
(
QMouseEvent
*
event
)
{
if
(
event
->
button
()
==
Qt
::
LeftButton
)
QListWidget
::
mouseDoubleClickEvent
(
event
);
}
void
SourceListWidget
::
dropEvent
(
QDropEvent
*
event
)
{
QListWidget
::
dropEvent
(
event
);
if
(
!
event
->
isAccepted
()
||
!
count
())
return
;
auto
GetSceneItem
=
[
&
](
int
i
)
{
return
item
(
i
)
->
data
(
Qt
::
UserRole
).
value
<
OBSSceneItem
>
();
};
std
::
vector
<
obs_sceneitem_t
*>
newOrder
;
newOrder
.
reserve
(
count
());
for
(
int
i
=
count
()
-
1
;
i
>=
0
;
i
--
)
newOrder
.
push_back
(
GetSceneItem
(
i
));
auto
UpdateOrderAtomically
=
[
&
](
obs_scene_t
*
scene
)
{
ignoreReorder
=
true
;
obs_scene_reorder_items
(
scene
,
newOrder
.
data
(),
newOrder
.
size
());
ignoreReorder
=
false
;
};
using
UpdateOrderAtomically_t
=
decltype
(
UpdateOrderAtomically
);
auto
scene
=
obs_sceneitem_get_scene
(
GetSceneItem
(
0
));
obs_scene_atomic_update
(
scene
,
[](
void
*
data
,
obs_scene_t
*
scene
)
{
(
*
static_cast
<
UpdateOrderAtomically_t
*>
(
data
))(
scene
);
},
static_cast
<
void
*>
(
&
UpdateOrderAtomically
));
}
UI/source-list-widget.hpp
已删除
100644 → 0
浏览文件 @
975aed83
#pragma once
#include <QListWidget>
class
QMouseEvent
;
class
SourceListWidget
:
public
QListWidget
{
Q_OBJECT
bool
ignoreReorder
=
false
;
public:
inline
SourceListWidget
(
QWidget
*
parent
=
nullptr
)
:
QListWidget
(
parent
)
{
}
bool
IgnoreReorder
()
const
{
return
ignoreReorder
;
}
protected:
virtual
void
mouseDoubleClickEvent
(
QMouseEvent
*
event
)
override
;
virtual
void
dropEvent
(
QDropEvent
*
event
)
override
;
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录