C++ (Qt)void GraphicsView::mouseDoubleClickEvent(QMouseEvent *event){ int a=5; qDebug() << a; Scene *graphicsScene = (Scene*)scene(); QGraphicsItem *item = itemAt(event->pos()); //redraw if(item != NULL){ //delete QList<QGraphicsItem *> list = graphicsScene->items(); if(!list.isEmpty()){ int size = list.size(); for(int i = 0; i < size; i++){ QGraphicsItem *item = list.at(i); graphicsScene->removeItem(item); } } //draw CommonElement *ce = ((CommonGraphicsObject *)(item))->getModelElement(); //QModelIndex index = ce->getModelIndex(); if(!ce->children().isEmpty()){ int size = ce->children().size(); for(int i = 0; i < size; i++){ CommonElement *tmp_ce = (CommonElement*)(ce->children().at(i)); CommonGraphicsObject *cgo = tmp_ce->getGraphicsObject(); cgo->setPos(10 + (cgo->boundingRect().width() + 5)*i,10); graphicsScene->addItem(cgo); } } qDebug()<<"EMIT!!!!"; setScene(graphicsScene); qDebug()<<"EMIT!!!!"; //Q_EMIT graphicsViewDoubleClick(index); }int b=7;qDebug() << b;qDebug() << "qwerty";}
Q_MAKE_CXXFLAGS += -g0
C++ (Qt) void GraphicsView::mouseDoubleClickEvent(QMouseEvent *event){ int a=5; qDebug() << a; //ДАЖЕ ЭТО НЕ ВЫХОДИТ!!!!!!!!!! Scene *graphicsScene = (Scene*)scene(); QGraphicsItem *item = itemAt(event->pos()); //redraw
BashQT_LOGGING_RULES="*.debug=true"