Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
e4cf3297
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e4cf3297
编写于
8月 17, 2016
作者:
P
Pavel Rojtberg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
highgui: allow specifying that a button should create a new buttonbar
上级
89833fa0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
5 deletion
+13
-5
modules/highgui/include/opencv2/highgui.hpp
modules/highgui/include/opencv2/highgui.hpp
+7
-4
modules/highgui/src/window_QT.cpp
modules/highgui/src/window_QT.cpp
+6
-1
未找到文件。
modules/highgui/include/opencv2/highgui.hpp
浏览文件 @
e4cf3297
...
...
@@ -239,9 +239,10 @@ enum QtFontStyles {
//! Qt "button" type
enum
QtButtonTypes
{
QT_PUSH_BUTTON
=
0
,
//!< Push button.
QT_CHECKBOX
=
1
,
//!< Checkbox button.
QT_RADIOBOX
=
2
//!< Radiobox button.
QT_PUSH_BUTTON
=
0
,
//!< Push button.
QT_CHECKBOX
=
1
,
//!< Checkbox button.
QT_RADIOBOX
=
2
,
//!< Radiobox button.
QT_NEW_BUTTONBAR
=
1024
//!< Button should create a new buttonbar
};
/** @brief Callback function for mouse events. see cv::setMouseCallback
...
...
@@ -719,7 +720,8 @@ CV_EXPORTS void stopLoop();
The function createButton attaches a button to the control panel. Each button is added to a
buttonbar to the right of the last button. A new buttonbar is created if nothing was attached to the
control panel before, or if the last element attached to the control panel was a trackbar.
control panel before, or if the last element attached to the control panel was a trackbar or if the
QT_NEW_BUTTONBAR flag is added to the type.
See below various examples of the cv::createButton function call: :
@code
...
...
@@ -728,6 +730,7 @@ See below various examples of the cv::createButton function call: :
createButton("button3",callbackButton,&value);
createButton("button5",callbackButton1,NULL,QT_RADIOBOX);
createButton("button6",callbackButton2,NULL,QT_PUSH_BUTTON,1);
createButton("button6",callbackButton2,NULL,QT_PUSH_BUTTON|QT_NEW_BUTTONBAR);// create a push button in a new row
@endcode
@param bar_name Name of the button.
...
...
modules/highgui/src/window_QT.cpp
浏览文件 @
e4cf3297
...
...
@@ -1139,13 +1139,18 @@ void GuiReceiver::addButton(QString button_name, int button_type, int initial_bu
{
CvBar
*
lastbar
=
(
CvBar
*
)
global_control_panel
->
myLayout
->
itemAt
(
global_control_panel
->
myLayout
->
count
()
-
1
);
if
(
lastbar
->
type
==
type_CvTrackbar
)
//if last bar is a trackbar, create a new buttonbar, else, attach to the current bar
// if last bar is a trackbar or the user requests a new buttonbar, create a new buttonbar
// else, attach to the current bar
if
(
lastbar
->
type
==
type_CvTrackbar
||
cv
::
QT_NEW_BUTTONBAR
&
button_type
)
b
=
CvWindow
::
createButtonBar
(
button_name
);
//the bar has the name of the first button attached to it
else
b
=
(
CvButtonbar
*
)
lastbar
;
}
// unset buttonbar flag
button_type
=
button_type
&
~
cv
::
QT_NEW_BUTTONBAR
;
b
->
addButton
(
button_name
,
(
CvButtonCallback
)
on_change
,
userdata
,
button_type
,
initial_button_state
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录