Results 1 to 4 of 4

Thread: Using QGraphics Items/Scenes/Views with a QGLWidget

  1. #1
    Join Date
    May 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Using QGraphics Items/Scenes/Views with a QGLWidget

    I have been tasked with drawing 2D objects that have been subclassed from QGraphicsItems in QT onto a projected 2D osgEarth Map.

    I have been reading the various forums and have learned that there is no easy way of combining osgearth::qtgui::viewerwidget(QGLWidgets) and QGraphics and the quick fix is to set the QGraphicsView's viewport as my qGLWidget.
    I have attempted this but it does not produce the desired effect.

    I would like to both have a dynamic/user controllable map which I have before setting the viewport, and a controllable qgraphicsview but if i set the view port with my projected map I lose control of the map.

    I have to believe that there have been other people that have attempted this project I am looking for someone to throw out a lifeline.

    I am rather new to osgEarth but reasonably versed in Qt and C++.

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

    Default Re: Using QGraphics Items/Scenes/Views with a QGLWidget

    What exactly have you tried? Setting osgearth::qtgui::viewerwidget as Graphics Views's viewport had a chance of working.
    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.


  3. #3
    Join Date
    May 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Using QGraphics Items/Scenes/Views with a QGLWidget

    Setting the viewer widget as the viewport in my case is like setting the background for the qgraphicsview however it sets in the bottom left corner of the widget and all of the my attempts at enlarging it to fit the size of the widget fail. And I can no longer zoom/pan/rotate the map.

    Other than that I have worked through QProxyWidget until I read qglwidgets are not support of which a qtviewerwidget is subclass of that.

    My end goal is to create a map that has the controls mentioned above and where I can draw players such as ground vehicles that I can zoom into.

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

    Default Re: Using QGraphics Items/Scenes/Views with a QGLWidget

    Maybe you need to apply some transform to the map?
    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. composition of qgraphics items on qscene graph
    By qtboy in forum Qt Programming
    Replies: 0
    Last Post: 27th June 2015, 05:49
  2. How to catch items dropped out of scenes?
    By Gourmet in forum Qt Programming
    Replies: 7
    Last Post: 2nd February 2015, 23:24
  3. Saving QGraphics Scene items
    By chaltier in forum Qt Programming
    Replies: 1
    Last Post: 3rd April 2012, 07:35
  4. Replies: 4
    Last Post: 3rd June 2011, 11:35
  5. Items in QGraphics View not starting from the top.
    By penny in forum Qt Programming
    Replies: 3
    Last Post: 1st April 2011, 14:10

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.