Unstable groups implementation

preferencesAboutTextFull
Ivan Ilyin 13 years ago
parent e1adcda8d9
commit 5e363a3afc
  1. 104
      src/adaptors/UBSvgSubsetAdaptor.cpp
  2. 1
      src/adaptors/UBSvgSubsetAdaptor.h
  3. 2
      src/board/UBBoardController.cpp
  4. 10
      src/domain/UBGraphicsItemDelegate.cpp
  5. 16
      src/domain/UBGraphicsPolygonItem.cpp
  6. 2
      src/domain/UBGraphicsPolygonItem.h
  7. 45
      src/domain/UBGraphicsScene.cpp
  8. 3
      src/domain/UBGraphicsScene.h
  9. 43
      src/domain/ubgraphicsgroupcontaineritem.cpp
  10. 21
      src/domain/ubgraphicsgroupcontaineritemdelegate.cpp
  11. 4
      src/domain/ubgraphicsgroupcontaineritemdelegate.h

@ -30,6 +30,7 @@
#include "domain/UBAbstractWidget.h" #include "domain/UBAbstractWidget.h"
#include "domain/UBGraphicsStroke.h" #include "domain/UBGraphicsStroke.h"
#include "domain/UBGraphicsStrokesGroup.h" #include "domain/UBGraphicsStrokesGroup.h"
#include "domain/ubgraphicsgroupcontaineritem.h"
#include "domain/UBItem.h" #include "domain/UBItem.h"
#include "tools/UBGraphicsRuler.h" #include "tools/UBGraphicsRuler.h"
@ -929,8 +930,13 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::writeSvgElement()
bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene() bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene()
{ {
if (mScene->isModified()) if (mScene->isModified())
{ {
static int i = 0;
qDebug() << "persist call no is " << ++i;
QBuffer buffer; QBuffer buffer;
buffer.open(QBuffer::WriteOnly); buffer.open(QBuffer::WriteOnly);
mXmlWriter.setDevice(&buffer); mXmlWriter.setDevice(&buffer);
@ -1035,12 +1041,54 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene()
openStroke = 0; openStroke = 0;
} }
UBGraphicsGroupContainerItem *groupItem = qgraphicsitem_cast<UBGraphicsGroupContainerItem*>(item);
if (groupItem && groupItem->isVisible())
{
qDebug() << "came across the group during the parsing";
continue;
}
parseCommonItems(item);
}
if (openStroke)
{
mXmlWriter.writeEndElement();
groupHoldsInfo = false;
openStroke = 0;
}
mXmlWriter.writeEndDocument();
QString fileName = mDocumentPath + UBFileSystemUtils::digitFileFormat("/page%1.svg", mPageIndex + 1);
QFile file(fileName);
if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate))
{
qCritical() << "cannot open " << fileName << " for writing ...";
return false;
}
file.write(buffer.data());
file.flush();
file.close();
}
else
{
qDebug() << "ignoring unmodified page" << mPageIndex + 1;
}
return true;
}
bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::parseCommonItems(QGraphicsItem *item)
{
UBGraphicsPixmapItem *pixmapItem = qgraphicsitem_cast<UBGraphicsPixmapItem*> (item); UBGraphicsPixmapItem *pixmapItem = qgraphicsitem_cast<UBGraphicsPixmapItem*> (item);
if (pixmapItem && pixmapItem->isVisible()) if (pixmapItem && pixmapItem->isVisible())
{ {
pixmapItemToLinkedImage(pixmapItem); pixmapItemToLinkedImage(pixmapItem);
continue; return true;
} }
UBGraphicsSvgItem *svgItem = qgraphicsitem_cast<UBGraphicsSvgItem*> (item); UBGraphicsSvgItem *svgItem = qgraphicsitem_cast<UBGraphicsSvgItem*> (item);
@ -1048,7 +1096,7 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene()
if (svgItem && svgItem->isVisible()) if (svgItem && svgItem->isVisible())
{ {
svgItemToLinkedSvg(svgItem); svgItemToLinkedSvg(svgItem);
continue; return true;
} }
UBGraphicsVideoItem *videoItem = qgraphicsitem_cast<UBGraphicsVideoItem*> (item); UBGraphicsVideoItem *videoItem = qgraphicsitem_cast<UBGraphicsVideoItem*> (item);
@ -1056,13 +1104,13 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene()
if (videoItem && videoItem->isVisible()) if (videoItem && videoItem->isVisible())
{ {
videoItemToLinkedVideo(videoItem); videoItemToLinkedVideo(videoItem);
continue; return true;
} }
UBGraphicsAudioItem* audioItem = qgraphicsitem_cast<UBGraphicsAudioItem*> (item); UBGraphicsAudioItem* audioItem = qgraphicsitem_cast<UBGraphicsAudioItem*> (item);
if (audioItem && audioItem->isVisible()) { if (audioItem && audioItem->isVisible()) {
audioItemToLinkedAudio(audioItem); audioItemToLinkedAudio(audioItem);
continue; return true;
} }
UBGraphicsAppleWidgetItem *appleWidgetItem = qgraphicsitem_cast<UBGraphicsAppleWidgetItem*> (item); UBGraphicsAppleWidgetItem *appleWidgetItem = qgraphicsitem_cast<UBGraphicsAppleWidgetItem*> (item);
@ -1070,7 +1118,7 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene()
if (appleWidgetItem && appleWidgetItem->isVisible()) if (appleWidgetItem && appleWidgetItem->isVisible())
{ {
graphicsAppleWidgetToSvg(appleWidgetItem); graphicsAppleWidgetToSvg(appleWidgetItem);
continue; return true;
} }
UBGraphicsW3CWidgetItem *w3cWidgetItem = qgraphicsitem_cast<UBGraphicsW3CWidgetItem*> (item); UBGraphicsW3CWidgetItem *w3cWidgetItem = qgraphicsitem_cast<UBGraphicsW3CWidgetItem*> (item);
@ -1078,7 +1126,7 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene()
if (w3cWidgetItem && w3cWidgetItem->isVisible()) if (w3cWidgetItem && w3cWidgetItem->isVisible())
{ {
graphicsW3CWidgetToSvg(w3cWidgetItem); graphicsW3CWidgetToSvg(w3cWidgetItem);
continue; return true;
} }
UBGraphicsPDFItem *pdfItem = qgraphicsitem_cast<UBGraphicsPDFItem*> (item); UBGraphicsPDFItem *pdfItem = qgraphicsitem_cast<UBGraphicsPDFItem*> (item);
@ -1086,7 +1134,7 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene()
if (pdfItem && pdfItem->isVisible()) if (pdfItem && pdfItem->isVisible())
{ {
pdfItemToLinkedPDF(pdfItem); pdfItemToLinkedPDF(pdfItem);
continue; return true;
} }
UBGraphicsTextItem *textItem = qgraphicsitem_cast<UBGraphicsTextItem*> (item); UBGraphicsTextItem *textItem = qgraphicsitem_cast<UBGraphicsTextItem*> (item);
@ -1094,7 +1142,7 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene()
if (textItem && textItem->isVisible()) if (textItem && textItem->isVisible())
{ {
textItemToSvg(textItem); textItemToSvg(textItem);
continue; return true;
} }
UBGraphicsCurtainItem *curtainItem = qgraphicsitem_cast<UBGraphicsCurtainItem*> (item); UBGraphicsCurtainItem *curtainItem = qgraphicsitem_cast<UBGraphicsCurtainItem*> (item);
@ -1102,7 +1150,7 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene()
if (curtainItem && curtainItem->isVisible()) if (curtainItem && curtainItem->isVisible())
{ {
curtainItemToSvg(curtainItem); curtainItemToSvg(curtainItem);
continue; return true;
} }
UBGraphicsRuler *ruler = qgraphicsitem_cast<UBGraphicsRuler*> (item); UBGraphicsRuler *ruler = qgraphicsitem_cast<UBGraphicsRuler*> (item);
@ -1110,14 +1158,14 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene()
if (ruler && ruler->isVisible()) if (ruler && ruler->isVisible())
{ {
rulerToSvg(ruler); rulerToSvg(ruler);
continue; return true;
} }
UBGraphicsCache* cache = qgraphicsitem_cast<UBGraphicsCache*>(item); UBGraphicsCache* cache = qgraphicsitem_cast<UBGraphicsCache*>(item);
if(cache && cache->isVisible()) if(cache && cache->isVisible())
{ {
cacheToSvg(cache); cacheToSvg(cache);
continue; return true;
} }
UBGraphicsCompass *compass = qgraphicsitem_cast<UBGraphicsCompass*> (item); UBGraphicsCompass *compass = qgraphicsitem_cast<UBGraphicsCompass*> (item);
@ -1125,7 +1173,7 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene()
if (compass && compass->isVisible()) if (compass && compass->isVisible())
{ {
compassToSvg(compass); compassToSvg(compass);
continue; return true;
} }
UBGraphicsProtractor *protractor = qgraphicsitem_cast<UBGraphicsProtractor*> (item); UBGraphicsProtractor *protractor = qgraphicsitem_cast<UBGraphicsProtractor*> (item);
@ -1133,7 +1181,7 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene()
if (protractor && protractor->isVisible()) if (protractor && protractor->isVisible())
{ {
protractorToSvg(protractor); protractorToSvg(protractor);
continue; return true;
} }
UBGraphicsTriangle *triangle = qgraphicsitem_cast<UBGraphicsTriangle*> (item); UBGraphicsTriangle *triangle = qgraphicsitem_cast<UBGraphicsTriangle*> (item);
@ -1141,40 +1189,14 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene()
if (triangle && triangle->isVisible()) if (triangle && triangle->isVisible())
{ {
triangleToSvg(triangle); triangleToSvg(triangle);
continue; return true;
}
}
if (openStroke)
{
mXmlWriter.writeEndElement();
groupHoldsInfo = false;
openStroke = 0;
}
mXmlWriter.writeEndDocument();
QString fileName = mDocumentPath + UBFileSystemUtils::digitFileFormat("/page%1.svg", mPageIndex + 1);
QFile file(fileName);
if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate))
{
qCritical() << "cannot open " << fileName << " for writing ...";
return false;
}
file.write(buffer.data());
file.flush();
file.close();
}
else
{
qDebug() << "ignoring unmodified page" << mPageIndex + 1;
} }
return true; return true;
} }
void UBSvgSubsetAdaptor::UBSvgSubsetWriter::polygonItemToSvgLine(UBGraphicsPolygonItem* polygonItem, bool groupHoldsInfo) void UBSvgSubsetAdaptor::UBSvgSubsetWriter::polygonItemToSvgLine(UBGraphicsPolygonItem* polygonItem, bool groupHoldsInfo)
{ {
mXmlWriter.writeStartElement("line"); mXmlWriter.writeStartElement("line");

@ -156,6 +156,7 @@ class UBSvgSubsetAdaptor
UBSvgSubsetWriter(UBDocumentProxy* proxy, UBGraphicsScene* pScene, const int pageIndex); UBSvgSubsetWriter(UBDocumentProxy* proxy, UBGraphicsScene* pScene, const int pageIndex);
bool persistScene(); bool persistScene();
bool parseCommonItems(QGraphicsItem *item);
virtual ~UBSvgSubsetWriter(){} virtual ~UBSvgSubsetWriter(){}

@ -1235,12 +1235,14 @@ void UBBoardController::ClearUndoStack()
while (itUniq.hasNext()) while (itUniq.hasNext())
{ {
QGraphicsItem* item = itUniq.next(); QGraphicsItem* item = itUniq.next();
if (item->scene()) {
UBGraphicsScene *scene = dynamic_cast<UBGraphicsScene*>(item->scene()); UBGraphicsScene *scene = dynamic_cast<UBGraphicsScene*>(item->scene());
if(!scene) if(!scene)
{ {
mActiveScene->deleteItem(item); mActiveScene->deleteItem(item);
} }
} }
}
} }

