aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-07-27 22:27:07 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2014-07-27 22:27:07 +0200
commitc8e2fe1028f6463f7ca12bc231f1df3f898c8ff6 (patch)
treebd2feaf4768f27bd51ec3488186e3f2f2ec0889b
parent66e6a25b682debfa328b23056ff4050683054569 (diff)
qv4l2: use setResdOnly for disabled QLineEdit controls
This allows you to copy-and-paste the text and to scroll through it if the text is longer than the widget. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r--utils/qv4l2/ctrl-tab.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/utils/qv4l2/ctrl-tab.cpp b/utils/qv4l2/ctrl-tab.cpp
index 2277607d..bd023aab 100644
--- a/utils/qv4l2/ctrl-tab.cpp
+++ b/utils/qv4l2/ctrl-tab.cpp
@@ -375,7 +375,10 @@ void ApplicationWindow::addCtrl(QGridLayout *grid, const v4l2_query_ext_ctrl &qe
m_sigMapper->setMapping(m_widgetMap[qec.id], qec.id);
if (qec.flags & CTRL_FLAG_DISABLED) {
- m_widgetMap[qec.id]->setDisabled(true);
+ if (qobject_cast<QLineEdit *>(m_widgetMap[qec.id]))
+ static_cast<QLineEdit *>(m_widgetMap[qec.id])->setReadOnly(true);
+ else
+ m_widgetMap[qec.id]->setDisabled(true);
if (m_sliderMap.find(qec.id) != m_sliderMap.end())
m_sliderMap[qec.id]->setDisabled(true);
}
@@ -674,9 +677,15 @@ void ApplicationWindow::refresh(unsigned ctrl_class)
}
else
setVal(id, c[i].value);
- m_widgetMap[id]->setDisabled(m_ctrlMap[id].flags & CTRL_FLAG_DISABLED);
+
+ bool disabled = m_ctrlMap[id].flags & CTRL_FLAG_DISABLED;
+
+ if (qobject_cast<QLineEdit *>(m_widgetMap[id]))
+ static_cast<QLineEdit *>(m_widgetMap[id])->setReadOnly(disabled);
+ else
+ m_widgetMap[id]->setDisabled(disabled);
if (m_sliderMap.find(id) != m_sliderMap.end())
- m_sliderMap[id]->setDisabled(m_ctrlMap[id].flags & CTRL_FLAG_DISABLED);
+ m_sliderMap[id]->setDisabled(disabled);
}
}
delete [] c;

Privacy Policy