qgraphicsrectitem

Why I can't enlarge a widget added to QGraphicScene by QSizeGrip?

拥有回忆 提交于 2019-12-24 23:54:24
问题 I have added a widget to a graphic scene QGraphicScene through a QGraphicsProxyWidget. To move it I have set QGraphicsRectitem as its parent. The widget is resized with the use of a sizegrip. The first time I create an object I can enlarge it upto some dimension. The second time I can enlarge it less than the first one. The third time less than the second one and so on. It seems to me that it behaves randomly. Why is this happening? Here is the code: void GraphicsView::dropEvent(QDropEvent

How to resize QWidget added in QGraphicScene through QGraphicsProxy?

非 Y 不嫁゛ 提交于 2019-12-14 03:57:24
问题 I have added a widget to a graphic scene (QGraphicScene) through a QGraphicsProxyWidget. To move and select the widget added QGraphicsRectItem handle. To resize widget added QSizegrip to widget. But when i resize widget more than the QGraphicsRect item rect right and bottom edges goes behind .How to overcome this problem? When i resize widget graphics rect item should resize or vice-versa should happen. how to do this? Any other ideas are welcome. Here is the code auto *dial= new QDial(); //

Adding horizontal slider to QTableWidget

[亡魂溺海] 提交于 2019-12-08 06:06:58
问题 I am trying to design something like a timeline view for my video player. I decided to use QTableWidget as the timeline since it suits my purpose. My widget looks like this: I want the green line to run through the widget when i click on play. Here is my MVCE example: //View.cpp View::View(QWidget* parent) : QGraphicsView(parent) { QGraphicsScene* scene = new QGraphicsScene(this); TableWidget* wgt = new TableWidget; scene->addWidget(wgt); QGraphicsLineItem* item = new QGraphicsLineItem(30, 12

Adding horizontal slider to QTableWidget

为君一笑 提交于 2019-12-06 19:55:29
I am trying to design something like a timeline view for my video player. I decided to use QTableWidget as the timeline since it suits my purpose. My widget looks like this: I want the green line to run through the widget when i click on play. Here is my MVCE example: //View.cpp View::View(QWidget* parent) : QGraphicsView(parent) { QGraphicsScene* scene = new QGraphicsScene(this); TableWidget* wgt = new TableWidget; scene->addWidget(wgt); QGraphicsLineItem* item = new QGraphicsLineItem(30, 12, 30, wgt->height() - 9); item->setPen(QPen(QBrush(Qt::green), 3)); item->setFlags(QGraphicsItem:

Why I can't enlarge a widget added to QGraphicScene by QSizeGrip?

[亡魂溺海] 提交于 2019-11-29 16:17:43
I have added a widget to a graphic scene QGraphicScene through a QGraphicsProxyWidget. To move it I have set QGraphicsRectitem as its parent. The widget is resized with the use of a sizegrip. The first time I create an object I can enlarge it upto some dimension. The second time I can enlarge it less than the first one. The third time less than the second one and so on. It seems to me that it behaves randomly. Why is this happening? Here is the code: void GraphicsView::dropEvent(QDropEvent *event)// subclass of QGraphicsView { if(event->mimeData()->text() == "Dial") { auto *dial= new Dial; //

Why I can't enlarge a widget added to QGraphicScene by QSizeGrip?

寵の児 提交于 2019-11-28 09:33:35
问题 I have added a widget to a graphic scene QGraphicScene through a QGraphicsProxyWidget. To move it I have set QGraphicsRectitem as its parent. The widget is resized with the use of a sizegrip. The first time I create an object I can enlarge it upto some dimension. The second time I can enlarge it less than the first one. The third time less than the second one and so on. It seems to me that it behaves randomly. Why is this happening? Here is the code: void GraphicsView::dropEvent(QDropEvent