@ -236,8 +236,7 @@ void UBGraphicsItemDelegate::setMimeData(QMimeData *mimeData)
bool UBGraphicsItemDelegate::mouseMoveEvent(QGraphicsSceneMouseEvent *event) bool UBGraphicsItemDelegate::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{ {
if((NULL != mMimeData) && ((event->pos() - mDragStartPosition).manhattanLength() < QApplication::startDragDistance())) if(mMimeData) {
{
QDrag* mDrag = new QDrag(event->widget()); QDrag* mDrag = new QDrag(event->widget());
mDrag->setMimeData(mMimeData); mDrag->setMimeData(mMimeData);
if (!mDragPixmap.isNull()) { if (!mDragPixmap.isNull()) {
@ -250,13 +249,12 @@ bool UBGraphicsItemDelegate::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
return true; return true;
} }
if(isLocked()) if(isLocked()) {
{
event->accept(); event->accept();
return true; return true;
} else {
return false;
} }
return true;
} }
bool UBGraphicsItemDelegate::weelEvent(QGraphicsSceneWheelEvent *event) bool UBGraphicsItemDelegate::weelEvent(QGraphicsSceneWheelEvent *event)

@ -189,18 +189,18 @@ void UBGraphicsPolygonItem::paint ( QPainter * painter, const QStyleOptionGraphi
QGraphicsPolygonItem::paint(painter, option, widget); QGraphicsPolygonItem::paint(painter, option, widget);
} }
//QPainterPath UBGraphicsPolygonItem::shape() const QPainterPath UBGraphicsPolygonItem::shape() const
//{ {
// QPainterPath path; QPainterPath path;
// path.addRect(boundingRect()); path.addRect(boundingRect());
// return path; return path;
//// static QPainterPath shapePath = QGraphicsPolygonItem::shape(); // static QPainterPath shapePath = QGraphicsPolygonItem::shape();
//// return shapePath; // return shapePath;
//} }
UBGraphicsScene* UBGraphicsPolygonItem::scene() UBGraphicsScene* UBGraphicsPolygonItem::scene()

@ -118,7 +118,7 @@ class UBGraphicsPolygonItem : public QGraphicsPolygonItem, public UBItem
protected: protected:
void paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); void paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget);
// QPainterPath shape () const; QPainterPath shape () const;
private: private:

