Results 1 to 1 of 1

Thread: error: cannot convert 'QVector<QVector3D>' to 'const GLvoid* {aka const void*}' in a

  1. #1
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: error: cannot convert 'QVector<QVector3D>' to 'const GLvoid* {aka const void*}' i

    I have defined vertices as
    Qt Code:
    1. QVector<QVector3D> vertices
    To copy to clipboard, switch view to plain text mode 

    I get the above error when calling:
    Qt Code:
    1. glBufferData(GL_ARRAY_BUFFER,
    2. sizeof(vertices)+sizeof(colors),
    3. vertices, GL_STATIC_DRAW );
    To copy to clipboard, switch view to plain text mode 

    I cannot cast vertices to GLvoid*. is there anyway to do that?

    Besides, in
    Qt Code:
    1. glVertexPointer(2, QVector3D, 0, 0);
    To copy to clipboard, switch view to plain text mode 
    QVector3D is also not recognized, having prototype:
    Qt Code:
    1. GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type,
    2. GLsizei stride, const GLvoid *ptr );
    To copy to clipboard, switch view to plain text mode 

    any ideas?


    Added after 1 4 minutes:


    OOoooooooppppssss, I totally forgot about
    .constData
    Last edited by saman_artorious; 22nd June 2013 at 10:02.

Similar Threads

  1. Replies: 4
    Last Post: 7th June 2012, 10:14
  2. Replies: 2
    Last Post: 7th June 2012, 06:28
  3. How to convert string into const int ?
    By babygal in forum Qt Programming
    Replies: 3
    Last Post: 16th July 2010, 10:57
  4. How to convert QString to const char*
    By fulin in forum Newbie
    Replies: 7
    Last Post: 9th May 2010, 23:25
  5. Replies: 1
    Last Post: 4th December 2009, 17:03

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.