Added a temporary borders around tab bar and context button bar. Used ONLY for debugg...
authorPekka Nissinen <pekka.nissinen@ixonos.com>
Mon, 30 Aug 2010 11:52:26 +0000 (14:52 +0300)
committerPekka Nissinen <pekka.nissinen@ixonos.com>
Mon, 30 Aug 2010 11:52:26 +0000 (14:52 +0300)
src/ui/panelcontextbuttonbar.cpp
src/ui/paneltabbar.cpp
src/ui/paneltabbar.h

index 48a15b4..be6e9d0 100644 (file)
@@ -100,6 +100,22 @@ bool PanelContextButtonBar::isBarVisible() const
     return m_visible;
 }
 
+void PanelContextButtonBar::move(int x, int y)
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    if (m_visible)
+        QWidget::move(x, y - height());
+    else
+        QWidget::move(x, y);
+
+    QPoint hiddenPosition(x, y);
+    m_stateHidden->assignProperty(this, "pos", hiddenPosition);
+
+    QPoint visiblePosition(x, y - height());
+    m_stateVisible->assignProperty(this, "pos", visiblePosition);
+}
+
 void PanelContextButtonBar::paintEvent(QPaintEvent *event)
 {
     qDebug() << __PRETTY_FUNCTION__;
@@ -119,22 +135,11 @@ void PanelContextButtonBar::paintEvent(QPaintEvent *event)
     painter.drawPixmap(CONTEXT_BUTTON_BAR_TOP_X, CONTEXT_BUTTON_BAR_TOP_Y, m_barTop);
     painter.drawTiledPixmap(m_barRect, m_barTile);
 
-}
-
-void PanelContextButtonBar::move(int x, int y)
-{
-    qDebug() << __PRETTY_FUNCTION__;
+    // Temporary border, REMOVE WHEN NOT NEEDED ANYMORE!
+    painter.setPen(Qt::red);
+    painter.drawRect(this->rect().x(), this->rect().y(),
+                     this->rect().width() - 1, this->rect().height() - 1);
 
-    if (m_visible)
-        QWidget::move(x, y - height());
-    else
-        QWidget::move(x, y);
-
-    QPoint hiddenPosition(x, y);
-    m_stateHidden->assignProperty(this, "pos", hiddenPosition);
-
-    QPoint visiblePosition(x, y - height());
-    m_stateVisible->assignProperty(this, "pos", visiblePosition);
 }
 
 void PanelContextButtonBar::setContextButtons(QWidget *contextButtons)
index c375a3c..8f394dd 100644 (file)
@@ -26,6 +26,9 @@
 
 #include "paneltabbar.h"
 
+// REMOVE WHEN NOT NEEDED ANYMORE
+#include <QPainter>
+
 const int APPEND_INDEX = -1;
 const int NO_ACTIVE_TABS = -1;
 
@@ -75,6 +78,20 @@ int PanelTabBar::insertTab(int index, const QIcon& icon)
     return index;
 }
 
+// Used to draw temporary border around widget, REMOVE WHEN NOT NEEDED ANYMORE!
+void PanelTabBar::paintEvent(QPaintEvent *event)
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    Q_UNUSED(event);
+
+    QPainter painter(this);
+
+    painter.setPen(Qt::red);
+    painter.drawRect(this->rect().x(), this->rect().y(),
+                     this->rect().width() - 1, this->rect().height() - 1);
+}
+
 void PanelTabBar::removeTab(int index)
 {
     qDebug() << __PRETTY_FUNCTION__;
index 9e555da..439ae07 100644 (file)
@@ -44,6 +44,13 @@ public:
     PanelTabBar(QWidget *parent = 0);
 
 /*******************************************************************************
+ * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
+ ******************************************************************************/
+protected:
+    // Used to draw temporary border around widget, REMOVE WHEN NOT NEEDED ANYMORE!
+    void paintEvent(QPaintEvent *event);
+
+/*******************************************************************************
  * MEMBER FUNCTIONS AND SLOTS
  ******************************************************************************/
 public: