Added a Context menu so we can test the state switching.

The context menu added here should only be temporary, it's an easy and
simple way to test the transitions of the items on screen.
They seem a bit broken atm, I'll try to fix that. :)

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-01-15 13:04:01 -02:00 committed by Dirk Hohndel
parent c301367259
commit 6f7967e0e0

View file

@ -9,6 +9,8 @@
#include <QStateMachine> #include <QStateMachine>
#include <QSignalTransition> #include <QSignalTransition>
#include <QPropertyAnimation> #include <QPropertyAnimation>
#include <QMenu>
#include <QContextMenuEvent>
ProfileWidget2::ProfileWidget2(QWidget *parent) : ProfileWidget2::ProfileWidget2(QWidget *parent) :
QGraphicsView(parent), QGraphicsView(parent),
@ -216,7 +218,14 @@ void ProfileWidget2::settingsChanged()
void ProfileWidget2::contextMenuEvent(QContextMenuEvent* event) void ProfileWidget2::contextMenuEvent(QContextMenuEvent* event)
{ {
// this menu should be completely replaced when things are working.
QMenu m;
m.addAction("Set Empty", this, SIGNAL(startEmptyState()));
m.addAction("Set Profile", this, SIGNAL(startProfileState()));
m.addAction("Set Add", this, SIGNAL(startAddState()));
m.addAction("Set Edit", this, SIGNAL(startEditState()));
m.addAction("Set Plan", this, SIGNAL(startPlanState()));
m.exec(event->globalPos());
} }
void ProfileWidget2::resizeEvent(QResizeEvent* event) void ProfileWidget2::resizeEvent(QResizeEvent* event)