Results 1 to 5 of 5

Thread: How to use "bindTexture()" in QtQuick project

  1. #1
    Join Date
    Aug 2013
    Posts
    27
    Thanks
    3

    Default How to use "bindTexture()" in QtQuick project

    Hi,
    I want to draw some rotating cubic in background of a qml program. I inherit a class from Object and export it to qml as "GLBG" and can call openGL function in animation slot, which just like the example of QT: "Scene Graph - OpenGL Under QML".
    The problem is I do not know how to bind a picture as Texture. Other samples of Qt are using QGLwidget, and QGLwidget provide bindTexture() to create a Texture from a bitmap, but this fucntion can not be called in a QObject sub class. I hear that can not use QGlWidget in Qt Quick 2.0. How can I do?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,420
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to use "bindTexture()" in QtQuick project

    Isn't there glBindTexture()?

    Cheers,
    _

  3. #3
    Join Date
    Aug 2013
    Posts
    27
    Thanks
    3

    Default Re: How to use "bindTexture()" in QtQuick project

    Yes,. but bindTexture() encapsulate better. If use glBindTexture, I need convert QImage to Texture data, how can I do? Is there any sample code to draw cubic with Texture in qml?

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

    Default Re: How to use "bindTexture()" in QtQuick project

    Either do the needed conversion manually (if needed) or if you can use QOpenGLTexture class.
    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.


  5. #5
    Join Date
    Aug 2013
    Posts
    27
    Thanks
    3

    Default Re: How to use "bindTexture()" in QtQuick project

    Thank you, I will try.

Similar Threads

  1. Error: plugin cannot be loaded for module "QtQuick".
    By user_mail07 in forum Qt Quick
    Replies: 2
    Last Post: 25th April 2015, 13:49
  2. Replies: 0
    Last Post: 20th November 2011, 12:41
  3. Replies: 3
    Last Post: 15th February 2010, 17:27
  4. Replies: 3
    Last Post: 8th July 2008, 19:37
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05

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.