From: Anton Arbring Date: Thu, 17 Jul 2014 09:06:51 +0000 (+0200) Subject: qv4l2: added icon and moved label X-Git-Tag: v4l-utils-1.3.90~103 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2d2aea0a38dafa61a4ff0e541b60386f5a142e41;p=platform%2Fupstream%2Fv4l-utils.git qv4l2: added icon and moved label For auto generated buttons, the text of the button is now used as labels and the buttons are now QToolButtons with enter key icons Signed-off-by: Anton Arbring Signed-off-by: Hans Verkuil --- diff --git a/utils/qv4l2/ctrl-tab.cpp b/utils/qv4l2/ctrl-tab.cpp index 0adbd4a..46a22b5 100644 --- a/utils/qv4l2/ctrl-tab.cpp +++ b/utils/qv4l2/ctrl-tab.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -59,7 +60,8 @@ static bool is_valid_type(__u32 type) void ApplicationWindow::addWidget(QGridLayout *grid, QWidget *w, Qt::Alignment align) { - if (m_col % 2) + QToolButton *tb; + if (m_col % 2 && !(tb = qobject_cast(w))) w->setMinimumWidth(m_minWidth); if (w->sizeHint().width() > m_maxw[m_col]) m_maxw[m_col] = w->sizeHint().width(); @@ -371,8 +373,10 @@ void ApplicationWindow::addCtrl(QGridLayout *grid, const v4l2_queryctrl &qctrl) break; case V4L2_CTRL_TYPE_BUTTON: - addLabel(grid, ""); - m_widgetMap[qctrl.id] = new QPushButton((char *)qctrl.name, p); + addLabel(grid, (char *)qctrl.name); + QToolButton *button; + m_widgetMap[qctrl.id] = button = new QToolButton(p); + button->setIcon(QIcon(":/enterbutt.png")); addWidget(grid, m_widgetMap[qctrl.id]); connect(m_widgetMap[qctrl.id], SIGNAL(clicked()), m_sigMapper, SLOT(map())); diff --git a/utils/qv4l2/enterbutt.png b/utils/qv4l2/enterbutt.png new file mode 100644 index 0000000..911d0b0 Binary files /dev/null and b/utils/qv4l2/enterbutt.png differ diff --git a/utils/qv4l2/qv4l2.qrc b/utils/qv4l2/qv4l2.qrc index 7ccbfe6..469423b 100644 --- a/utils/qv4l2/qv4l2.qrc +++ b/utils/qv4l2/qv4l2.qrc @@ -8,5 +8,6 @@ saveraw.png video-television.png qv4l2.png + enterbutt.png