Results 1 to 7 of 7

Thread: QStackedLayout with StackAll Forwarding events to other pages

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QStackedLayout with StackAll Forwarding events to other pages

    Quote Originally Posted by planglois View Post
    I have to show widget which represents an event in the time. The position where the EventWidget is shown in his parent is relative to his time of start. I have created a layout which allows me to do this. It can be compare to a multitrack editor like Adobe Premiere. Each video sequence begins at a specific time in the track...

    For a specific track I need to add one or more warning button that tell the user that the track contains errors. The user can then push the button to get help on the problem.

    That's the context! So I have:
    • The parent widget (the one with the gray gradient and the "green profile"). This widget can receive events that allow the parent to be selected, resized, moved...
    • the first stack: A widget with QHBoxLayout::AlignLeft|AlignTop that contains QToolButton.
    • the second stack: contains a list of EventWidget... The parent itself is an EventWidget that is shown in time, so it is critical that his child EventWidget be aligned with the parent start position.


    With this setup, when I select an EventWidget (topmost layer), everything work fine. When I click on the parent widget, the topmost layer receives the event and he is forwarding it to the parent widget and that's also good. When I click on one warning button (the middle layer), the topmost layer receives the event and he is forwarding it to the parent which is not good.

    What I need is a way to send an unused event to the layer below. Now when an event is not used by a widget, it is automatically forwarded to the parent. Is there a way to do an automatic forwarding of the unused event to an other widget?
    Are you sure you want to do it with widgets? Using QGraphicsView and its items instead would be much simpler for you. And you'd get the event behaviour you want for free.



    In my opinion, if a widget is shown, it can be clicked!
    Well, yes but provided there is no widget on top of it. Widgets' rectangles shouldn't overlap and I understand that in this case they do.

    What I find incredible is that unused events are forwarded to the parent (and translated in the parent context) automatically. So there is a piece of code that does this somewhere. That exactly what I need, but with a different destination.
    The code is probably in QCoreApplication::notify(). You can reimplement it if you want, but I really wouldn't do that here. What you could do is to bounce back those events in the "parent" as it is the one that knows where each widget is. But I'd suggest switching to Graphics View, it should really be helpful here and possibly in future as well.

  2. The following user says thank you to wysota for this useful post:

    planglois (4th September 2008)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.