Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7183221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:56:07+00:00 2026-05-28T17:56:07+00:00

I am trying to perform several image manipulations using OpenGL ES 2.0 and display

  • 0

I am trying to perform several image manipulations using OpenGL ES 2.0 and display the output into a subclassed QDeclarativeItem which will then be used within my QML GUI.
I read through the answers found here: http://developer.qt.nokia.com/forums/viewthread/4109
and succeeded in drawing a red-to-blue colored rectangle within my QML GUI by overriding the paint() methode of the QDeclarativeItem:

void GLDeclarativeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
    painter->beginNativePainting();
    glBegin(GL_QUADS);
    glColor3ub(0,0,255);
    glVertex2d(0, 0);
    glVertex2d(0, height());
    glColor3ub(255,0,0);
    glVertex2d(width(), height());
    glVertex2d(width(), 0);
    glEnd();
    painter->endNativePainting();
}

However, what I am trying to achieve is to draw the image which will be handled within my custom QGLWidget as the content of the above described QDeclarativeItem (instead of the red-to-blue colored content).

Within my custom QGLWidget I am using:

void GLWidget::paintGL()
{
    glClear(GL_COLOR_BUFFER_BIT);
    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}

for drawing, which worked fine. However, I can not find the conversion between the drawing within my GLWidget and my GLDeclarativeItem. All the things I have tried so far just gave me a rectangle without any content at all.
Thanks for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T17:56:09+00:00Added an answer on May 28, 2026 at 5:56 pm

    I did a similar thing, but solved differently: I used an overlay.

    I simply put the OpenGL rendering in its own widget which is placed on top of the QDeclarativeView.

    This works quite well, although you cannot draw ontop of the OpenGL rendering. If you should really need to, stack over another QML view with a translucent background.

    Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a Windows cmd script to perform several tasks in series.
I'm trying perform a relatively basic TCP socket send/receive operation on Windows CE using
I'm trying to perform a search-replace in several JCLs but I need multi-line capabilities,
I am trying to update several rows in a table which match some criteria
I'm trying to perform a string replacement on several hundred awstats config files, and
I have several links I'm trying to create to either perform custom controller methods
Hi were trying to perform a mysql select which isnt going to plan and
Trying to perform a single boolean NOT operation, it appears that under MS SQL
Im trying to perform a mod rewriting to my web site. And I used
I'm trying to perform a LINQ query on a DataTable object and bizarrely I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.