From 2b6f66874e70e874d14cfc936a941f3fc0085fb8 Mon Sep 17 00:00:00 2001 From: Pekka Nissinen Date: Mon, 16 Aug 2010 10:22:28 +0300 Subject: [PATCH] Added missing comment blocks and cleaned up the code a bit --- src/ui/paneltab.cpp | 9 ++------- src/ui/paneltab.h | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/ui/paneltab.cpp b/src/ui/paneltab.cpp index 8db62d8..92ad68a 100644 --- a/src/ui/paneltab.cpp +++ b/src/ui/paneltab.cpp @@ -41,8 +41,6 @@ PanelTab::PanelTab(QWidget *parent) m_tabPixmaps[1].load(":/res/images/tab_inactive2.png"); m_tabPixmaps[2].load(":/res/images/tab_active.png"); -// m_tabRect.setRect(TAB_WIDTH_ACTIVE - TAB_WIDTH, 0, TAB_WIDTH, TAB_HEIGHT); - setCheckable(true); setFixedSize(TAB_WIDTH_ACTIVE, TAB_HEIGHT); @@ -77,13 +75,10 @@ void PanelTab::mouseReleaseEvent(QMouseEvent *event) if(this->rect().contains(event->pos())) { click(); - if(isChecked()) { + if(isChecked()) setChecked(false); -// m_tabRect.setRect(TAB_WIDTH_ACTIVE - TAB_WIDTH, 0, TAB_WIDTH, TAB_HEIGHT); - } else { + else setChecked(true); -// m_tabRect.setRect(0, 0, TAB_WIDTH_ACTIVE, TAB_HEIGHT); - } } setDown(false); diff --git a/src/ui/paneltab.h b/src/ui/paneltab.h index 30aa857..216b6e1 100644 --- a/src/ui/paneltab.h +++ b/src/ui/paneltab.h @@ -26,6 +26,11 @@ class QMouseEvent; +/** + * @brief Class for tab button + * + * @author Pekka Nissinen - pekka.nissinen@ixonos.com + */ class PanelTab : public QToolButton { Q_OBJECT @@ -74,18 +79,21 @@ protected: * MEMBER FUNCTIONS AND SLOTS ******************************************************************************/ public: + /** + * @brief This slot is used to change tab button state + */ void setActive(bool state); /******************************************************************************* * DATA MEMBERS ******************************************************************************/ private: - bool m_tabActive; - bool m_tabSelected; + bool m_tabActive; ///< Boolean used to track whether the tab button is active or not + bool m_tabSelected; ///< Boolean used to track whether the tab button is selected or not - QPixmap m_tabPixmaps[3]; + QPixmap m_tabPixmaps[3]; ///< Pixmap table for tab button images - QRect m_tabRect; + QRect m_tabRect; ///< Rect for the tab button }; #endif // PANELTAB_H -- 1.7.9.5