Results 1 to 7 of 7

Thread: Add QGLWidget to view

  1. #1
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    46
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Change QWidget to QGraphicsItem

    hi to all,


    I have a proble there is any way to change QWidget to QGraphicsItem .

    Basically i made a Pyramid with the held of opengl's QGLWidget.
    Now i want to add this widget to my QGraphicsScene ...
    but how will i do i don't know .
    so pls help me to overcome this problem.
    Thanks
    Ashish Kumar Saryar
    Ashish Kumar Saryar

  2. #2
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    124
    Thanked 38 Times in 30 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Change QWidget to QGraphicsItem

    It's not really possible to make this work (at least not well) until in the upcoming Qt 4.4. If you download a snapshot from ftp.trolltech.com/qt/snapshots you can try two new classes, QGraphicsWidget and QGraphicsProxyWidget, which are provided to make life easier for you.
    Bitto / Andreas Aardal Hanssen - andreas dot aardal dot hanssen at nokia
    Nokia Software Manager, Qt Development

  3. The following user says thank you to Bitto for this useful post:

    ashishsaryar (25th January 2008)

  4. #3
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    46
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Change QWidget to QGraphicsItem

    actually i have to draw a pyramid with 3d .. and i have to show on qgraphcsscene or qgraphics ..

    if u haveany idea pls share with me
    Ashish Kumar Saryar

  5. #4
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    46
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Add QGLWidget to view

    hi to all

    i have made a pyramid with the help of opengl.. means with the help of QGLWidget ..

    i have also a frame of QMainwindow .
    i have setCentralWidget of this frame a graphicsview .
    i have also some qgraphicsitem which i m adding to grapphicsview with the help of graphicsscene...

    in this i wnt to add this pyramid also but how will i do i don't .
    so pls help me to overcome this problem. pls
    thanks in advance

    Ashish Kumar Saryar

  6. #5
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    46
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Add QGLWidget to view

    Hi to all,


    I have created a pyramid by using QGLWidget. I have also a widget in which central widget is Qgraphicsview and i am and its scene many qgraphicsitem . i want to add this pyramid which is made by the help of qgjwidget but how i dont know . if uhave any idea then pls share with me...

    Thanks in advance....

    Ashish Kumar Saryar

  7. #6
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Add QGLWidget to view

    QGLWidget is inherited from QWidget, so you can use the QWidget::show() function to display the widget.

    Also if u have a graphicsview, u can alter its rendering using setViewPort() function. Refer to the 40000 chips demo program in the Qt Demos

  8. #7
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Add QGLWidget to view

    { Threads merged }

    Do not start new threads on the same subject, please.
    J-P Nurmi

Similar Threads

  1. QGLWidget resize problem.
    By anderl in forum Qt Programming
    Replies: 2
    Last Post: 22nd January 2008, 08:57
  2. Replies: 2
    Last Post: 22nd July 2007, 19:21
  3. Model, View and Proxy
    By No-Nonsense in forum Qt Programming
    Replies: 2
    Last Post: 21st November 2006, 08:50
  4. Model - View Programming doubt.
    By munna in forum Qt Programming
    Replies: 4
    Last Post: 28th April 2006, 13:01
  5. Replies: 6
    Last Post: 20th April 2006, 10:23

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.