aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-07-27 23:02:13 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2014-07-27 23:02:13 +0200
commita028340ce9e0230732f9c301373014ca90144642 (patch)
tree023582a9ee275d51563ced3c5aeda4e3fd21dcdf
parentc8e2fe1028f6463f7ca12bc231f1df3f898c8ff6 (diff)
qv4l2: missed one more place where QLineEdits were disabled.
Use setReadOnly instead for QLineEdit widgets. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r--utils/qv4l2/qv4l2.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/utils/qv4l2/qv4l2.cpp b/utils/qv4l2/qv4l2.cpp
index 3c11ddc4..6daa0956 100644
--- a/utils/qv4l2/qv4l2.cpp
+++ b/utils/qv4l2/qv4l2.cpp
@@ -373,9 +373,15 @@ void ApplicationWindow::ctrlEvent()
m_ctrlMap[ev.id].maximum = ev.u.ctrl.maximum;
m_ctrlMap[ev.id].step = ev.u.ctrl.step;
m_ctrlMap[ev.id].default_value = ev.u.ctrl.default_value;
- m_widgetMap[ev.id]->setDisabled(m_ctrlMap[ev.id].flags & CTRL_FLAG_DISABLED);
+
+ bool disabled = m_ctrlMap[ev.id].flags & CTRL_FLAG_DISABLED;
+
+ if (qobject_cast<QLineEdit *>(m_widgetMap[ev.id]))
+ static_cast<QLineEdit *>(m_widgetMap[ev.id])->setReadOnly(disabled);
+ else
+ m_widgetMap[ev.id]->setDisabled(disabled);
if (m_sliderMap.find(ev.id) != m_sliderMap.end())
- m_sliderMap[ev.id]->setDisabled(m_ctrlMap[ev.id].flags & CTRL_FLAG_DISABLED);
+ m_sliderMap[ev.id]->setDisabled(disabled);
if (ev.u.ctrl.changes & V4L2_EVENT_CTRL_CH_RANGE)
updateCtrlRange(ev.id, ev.u.ctrl.value);
switch (m_ctrlMap[ev.id].type) {

Privacy Policy