@ -294,9 +294,15 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent)
} }
connect(this, SIGNAL(selectionChanged()), this, SLOT(selectionChangedProcessing())); connect(this, SIGNAL(selectionChanged()), this, SLOT(selectionChangedProcessing()));
connect(this, SIGNAL(selectionChanged()), this, SLOT(groupButtonProcessing())); connect(this, SIGNAL(selectionChanged()), this, SLOT(updateGroupButtonState()));
// just a stub don't treat as a result code
// static int i = 0;
// i++;
// if (i == 1) {
connect(UBApplication::mainWindow->actionGroupItems, SIGNAL(triggered()), this, SLOT(groupButtonClicked())); connect(UBApplication::mainWindow->actionGroupItems, SIGNAL(triggered()), this, SLOT(groupButtonClicked()));
// qDebug() << "the connect is accepted";
// }
} }
UBGraphicsScene::~UBGraphicsScene() UBGraphicsScene::~UBGraphicsScene()
@ -315,7 +321,7 @@ void UBGraphicsScene::selectionChangedProcessing()
UBApplication::showMessage("ZValue is " + QString::number(selectedItems().first()->zValue(), 'f') + "own z value is " UBApplication::showMessage("ZValue is " + QString::number(selectedItems().first()->zValue(), 'f') + "own z value is "
+ QString::number(selectedItems().first()->data(UBGraphicsItemData::ItemOwnZValue).toReal(), 'f')); + QString::number(selectedItems().first()->data(UBGraphicsItemData::ItemOwnZValue).toReal(), 'f'));
} }
void UBGraphicsScene::groupButtonProcessing() void UBGraphicsScene::updateGroupButtonState()
{ {
QAction *groupAction = UBApplication::mainWindow->actionGroupItems; QAction *groupAction = UBApplication::mainWindow->actionGroupItems;
QList<QGraphicsItem*> selItems = selectedItems(); QList<QGraphicsItem*> selItems = selectedItems();
@ -351,12 +357,19 @@ void UBGraphicsScene::groupButtonClicked()
UBGraphicsGroupContainerItem *groupItem = new UBGraphicsGroupContainerItem(); UBGraphicsGroupContainerItem *groupItem = new UBGraphicsGroupContainerItem();
foreach (QGraphicsItem *item, selItems) { foreach (QGraphicsItem *item, selItems) {
item->setSelected(false); if (item->type() == UBGraphicsGroupContainerItem::Type) {
item->setFlag(QGraphicsItem::ItemIsSelectable, false); QList<QGraphicsItem*> childItems = item->childItems();
item->setFlag( QGraphicsItem::ItemIsMovable, false); UBGraphicsGroupContainerItem *currentGroup = dynamic_cast<UBGraphicsGroupContainerItem*>(item);
item->setFlag(QGraphicsItem::ItemIsFocusable); if (currentGroup) {
currentGroup->destroy();
}
foreach (QGraphicsItem *chItem, childItems) {
groupItem->addToGroup(chItem);
}
} else {
groupItem->addToGroup(item); groupItem->addToGroup(item);
} }
}
addItem(groupItem); addItem(groupItem);
groupItem->setVisible(true); groupItem->setVisible(true);
@ -375,26 +388,6 @@ void UBGraphicsScene::groupButtonClicked()
} }
} }
void UBGraphicsScene::processGroupItems()
{
qDebug() << "processing grouping items";
UBGraphicsGroupContainerItem *groupItem = new UBGraphicsGroupContainerItem();
foreach (QGraphicsItem *item, selectedItems()) {
item->setSelected(false);
item->setFlag(QGraphicsItem::ItemIsSelectable, true);
item->setFlag( QGraphicsItem::ItemIsMovable, false);
item->setFlag(QGraphicsItem::ItemIsFocusable, true);
groupItem->addToGroup(item);
}
addItem(groupItem);
// groupItem->setPos(50, 50);
groupItem->setVisible(true);
groupItem->setFocus();
qDebug() << groupItem->boundingRect();
}
// MARK: - // MARK: -
// MARK: Mouse/Tablet events handling // MARK: Mouse/Tablet events handling

