m_distance = distance;
- if (m_distance < MIN_TO_METERS)
- {
+ if (m_distance < MIN_TO_METERS) {
m_distanceText.setNum(10);
m_distanceText.prepend("< ");
m_distanceText.append(UNIT_METER);
#include "panelcommon.h"
+///< @todo requires clean-up
+
PanelBar::PanelBar(QWidget *parent) //, Side side)
: QWidget(parent)
{
QPainter painter(this);
painter.drawTiledPixmap(m_barRect, m_barTile);
+ ///< @todo magic
painter.drawTiledPixmap(0, 0, PANEL_BAR_WIDTH, m_menuDropShadowTile.height(),
m_menuDropShadowTile);
}
{
qDebug() << __PRETTY_FUNCTION__;
+ ///< @todo magic
m_barRect.setRect(0, 0, PANEL_BAR_WIDTH, size.height());
// m_sliderRegion = QRegion(m_buttonRect).united(QRegion(m_topRect).united(QRegion(m_bottomRect)));
#include <QWidget>
+///< @todo Comment does not tell what this class is actually for (=draws the vertical line between panel contents and tab buttons)
/**
* @brief Generic class for panel bars
*
* @author Kaj Wallin - kaj.wallin (at) ixonos.com
* @author Pekka Nissinen - pekka.nissinen@ixonos.com
- *
- * @class PanelBar panelbar.h "ui/panelbar.h"
*/
class PanelBar : public QWidget
{
* BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
******************************************************************************/
protected:
+ ///< @todo parameter name missing (also in .cpp)
/**
* @brief Draws the bar
*
QPixmap m_barTile; ///< Pixmap for panel bar
QRect m_barRect; ///< Rect for the panel bar
-
-// QRegion m_sliderRegion; ///< Region of the slider bar
};
#endif // PANELBAR_H
#include <QPixmap>
#include <QWidget>
+///< @todo Base class? Might be misleading comment and does not tell about what this class does
+///< @todo Why not directly inheriting QStackedWidget?
/**
* @brief Base class for panel inner content
*
* @author Pekka Nissinen - pekka.nissinen@ixonos.com
- *
- * @class PanelBase panelbase.h "ui/panelbase.h"
*/
class PanelBase : public QWidget
{
* BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
******************************************************************************/
protected:
+ ///< @todo parameter name (also in .cpp)
/**
* @brief Draws the panel content base
*
#include <QDebug>
#include <QVBoxLayout>
-#include "panelcommon.h"
#include "panelbase.h"
+#include "panelcommon.h"
#include "panelcontent.h"
class PanelBase;
+///< @todo Base class? Might be misleading comment and does not tell about what this class does
/**
* @brief Base class for panel content area
*
* @author Kaj Wallin - kaj.wallin (at) ixonos.com
* @author Pekka Nissinen - pekka.nissinen@ixonos.com
- *
- * @class PanelContent panelcontent.h "ui/panelcontent.h"
*/
class PanelContent : public QWidget
{
#include "paneltab.h"
+///< @todo TAB_WIDTH not global? move into paintEvent()
const int TAB_WIDTH = 66;
const int TAB_WIDTH_ACTIVE = 74;
const int TAB_HEIGHT = 66;
{
qDebug() << __PRETTY_FUNCTION__;
+ ///< @todo magic, use enum, check also .h todo comment, fix everywhere
m_tabPixmaps[0].load(":/res/images/tab_inactive.png");
m_tabPixmaps[1].load(":/res/images/tab_inactive2.png");
m_tabPixmaps[2].load(":/res/images/tab_active.png");
{
qDebug() << __PRETTY_FUNCTION__;
+ ///< @todo mouse button is not checked, add check here or remove from mousePressEvent
+
if(this->rect().contains(event->pos())) {
click();
icon().paint(&painter, m_tabRect, Qt::AlignCenter, QIcon::Disabled);
}
+///< @todo setActive() method is not used
void PanelTab::setActive(bool state)
{
qDebug() << __PRETTY_FUNCTION__;
class QMouseEvent;
+///< @todo Many missing comments
class PanelTab : public QToolButton
{
Q_OBJECT
bool m_tabActive;
bool m_tabSelected;
+ ///< @todo magic, replace with enum?
QPixmap m_tabPixmaps[3];
QRect m_tabRect;
TabbedPanel::TabbedPanel(QWidget *parent)
: QWidget(parent),
m_isOpen(false),
- m_activeTab(-1)
+ m_activeTab(-1) ///< @todo magic
{
qDebug() << __PRETTY_FUNCTION__;
+ ///< @todo Do not use this, REMOVE ALL OCCURENCES!
this->resize(PANEL_BAR_TABBED_WIDTH + PANEL_WIDTH, PANEL_HEIGHT);
this->move(PANEL_CLOSED_X, PANEL_TOP_PADDING);
{
qDebug() << __PRETTY_FUNCTION__;
+ ///< @todo magic
return insertTab(-1, widget, icon);
}
{
qDebug() << __PRETTY_FUNCTION__;
+ ///< @todo callers responsibility to call with right parameters
if(!widget)
return -1;
+ ///< @todo magic
int verticalStartPoint = 8;
index = m_panelWidgetStack->insertWidget(index, widget);
m_tabButtonGroup->addButton(new PanelTab(this), index);
m_tabButtonGroup->button(index)->setIcon(icon);
- // [BEGIN]: Purkkaa (to be removed ASAP!!!)
+ ///< @todo [BEGIN]: Purkkaa (to be removed ASAP!!!)
if(index > 0)
verticalStartPoint += 65 * index;
}
}
+///< @todo sort alphabetically (other methods too)
void TabbedPanel::closePanel()
{
qDebug() << __PRETTY_FUNCTION__;
this->resize(PANEL_BAR_TABBED_WIDTH + PANEL_WIDTH,
size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING);
- if(!m_isOpen)
+ if(!m_isOpen) {
this->move(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH, PANEL_TOP_PADDING);
- else
+ }
+ else {
this->move(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH - PANEL_WIDTH,
PANEL_TOP_PADDING);
+ }
m_panelBar->resizeBar(size);
m_panelContent->resizePanelContent(size);
+ ///< @todo alignment
m_panelStateClosed->assignProperty(this, "pos",
QPoint(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH, PANEL_TOP_PADDING));
m_panelStateOpened->assignProperty(this, "pos",
{
qDebug() << __PRETTY_FUNCTION__;
+ ///< @todo magic
+ ///< @todo short comments?
if(m_activeTab == -1) {
m_activeTab = index;
m_panelWidgetStack->setCurrentIndex(index);
*
* @author Kaj Wallin - kaj.wallin (at) ixonos.com
* @author Pekka Nissinen - pekka.nissinen@ixonos.com
- *
- * @class TabbedPanel tabbedpanel.h "ui/tabbedpanel.h"
*/
class TabbedPanel : public QWidget
{
*/
int addTab(QWidget *widget, const QIcon& icon);
+ ///< @todo define "out of range"
/**
* @brief Inserts a tab to the panel
*
+///< @todo Pekka missing from authors?
/*
Situare - A location system for Facebook
Copyright (C) 2010 Ixonos Plc. Authors:
void testPanelToggling();
};
+///< @todo Remove commented code. Add failing test case if there should be a unit test but it is not yet implemented
+
//void TestTabbedPanel::testPanelTypes()
//{
// SidePanel *testPanel = new SidePanel();
testPanel->closePanel();
QTest::qWait(1);
QCOMPARE(toggleSpy.count(), 2);
+
delete testPanel;
}
+
QTEST_MAIN(TestTabbedPanel)
+
#include "testtabbedpanel.moc"