Results 1 to 5 of 5

Thread: Questions about zooming QGraphicsView

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2010
    Posts
    55
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Questions about zooming QGraphicsView

    Quote Originally Posted by Lykurg View Post
    Why not?
    Well, I suppose the main reason is that I want to keep all GUI-related design in the GUI editor. If I subclass QGraphicsView, then I have to manually code instantiation and adding it where I want it. I know it doesn't sound like a big deal, and actually sounds pretty silly, but the way I see it part of the benfit of having a WYSIWYG GUI designer is that you don't have to worry about this stuff anymore. Guess I'm just spoiled.

    Yes, by your view. That wouldn't be a problem if you would subclass your view. But as a workaround you can install an event filter on your view and handle the weel event there, or better do not handle it there so your function comes to play again.
    Well, I guess that's as good of an argument as any to subclass QGraphicsView.
    If only I had a nickel for every time I had to subclass an existing class to make one minor change...

    PS It worked, thanks!
    Last edited by JovianGhost; 20th March 2010 at 20:42.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Questions about zooming QGraphicsView

    Quote Originally Posted by JovianGhost View Post
    Well, I suppose the main reason is that I want to keep all GUI-related design in the GUI editor. If I subclass QGraphicsView, then I have to manually code instantiation and adding it where I want it. I know it doesn't sound like a big deal, and actually sounds pretty silly, but the way I see it part of the benfit of having a WYSIWYG GUI designer is that you don't have to worry about this stuff anymore. Guess I'm just spoiled.
    First, I am fine that you don't want to subclass!
    But I always wonder why people don't want to do so. As for your WYSIWYG argument: You can promote a widget in designer. So you can use your subclass and in designer it behaves like a normal graphics view and sets all properties correctly to your prometed subclass.

Similar Threads

  1. Replies: 0
    Last Post: 10th October 2009, 05:44
  2. zooming only x
    By mastupristi in forum Qwt
    Replies: 1
    Last Post: 7th May 2009, 08:23
  3. Zooming is too slow with QGraphicsView
    By learning_qt in forum Qt Programming
    Replies: 10
    Last Post: 4th December 2008, 09:23
  4. QGraphicsView general questions
    By sincnarf in forum Qt Programming
    Replies: 5
    Last Post: 15th October 2007, 23:22
  5. Zooming in QGraphicsView
    By JonathanForQT4 in forum Newbie
    Replies: 3
    Last Post: 17th April 2007, 05:50

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.