Results 1 to 2 of 2

Thread: QPainterPath cannot work with OpenGL?

  1. #1
    Join Date
    May 2011
    Location
    North Carolina
    Posts
    23
    Thanks
    10
    Qt products
    Qt4

    Default QPainterPath cannot work with OpenGL?

    For a simple OpenGL code:
    Qt Code:
    1. void display(void)
    2. {
    3. glClear(GL_COLOR_BUFFER_BIT);
    4.  
    5. glColor3f (0.0, 1.0, 0.0);
    6. glPushMatrix();
    7. glRotatef(-rotAngle, 0.0, 0.0, 0.1);
    8. glBegin (GL_LINES);
    9. glVertex2f (-0.5, 0.5);
    10. glVertex2f (0.5, -0.5);
    11. glEnd ();
    12. glPopMatrix();
    13.  
    14. glColor3f (0.0, 0.0, 1.0);
    15. glPushMatrix();
    16. glRotatef(rotAngle, 0.0, 0.0, 0.1);
    17. glBegin (GL_LINES);
    18. glVertex2f (0.5, 0.5);
    19. glVertex2f (-0.5, -0.5);
    20. glEnd ();
    21. glPopMatrix();
    22.  
    23. glFlush();
    24. }
    To copy to clipboard, switch view to plain text mode 

    I mean, whether I could add the lines drawn by OpenGL as a path defined by QPainterPath ?

    Then I could operate using the "path" more easily.

    Thanks a lot

  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: QPainterPath cannot work with OpenGL?

    I think what you really want is a vector (e.g. a QVector) of coordinates and not a painter path.
    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. The following user says thank you to wysota for this useful post:

    superwave (27th June 2011)

Similar Threads

  1. QPainterPath::quadTo(...) calls QPainterPath::cubicTo(...) ?
    By brucelamond in forum Qt Programming
    Replies: 0
    Last Post: 28th April 2011, 23:30
  2. How to work with OpenGL and QT?
    By prof1990 in forum Qt Programming
    Replies: 3
    Last Post: 28th April 2011, 12:56
  3. Qt-4.6.0: opengl es2 can't work on beagle
    By favor in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 19th January 2010, 07:35
  4. for the openGl to work should the direct rendering be enabled
    By babu198649 in forum General Programming
    Replies: 1
    Last Post: 27th April 2008, 15:22
  5. QPainterPath.arcTo
    By grellsworth in forum Qt Programming
    Replies: 1
    Last Post: 18th March 2008, 17:36

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.