#include "listviewscreen.h"
#include "pixmap.h"
#include "infotab.h"
-
+#include <QDebug>
ListViewScreen::ListViewScreen(QWidget *parent)
: QWidget(parent)
QGraphicsProxyWidget *widgetProxy = new QGraphicsProxyWidget();
widgetProxy->setWidget(personalInfo);
- QGraphicsScene *scene= new QGraphicsScene(0,0,700,360);
+ QGraphicsScene *scene= new QGraphicsScene();
QGraphicsWidget *graphWidget = new QGraphicsWidget();
graphLayout = new QGraphicsLinearLayout(graphWidget);
graphLayout->setOrientation(Qt::Horizontal);
graphLayout->addItem(widgetProxy);
scene->setBackgroundBrush(Qt::white);
- //scene->addItem(widgetProxy);
scene->addItem(graphWidget);
scene->addItem(arrowbutton);
+ qDebug() << "Scene width: " << scene->width();
+ qDebug() << "Scene heigth: " << scene->height();
QGraphicsView *view = new QGraphicsView(scene);
+ view->setAlignment(Qt::AlignLeft|Qt::AlignTop);
+ view->setSceneRect(0,0,7000,3000);
+ view->centerOn(QPointF(0,0));
view->setFrameStyle(0);
view->setAlignment(Qt::AlignLeft | Qt::AlignTop);
view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
machine->setInitialState(state1);
// State 1
- state1->assignProperty(graphWidget,"pos",QPointF(-(personalInfo->width()+20),(scene->height()/4)));
- state1->assignProperty(arrowbutton,"pos",QPointF(0,(scene->height()/2 - (arrowbutton->boundingRect().height()/2))));
+ state1->assignProperty(graphWidget,"pos",QPointF(-(personalInfo->width()+20),0));
+ state1->assignProperty(arrowbutton,"pos",QPointF(0,(arrowbutton->boundingRect().height()/2)+10));
// State 2
- state2->assignProperty(graphWidget,"pos",QPointF(-15,(scene->height()/4)));
- state2->assignProperty(arrowbutton,"pos",QPointF(0,(scene->height()/2 - (arrowbutton->boundingRect().height()/2))));
+ state2->assignProperty(graphWidget,"pos",QPointF(-20,0));
+ state2->assignProperty(arrowbutton,"pos",QPointF((personalInfo->width()-5),(arrowbutton->boundingRect().height()/2)+10));
QAbstractTransition *trans1 = state1->addTransition(arrowbutton,SIGNAL(clicked()),state2);
trans1->addAnimation(new QPropertyAnimation(graphWidget,"pos"));
*/
void mousePressEvent(QGraphicsSceneMouseEvent *event);
/**
+ * @brief Bounding box of the drawed pixmap
+ *
+ * @return Rectangle shaped bounding box of the pixmap
+ */
+ QRectF boundingRect() const;
+protected:
+ /**
* @brief Drawer of the given picture
*
* @param painter Pointer to painting class
* @param Pointer to the widget
*/
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *);
- /**
- * @brief Bounding box of the drawed pixmap
- *
- * @return Rectangle shaped bounding box of the pixmap
- */
- QRectF boundingRect() const;
signals:
/**
* @brief Signal which is emitted when the pixmap