Results 1 to 20 of 20

Thread: Clone QGraphicsView (master-slave display)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2015
    Posts
    52
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Clone QGraphicsView (master-slave display)

    How could I display part of the QMainWindow's widgets to a slave window/dockwidget ?

    Essentially I have two docked widgets and a view with a scene containing a geographical map in a pixmap, many painted paths and a marker of the current gps position in it. I would like to replicate what's displayed on the central view and one of the two docks. This replica would be in a different window of a different screen.

    So far I've tried adding the main scene to a new QGraphicsView but of course zoom and position of the view is not preserved from master to slave. I could re-do any transformation, but it feels there should be a better way. I guess I could also create a secondary MainWindow and relate them somehow. I am unsure which choice is the most appropriate and efficient or if there are other possibilites. I've also seen it's possible to display screenshots of a window in a QLabel, but that wouldn't allow me to remove the extra dock and toolbars.

    The only difference between master-slave is size and position and the removal of this one dock and (if possible) toolbars and so on. Any ideas on how to achieve this?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Clone QGraphicsView (master-slave display)

    Aside from showing the same scene in two views. you could try rendering the primary view into an image and display that image.

    You'll have to experiement if calling render() on the graphicsview or its viewport() results in the content you want.

    Cheers,
    _

Similar Threads

  1. display .svg in QGraphicsView
    By Surfman19 in forum Qwt
    Replies: 7
    Last Post: 13th May 2017, 21:53
  2. Replies: 1
    Last Post: 24th January 2015, 17:21
  3. couldnt create slave
    By prophet0 in forum Qt Programming
    Replies: 0
    Last Post: 19th December 2011, 17:50
  4. Display an image in a QGraphicsview
    By emilio in forum Newbie
    Replies: 8
    Last Post: 6th December 2011, 06:55
  5. Replies: 5
    Last Post: 15th April 2011, 11:23

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.