#pragma once
#include <QtGui/QGraphicsRectItem>
#include "DGraphicsItem.h"
class DGraphicsRectItem :
{
public:
DGraphicsRectItem(void);
~DGraphicsRectItem(void);
void instantiateDescriptors();
};
#pragma once
#include <QtGui/QGraphicsRectItem>
#include "DGraphicsItem.h"
class QGraphicsSceneMouseEvent;
class DGraphicsRectItem :
public QGraphicsRectItem, public DGraphicsItem
{
public:
DGraphicsRectItem(void);
~DGraphicsRectItem(void);
void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent);
void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent);
void changeSize(QPointF *change);
void instantiateDescriptors();
};
To copy to clipboard, switch view to plain text mode
#include "DGraphicsRectItem.h"
#include <iostream>
#include <QPointF>
#include <QtGui/QGraphicsSceneMouseEvent>
DGraphicsRectItem::DGraphicsRectItem(void)
{
this->setFlag(DGraphicsRectItem::ItemIsSelectable,true);
this->setFlag(DGraphicsRectItem::ItemIsMovable,true);
this->setFlag(DGraphicsRectItem::ItemIsFocusable,true);
}
DGraphicsRectItem::~DGraphicsRectItem(void)
{
}
{
// QGraphicsRectItem::mousePressEvent(mouseEvent);
std::cout << "DGraphicsRectItem::mousePressEvent";
}
std::cout << "DGraphicsRectItem::mouseMoveEvent";
}
std::cout << "releaseevent";
}
void DGraphicsRectItem
::changeSize(QPointF *change
) {
std::cout << "YES" << std::endl;
}
void DGraphicsRectItem::instantiateDescriptors()
{
std::cout << "DGraphicsRectItem::instantiateDescriptors()" << std::endl;
//DescRect *item = new DescRect();
//instantiate rect descriptor.
//create modify event object
}
#include "DGraphicsRectItem.h"
#include <iostream>
#include <QPointF>
#include <QtGui/QGraphicsSceneMouseEvent>
DGraphicsRectItem::DGraphicsRectItem(void)
{
this->setFlag(DGraphicsRectItem::ItemIsSelectable,true);
this->setFlag(DGraphicsRectItem::ItemIsMovable,true);
this->setFlag(DGraphicsRectItem::ItemIsFocusable,true);
}
DGraphicsRectItem::~DGraphicsRectItem(void)
{
}
void DGraphicsRectItem::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent)
{
// QGraphicsRectItem::mousePressEvent(mouseEvent);
std::cout << "DGraphicsRectItem::mousePressEvent";
}
void DGraphicsRectItem::mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent){
std::cout << "DGraphicsRectItem::mouseMoveEvent";
}
void DGraphicsRectItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent){
std::cout << "releaseevent";
}
void DGraphicsRectItem::changeSize(QPointF *change)
{
std::cout << "YES" << std::endl;
}
void DGraphicsRectItem::instantiateDescriptors()
{
std::cout << "DGraphicsRectItem::instantiateDescriptors()" << std::endl;
//DescRect *item = new DescRect();
//instantiate rect descriptor.
//create modify event object
}
To copy to clipboard, switch view to plain text mode
Bookmarks