From 9183e2bb2055dcad2496fe1b1576f3751554bbe8 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Tue, 12 Nov 2013 21:14:29 +0100 Subject: [PATCH] Fix for OP-1099: Hidden icons in Configuration tab --- ground/openpilotgcs/src/libs/utils/mytabbedstackwidget.cpp | 7 ++++--- ground/openpilotgcs/src/libs/utils/mytabbedstackwidget.h | 7 +------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/ground/openpilotgcs/src/libs/utils/mytabbedstackwidget.cpp b/ground/openpilotgcs/src/libs/utils/mytabbedstackwidget.cpp index d8e5111d2..1a521c10d 100644 --- a/ground/openpilotgcs/src/libs/utils/mytabbedstackwidget.cpp +++ b/ground/openpilotgcs/src/libs/utils/mytabbedstackwidget.cpp @@ -36,20 +36,20 @@ MyTabbedStackWidget::MyTabbedStackWidget(QWidget *parent, bool isVertical, bool m_vertical(isVertical), m_iconAbove(iconAbove) { - m_listWidget = new QListWidget(this); + m_listWidget = new QListWidget(); m_stackWidget = new QStackedWidget(); m_stackWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding); QBoxLayout *toplevelLayout; if (m_vertical) { - toplevelLayout = new QHBoxLayout; + toplevelLayout = new QHBoxLayout(); toplevelLayout->addWidget(m_listWidget); toplevelLayout->addWidget(m_stackWidget); m_listWidget->setFlow(QListView::TopToBottom); m_listWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); m_listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); } else { - toplevelLayout = new QVBoxLayout; + toplevelLayout = new QVBoxLayout(); toplevelLayout->addWidget(m_stackWidget); toplevelLayout->addWidget(m_listWidget); m_listWidget->setFlow(QListView::LeftToRight); @@ -59,6 +59,7 @@ MyTabbedStackWidget::MyTabbedStackWidget(QWidget *parent, bool isVertical, bool if (m_iconAbove && m_vertical) { m_listWidget->setFixedWidth(80); // this should be computed instead + m_listWidget->setWrapping(false); } toplevelLayout->setSpacing(0); diff --git a/ground/openpilotgcs/src/libs/utils/mytabbedstackwidget.h b/ground/openpilotgcs/src/libs/utils/mytabbedstackwidget.h index d5e191028..c865ae141 100644 --- a/ground/openpilotgcs/src/libs/utils/mytabbedstackwidget.h +++ b/ground/openpilotgcs/src/libs/utils/mytabbedstackwidget.h @@ -51,10 +51,7 @@ public: int currentIndex() const; void insertCornerWidget(int index, QWidget *widget); - int cornerWidgetCount() - { - return m_cornerWidgetCount; - } + QWidget *currentWidget() { return m_stackWidget->currentWidget(); @@ -77,10 +74,8 @@ private slots: private: QListWidget *m_listWidget; QStackedWidget *m_stackWidget; - QWidget *m_selectionWidget; bool m_vertical; bool m_iconAbove; - int m_cornerWidgetCount; }; #endif // MYTABBEDSTACKWIDGET_H