diff options
authorHans Verkuil <hans.verkuil@cisco.com>2014-07-23 15:47:50 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2014-07-23 15:47:50 +0200
commit4d94fb69ec108146f711e03b8c34e665a3434e44 (patch)
parent340a7da4a051573d4b67116b465f89d01a7806e7 (diff)
qv4l2: fix layout issues related to stacked widgets
I've been digging into why on my laptop the stacked frames in the Input section appear shifted to the right. The reason is that the initial loop in fixWidth() sets the minimumwidth without looking at what the widget is. After some debugging I found out that it was setting the minimumwidth for the wFrameSR widget. So I added checks that it only changes it for comboboxes, spinboxes and sliders. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
1 files changed, 5 insertions, 0 deletions
diff --git a/utils/qv4l2/general-tab.cpp b/utils/qv4l2/general-tab.cpp
index 74534d06..d7c4ea41 100644
--- a/utils/qv4l2/general-tab.cpp
+++ b/utils/qv4l2/general-tab.cpp
@@ -855,6 +855,11 @@ void GeneralTab::fixWidth()
QList<QWidget *> list = parentWidget()->findChildren<QWidget *>();
QList<QWidget *>::iterator it;
for (it = list.begin(); it != list.end(); ++it) {
+ if (!qobject_cast<QComboBox *>(*it) &&
+ !qobject_cast<QSpinBox *>(*it) &&
+ !qobject_cast<QSlider *>(*it))
+ continue;
if (((*it)->sizeHint().width()) > m_minWidth) {
m_increment = (int) ceil(((*it)->sizeHint().width() - m_minWidth) / m_pxw);
(*it)->setMinimumWidth(m_minWidth + m_increment * m_pxw); // for stepsize expansion of widgets

Privacy Policy