Results 1 to 10 of 10

Thread: One QGraphicsScene in two QGraphicsViews

  1. #1
    Join Date
    Mar 2009
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default One QGraphicsScene in two QGraphicsViews

    Is it possible to have one scene in two views with two different sizes?

  2. #2
    Join Date
    Aug 2009
    Posts
    52
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: One QGraphicsScene in two QGraphicsViews

    Of course.

  3. #3
    Join Date
    Mar 2009
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: One QGraphicsScene in two QGraphicsViews

    I forgot to tell that the same scene should be scaled to fit the view

  4. #4
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: One QGraphicsScene in two QGraphicsViews

    That doesn't change anything.

  5. #5
    Join Date
    Mar 2009
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: One QGraphicsScene in two QGraphicsViews

    So how do i do that?

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

    Default Re: One QGraphicsScene in two QGraphicsViews

    You set the same scene on both views and call fitInView (or apply whatever else transformation you want) on each of them.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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

    klaviaturist (29th March 2011)

  8. #7
    Join Date
    Mar 2009
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: One QGraphicsScene in two QGraphicsViews

    Thanks, I will try that


    Added after 16 minutes:


    That was a nice solution but it doenn't help me all the way. The pixmaps gets to distorted when scaling from 1280 px to 280 px so I will use me previous code for that part.

    One issue remains: I'm having a video player that needs to be displayed at two scenes and controlled from one place. How do i connect two players to one seekslider and play and stop button?
    Last edited by klaviaturist; 29th March 2011 at 21:55.

  9. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: One QGraphicsScene in two QGraphicsViews

    Quote Originally Posted by klaviaturist View Post
    The pixmaps gets to distorted when scaling from 1280 px to 280 px
    Enable smooth pixmap transformations render hint on the view.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  10. #9
    Join Date
    Mar 2009
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: One QGraphicsScene in two QGraphicsViews

    Hmm, I still get the pixmap distorted. Is there any other settings that affects the rendering of the view?

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

    Default Re: One QGraphicsScene in two QGraphicsViews

    Please post your code for setting up the view.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 3
    Last Post: 2nd August 2010, 10:12
  2. Scrolling 2 QGraphicsViews with 1 scrollbar
    By dentist in forum Newbie
    Replies: 2
    Last Post: 14th April 2010, 02:12
  3. Multiple QGraphicsViews with one QGraphicsScene
    By alisami in forum Qt Programming
    Replies: 3
    Last Post: 22nd March 2010, 03:02
  4. in QGraphicsScene matrix of other QGraphicsScene
    By Noxxik in forum Qt Programming
    Replies: 5
    Last Post: 15th February 2009, 17:27
  5. Replies: 3
    Last Post: 2nd February 2009, 23:40

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.