listViewLayout->setContentsMargins(PANEL_MARGIN_LEFT, PANEL_MARGIN_TOP,
PANEL_MARGIN_RIGHT, PANEL_MARGIN_BOTTOM);
- ImageButton *searchLocationButton = new ImageButton(0, ":/res/images/search.png",
- ":/res/images/search_s.png");
+ ImageButton *searchLocationButton = new ImageButton(":/res/images/search.png",
+ ":/res/images/search_s.png",
+ "", this);
m_contextButtonList.append(searchLocationButton);
connect(this, SIGNAL(clearUpdateLocationDialogData()),
m_userInfo, SLOT(clearUpdateLocationDialogData()));
- ImageButton *updateFriendsButton = new ImageButton(this, ":/res/images/refresh.png",
- ":/res/images/refresh_s.png");
- ImageButton *updateStatusMessageButton = new ImageButton(this, ":/res/images/send_position.png",
- ":/res/images/send_position_s.png");
+ ImageButton *updateFriendsButton = new ImageButton(":/res/images/refresh.png",
+ ":/res/images/refresh_s.png",
+ "", this);
+ ImageButton *updateStatusMessageButton = new ImageButton(":/res/images/send_position.png",
+ ":/res/images/send_position_s.png",
+ "", this);
m_contextButtonList.append(updateFriendsButton);
m_contextButtonList.append(updateStatusMessageButton);
testtabbedpanel.cpp \
../../../src/ui/tabbedpanel.cpp \
../../../src/ui/panelbar.cpp \
+ ../../../src/ui/panelbase.cpp \
../../../src/ui/panelcontentstack.cpp \
+ ../../../src/ui/panelcontextbuttonbar.cpp \
../../../src/ui/paneltab.cpp \
../../../src/ui/paneltabbar.cpp
HEADERS += \
../../../src/ui/tabbedpanel.h \
../../../src/ui/panelbar.h \
+ ../../../src/ui/panelbase.h \
../../../src/ui/panelcontentstack.h \
+ ../../../src/ui/panelcontextbuttonbar.h \
../../../src/ui/paneltab.h \
../../../src/ui/paneltabbar.h \
../../../src/ui/panelcommon.h
#include <QtTest/QtTest>
#include <QtCore>
-#include <QWidget>
+#include "ui/panelbase.h"
#include "ui/tabbedpanel.h"
class TestTabbedPanel : public QObject
void TestTabbedPanel::testPanelToggling()
{
- TabbedPanel *testPanel = new TabbedPanel();
+ TabbedPanel *testTabbedPanel = new TabbedPanel;
- QWidget *testWidget = new QWidget();
- testPanel->addTab(testWidget, QIcon(":/res/images/user_info.png"));
+ PanelBase *testPanel = new PanelBase;
+ testTabbedPanel->addTab(testPanel, QIcon(":/res/images/user_info.png"));
QSignalSpy closedSpy(testPanel, SIGNAL(panelClosed()));
QSignalSpy openedSpy(testPanel, SIGNAL(panelOpened()));
QCOMPARE(toggleSpy.count(), 0);
// Try to close the panel. As the panel is closed, no signals should be sent.
- testPanel->closePanel();
+ testTabbedPanel->closePanel();
QTest::qWait(1);
QCOMPARE(closedSpy.count(), 0);
QCOMPARE(openedSpy.count(), 0);
QCOMPARE(toggleSpy.count(), 0);
// Now try to open the panel, only toggleState and panelOpened signals should be sent
- testPanel->showPanel(testWidget);
+ testTabbedPanel->showPanel(testPanel);
QTest::qWait(1);
QCOMPARE(closedSpy.count(), 0);
QCOMPARE(openedSpy.count(), 0);
QCOMPARE(toggleSpy.count(), 1);
// Now try to open the panel again. As the panel is already open, no signals should not be sent.
- testPanel->showPanel(testWidget);
+ testTabbedPanel->showPanel(testPanel);
QTest::qWait(1);
QCOMPARE(closedSpy.count(), 0);
QCOMPARE(openedSpy.count(), 1);
QCOMPARE(toggleSpy.count(), 1);
//Now try to close the panel, only toggleState and panelClosed signals should be sent
- testPanel->closePanel();
+ testTabbedPanel->closePanel();
QTest::qWait(1);
QCOMPARE(closedSpy.count(), 0);
QCOMPARE(openedSpy.count(), 1);
QCOMPARE(openedSpy.count(), 1);
QCOMPARE(toggleSpy.count(), 2);
- delete testWidget;
delete testPanel;
+ delete testTabbedPanel;
}
QTEST_MAIN(TestTabbedPanel)