@ -305,9 +305,8 @@ public slots:
void setToolCursor(int tool); void setToolCursor(int tool);
void selectionChangedProcessing(); void selectionChangedProcessing();
void groupButtonProcessing(); void updateGroupButtonState();
void groupButtonClicked(); void groupButtonClicked();
void processGroupItems();
void moveMagnifier(QPoint newPos); void moveMagnifier(QPoint newPos);
void closeMagnifier(); void closeMagnifier();

@ -46,6 +46,12 @@ void UBGraphicsGroupContainerItem::addToGroup(QGraphicsItem *item)
return; return;
} }
//setting item flags to given item
item->setSelected(false);
item->setFlag(QGraphicsItem::ItemIsSelectable, false);
item->setFlag( QGraphicsItem::ItemIsMovable, false);
item->setFlag(QGraphicsItem::ItemIsFocusable, true);
QTransform newItemTransform(itemTransform); QTransform newItemTransform(itemTransform);
item->setPos(mapFromItem(item, 0, 0)); item->setPos(mapFromItem(item, 0, 0));
item->setParentItem(this); item->setParentItem(this);
@ -130,20 +136,24 @@ void UBGraphicsGroupContainerItem::paint(QPainter *painter, const QStyleOptionGr
QWidget *widget) QWidget *widget)
{ {
Q_UNUSED(widget); Q_UNUSED(widget);
if (option->state & QStyle::State_Selected) { Q_UNUSED(painter);
painter->setBrush(Qt::NoBrush); Q_UNUSED(option);
QPen tmpPen;
qreal tmpPenWidth = 1.0; // we would not use paint smth for the moment
tmpPen.setWidth(tmpPenWidth); // if (option->state & QStyle::State_Selected) {
tmpPen.setColor(Qt::lightGray); // painter->setBrush(Qt::NoBrush);
painter->setPen(tmpPen); // QPen tmpPen;
painter->drawRect(itemsBoundingRect.adjusted(tmpPenWidth / 2, tmpPenWidth / 2, -tmpPenWidth / 2, -tmpPenWidth / 2)); // qreal tmpPenWidth = 1.0;
} // tmpPen.setWidth(tmpPenWidth);
// tmpPen.setColor(Qt::lightGray);
// painter->setPen(tmpPen);
// painter->drawRect(itemsBoundingRect.adjusted(tmpPenWidth / 2, tmpPenWidth / 2, -tmpPenWidth / 2, -tmpPenWidth / 2));
// }
} }
UBGraphicsScene *UBGraphicsGroupContainerItem::scene() UBGraphicsScene *UBGraphicsGroupContainerItem::scene()
{ {
UBGraphicsScene *castScene = dynamic_cast<UBGraphicsScene*>(scene()); UBGraphicsScene *castScene = dynamic_cast<UBGraphicsScene*>(QGraphicsItem::scene());
return castScene; return castScene;
} }
@ -178,7 +188,12 @@ void UBGraphicsGroupContainerItem::destroy() {
item->setFlag(QGraphicsItem::ItemIsFocusable, true); item->setFlag(QGraphicsItem::ItemIsFocusable, true);
} }
mDelegate->remove(true); remove();
if (scene()) {
qDebug() << "scene is well casted";
scene()->removeItem(this);
}
} }
void UBGraphicsGroupContainerItem::mousePressEvent(QGraphicsSceneMouseEvent *event) void UBGraphicsGroupContainerItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
@ -186,9 +201,12 @@ void UBGraphicsGroupContainerItem::mousePressEvent(QGraphicsSceneMouseEvent *eve
if (mDelegate->mousePressEvent(event)) { if (mDelegate->mousePressEvent(event)) {
//NOOP //NOOP
} else { } else {
QGraphicsItem::mousePressEvent(event); QGraphicsItem::mousePressEvent(event);
setSelected(true); setSelected(true);
} }
} }
void UBGraphicsGroupContainerItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) void UBGraphicsGroupContainerItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
@ -198,11 +216,12 @@ void UBGraphicsGroupContainerItem::mouseMoveEvent(QGraphicsSceneMouseEvent *even
} else { } else {
QGraphicsItem::mouseMoveEvent(event); QGraphicsItem::mouseMoveEvent(event);
} }
} }
void UBGraphicsGroupContainerItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void UBGraphicsGroupContainerItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{ {
mDelegate->mouseReleaseEvent(event); // mDelegate->mouseReleaseEvent(event);
QGraphicsItem::mouseReleaseEvent(event); QGraphicsItem::mouseReleaseEvent(event);
} }

@ -46,3 +46,24 @@ void UBGraphicsGroupContainerItemDelegate::buildButtons()
{ {
UBGraphicsItemDelegate::buildButtons(); UBGraphicsItemDelegate::buildButtons();
} }
bool UBGraphicsGroupContainerItemDelegate::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(event)
return false;
}
bool UBGraphicsGroupContainerItemDelegate::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(event)
return false;
}
bool UBGraphicsGroupContainerItemDelegate::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(event)
return false;
}

@ -17,6 +17,10 @@ protected:
virtual void decorateMenu(QMenu *menu); virtual void decorateMenu(QMenu *menu);
virtual void buildButtons(); virtual void buildButtons();
virtual bool mousePressEvent(QGraphicsSceneMouseEvent *event);
virtual bool mouseMoveEvent(QGraphicsSceneMouseEvent *event);
virtual bool mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
private: private:
DelegateButton *mDestroyGroupButton; DelegateButton *mDestroyGroupButton;
}; };

Loading…
Cancel
Save