maybe you can reimplementin the parent widget and check which child widget gets the event and which event.Qt Code:
To copy to clipboard, switch view to plain text mode
maybe you can reimplementin the parent widget and check which child widget gets the event and which event.Qt Code:
To copy to clipboard, switch view to plain text mode
My GNU/Linux Blog:
http://funwithlinux.blogspot.com
MarkoSan (20th November 2009)
i don't have much idea about graphics view but i think in eventFilter() function, you can compare the object type with the object type of the child widgets. Read these links for more info:
http://doc.trolltech.com/4.2/eventsandfilters.html
http://doc.trolltech.com/4.2/qobject.html#eventFilter
My GNU/Linux Blog:
http://funwithlinux.blogspot.com
May be the embedded Dialog example is something similar to your needs. The dialog gets expanded when hovered over.What I want to achive is when some widget is "selected", it gets zoomed.
I know that, but hoverEvent is not ok, or is it. The final application will be touch screen based and I want to catch an event once the user will press inside of the region one of the embedded widgets and I do not know, which event to catch. Furthermore, I do not even know, which object will emit signal or event, Scene, View, ProxyWidget or Widget itself?
Qt 5.3 Opensource & Creator 3.1.2
Again (I hate to repeat myself...), what did you already try to solve your problem?
You did try the obvious - QGraphicsScene::selectionChanged(), QGraphicsScene::selectedItems() and QWidget::mousePressEvent(), right?
Well, then I must connect QWidget::mousePressEvent to QGraphicsScene's itemChanged signal?
Qt 5.3 Opensource & Creator 3.1.2
It would be hard to connect an event to a signal but I'm sure you already know it. I mean, you did try it, yes?
Well, Ive' reimplemented mousePressEvent in a following fashion:Now, the widget gets resized, but if I click on it again, it does not get smaller. Can you please tell me why?Qt Code:
{ if(event->button()==Qt::LeftButton) { if(windowState()==false) { setResizedState(true); } else { setResizedState(false); } // if } // if }To copy to clipboard, switch view to plain text mode
Qt 5.3 Opensource & Creator 3.1.2
Checking if state is false is probably a mistake, taking into consideration the fact that it returns a set of flags. Especially that you probably want to resize the proxy item, not the widget itself.
Well, the state related method is mine, why do I need to work with proxy (regarding zooming) instead of widget itself?
Qt 5.3 Opensource & Creator 3.1.2
You realize there is a QWidget::windowState() method, right?
It seems more natural when dealing with graphics view to operate on the item level. If you resize the proxy, the widget should follow. That's not zooming, by the way.why do I need to work with proxy (regarding zooming) instead of widget itself?
Bookmarks