diff options
author | Olli Werwolff <qt-info@nokia.com> | 2011-04-28 14:23:34 +0200 |
---|---|---|
committer | Olli Werwolff <qt-info@nokia.com> | 2011-04-28 14:23:34 +0200 |
commit | 4f0a47368d94a7d8d44749fea080dc98af2fb598 (patch) | |
tree | 555687e02d47ce66bcda7bb4941e8d8ce2848d6c | |
parent | 02d54472cb86424faaab4ddef27ef306037fc5e4 (diff) |
Some code cleanup
-rw-r--r-- | library/remotecontrolwidget.cpp | 6 | ||||
-rw-r--r-- | library/remotecontrolwidget.h | 2 | ||||
-rw-r--r-- | library/toolbox.cpp | 5 |
3 files changed, 4 insertions, 9 deletions
diff --git a/library/remotecontrolwidget.cpp b/library/remotecontrolwidget.cpp index cd444b1..48da744 100644 --- a/library/remotecontrolwidget.cpp +++ b/library/remotecontrolwidget.cpp @@ -179,7 +179,7 @@ void RemoteControlWidget::addMenuOption(const QString &title, QWidget *target, P connect(target, SIGNAL(visibilityChanged(bool)), action, SLOT(setChecked(bool))); connect(target, SIGNAL(visibilityChanged(bool)), toolButton, SLOT(setChecked(bool))); - connect(target, SIGNAL(visibilityChanged(bool)), this, SLOT(showPage(bool))); + connect(target, SIGNAL(visibilityChanged(bool)), this, SLOT(scrollToPage(bool))); } void RemoteControlWidget::addPage(ToolBoxPage *page) @@ -283,9 +283,9 @@ void RemoteControlWidget::initializeMenuArea() addPage(new MenuUi(mButtonBox, this)); } -void RemoteControlWidget::showPage(bool visible) +void RemoteControlWidget::scrollToPage(bool scroll) { - if (!visible) + if (!scroll) return; QWidget *widget = qobject_cast<QWidget *>(sender()); diff --git a/library/remotecontrolwidget.h b/library/remotecontrolwidget.h index 62b8d9b..075d8e7 100644 --- a/library/remotecontrolwidget.h +++ b/library/remotecontrolwidget.h @@ -67,7 +67,7 @@ public: private slots: void changeFilters(); - void showPage(bool visibile); + void scrollToPage(bool scroll); private: struct PageState { diff --git a/library/toolbox.cpp b/library/toolbox.cpp index d5df1e9..fd1a350 100644 --- a/library/toolbox.cpp +++ b/library/toolbox.cpp @@ -172,15 +172,10 @@ void ToolBoxPage::init() void ToolBoxPage::showContent(bool show) { - QVBoxLayout *vLayout = qobject_cast<QVBoxLayout*>(layout()); if (show) { - if (vLayout->indexOf(mPage) == -1) - vLayout->addWidget(mPage); mPage->show(); mButton->setArrowType(Qt::DownArrow); } else { - if (vLayout->indexOf(mPage) != -1) - vLayout->removeWidget(mPage); mPage->hide(); mButton->setArrowType(Qt::RightArrow); } |