Results 1 to 3 of 3

Thread: 3D rendering on Ubuntu using QGLWidget

  1. #1
    Join Date
    Jul 2007
    Posts
    90
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default 3D rendering on Ubuntu using QGLWidget

    Hi all,

    I have created 3D object by inheriting QGLWidget as well as QGraphicsItem.
    I am inheriting QGraphicsItem to add this 3D object into QGraphicsScene by using addItem().
    The class looks like this

    class My3DItem : public QGLWidget, public QGraphicsItem
    {
    }
    I have done some tricks to work this on Linux. Actually adding item to the scene calls paint()
    method.I have reimplemented paint() method and calling glDraw() through this implementation to call paintGL() method.

    This trick is working on Fedora but not on Ubuntu.

    Can anyone guide me on this. If someone interested in the code i can upload it also.

    Thanks in advance.

    Regards,
    ~Sanjay

  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: 3D rendering on Ubuntu using QGLWidget

    Inheriting from a graphics item and a widget makes no sense, even if it works in some environment. You can use QGraphicsProxyWidget if you want, but AFAIR it doesn't work with GL widgets.

  3. #3
    Join Date
    Jul 2007
    Posts
    90
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: 3D rendering on Ubuntu using QGLWidget

    Thanks,

    Actually I am developing an application which shows sevral different items.
    I am using graphicsview architecture for showing such items.
    Among these several items there are3D items such as Pyramid, pentagon, Sphere etc.
    To crate such items i have used opengl and to add it to the scene i need to inherit it form QGraphicsItem as well.
    Your suggestions will be helpful for me.

    Regards,
    ~Sanjay

Similar Threads

  1. Tile rendering with QGLWidget
    By h123 in forum Qt Programming
    Replies: 2
    Last Post: 10th November 2008, 22:27
  2. Replies: 0
    Last Post: 7th April 2008, 14:27

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.