Removed a few references to this-pointer and made some small cosmetic changes
authorPekka Nissinen <pekka.nissinen@ixonos.com>
Mon, 16 Aug 2010 13:50:30 +0000 (16:50 +0300)
committerPekka Nissinen <pekka.nissinen@ixonos.com>
Mon, 16 Aug 2010 13:50:30 +0000 (16:50 +0300)
src/ui/panelbar.cpp
src/ui/panelcontentstack.h
src/ui/paneltab.cpp
src/ui/paneltabbar.cpp
src/ui/tabbedpanel.cpp

index 7044eed..bf76164 100644 (file)
@@ -38,7 +38,7 @@ PanelBar::PanelBar(QWidget *parent)
     ///< @todo magic
     m_barRect.setRect(0, 0, PANEL_BAR_WIDTH, PANEL_HEIGHT);
 
-    this->resize(PANEL_BAR_WIDTH, PANEL_HEIGHT);
+    resize(PANEL_BAR_WIDTH, PANEL_HEIGHT);
 }
 
 void PanelBar::paintEvent(QPaintEvent *event)
@@ -62,5 +62,5 @@ void PanelBar::resizeBar(const QSize &size)
     ///< @todo magic
     m_barRect.setRect(0, 0, PANEL_BAR_WIDTH, size.height());
 
-    this->resize(PANEL_BAR_WIDTH, size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING);
+    resize(PANEL_BAR_WIDTH, size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING);
 }
index e8515a8..fe284f5 100644 (file)
@@ -26,7 +26,7 @@
 #include <QStackedWidget>
 
 /**
- * @brief Stack class for tabbed pabel widgets
+ * @brief Stack class for tabbed panel widgets
  *
  * @author Kaj Wallin - kaj.wallin (at) ixonos.com
  * @author Pekka Nissinen - pekka.nissinen@ixonos.com
index 68a74c0..12fad9b 100644 (file)
@@ -49,8 +49,8 @@ void PanelTab::mouseMoveEvent(QMouseEvent *event)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    if(m_tabSelected) {
-        if(!rect().contains(event->pos()))
+    if (m_tabSelected) {
+        if (!rect().contains(event->pos()))
             setDown(false);
         else
             setDown(true);
@@ -61,7 +61,7 @@ void PanelTab::mousePressEvent(QMouseEvent *event)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    if(event->button() == Qt::LeftButton) {
+    if (event->button() == Qt::LeftButton) {
         setDown(true);
         m_tabSelected = true;
     }
@@ -72,10 +72,10 @@ void PanelTab::mouseReleaseEvent(QMouseEvent *event)
     qDebug() << __PRETTY_FUNCTION__;
 
     if (event->button() == Qt::LeftButton) {
-        if(this->rect().contains(event->pos())) {
+        if (rect().contains(event->pos())) {
             click();
 
-            if(isChecked())
+            if (isChecked())
                 setChecked(false);
             else
                 setChecked(true);
@@ -96,7 +96,7 @@ void PanelTab::paintEvent(QPaintEvent *event)
 
     QPainter painter(this);
 
-    if(isChecked()) {
+    if (isChecked()) {
         m_tabRect.setRect(0, 0, TAB_WIDTH_ACTIVE, TAB_HEIGHT);
         painter.drawPixmap(m_tabRect, m_tabActiveImage);
     } else {
@@ -104,9 +104,9 @@ void PanelTab::paintEvent(QPaintEvent *event)
         painter.drawPixmap(m_tabRect, m_tabInactiveImage);
     }
 
-    if(isDown())
+    if (isDown())
         icon().paint(&painter, m_tabRect, Qt::AlignCenter, QIcon::Selected);
-    else if(isChecked())
+    else if (isChecked())
         icon().paint(&painter, m_tabRect, Qt::AlignCenter, QIcon::Normal);
     else
         icon().paint(&painter, m_tabRect, Qt::AlignCenter, QIcon::Disabled);
index 4a43ba2..4decac6 100644 (file)
@@ -60,13 +60,15 @@ int PanelTabBar::insertTab(int index, const QIcon& icon)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    int verticalStartPoint = 8;
+    const int TAB_BAR_TOP_SPACING = 8;
+
+    int verticalStartPoint = TAB_BAR_TOP_SPACING;
 
     m_tabButtonGroup->addButton(new PanelTab(this), index);
     m_tabButtonGroup->button(index)->setIcon(icon);
 
     ///< @todo  [BEGIN]: Purkkaa (to be removed ASAP!!!)
-    if(index > 0)
+    if (index > 0)
         verticalStartPoint += 65 * index;
 
     m_tabButtonGroup->button(index)->move(0, verticalStartPoint);
@@ -79,7 +81,7 @@ void PanelTabBar::removeTab(int index)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    if(QAbstractButton *tab = m_tabButtonGroup->button(index)) {
+    if (QAbstractButton *tab = m_tabButtonGroup->button(index)) {
         m_tabButtonGroup->removeButton(tab);
         delete tab;
     }
@@ -97,7 +99,7 @@ void PanelTabBar::setCurrentIndex(int index)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    if(m_activeTab == index) {
+    if (m_activeTab == index) {
         ///< @todo magic
         m_activeTab = -1;
         emit tabCloseRequested(index);
index 311bd66..0e28947 100644 (file)
@@ -103,7 +103,7 @@ void TabbedPanel::closePanel()
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    if(m_isOpen)
+    if (m_isOpen)
         emit toggleState();
 }
 
@@ -121,7 +121,7 @@ void TabbedPanel::removeTab(int index)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    if(QWidget *widget = m_panelContentStack->widget(index)) {
+    if (QWidget *widget = m_panelContentStack->widget(index)) {
         m_panelContentStack->removeWidget(widget);
         m_panelTabBar->removeTab(index);
     }
@@ -165,7 +165,7 @@ void TabbedPanel::setCurrentIndex(int index)
     if ((index < m_panelContentStack->count()) && (index >= 0)) {
         m_panelContentStack->setCurrentIndex(index);
 
-        if(!m_isOpen)
+        if (!m_isOpen)
             emit toggleState();
 
         emit currentChanged(index);
@@ -176,7 +176,7 @@ void TabbedPanel::stateChanged()
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    if(!m_isOpen) {
+    if (!m_isOpen) {
         m_isOpen = true;
         emit panelOpened();
     } else {