Results 1 to 4 of 4

Thread: Qt 5.7 version widget promoting to opengl

  1. #1
    Join Date
    Jul 2017
    Posts
    7
    Qt products
    Qt5
    Platforms
    Windows

    Default Qt 5.7 version widget promoting to opengl

    Hi,
    I promoted Qt (5.7.0 version) widget to opengl.Opengl window is creating but openl commands are not working ex:glcolor(),glclearcolor(),glBegin() etc., and also i am not able to do initializeGL(),PaintGL() functions .Whether Qt 5.7.0. version will support to work on opengl or not?

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qt 5.7 version widget promoting to opengl

    At least for me your question is not clear.
    Since you are using the term "promoting" I assume you mean the designer feature of promoting widgets.
    If this is the case, it seems you don't understand what promotion does.
    Promotion is simply a tool to allow designer to generate the correct headers and class names that are already defined in your project but that are not available to designer.
    Promotion has no functional influence on your code.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Jul 2017
    Posts
    7
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qt 5.7 version widget promoting to opengl

    Before i have worked on opengl for drawing on QT 4.5 version,that was working fine.But the same code applying on the Qt 5.7.0. version platform it is not working.How to use opengl code or commands on Qt 5.7.0 platform.
    Ex:
    void GLWidget:: initializeGL()
    {
    glClearColor(0.0,0.0,0.0,0.0);
    glPushMatrix();
    glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glEnable(GL_LINE_SMOOTH);
    glEnable(GL_POINT_SMOOTH);
    glEnable(GL_POLYGON_SMOOTH);
    glEnable(GL_BLEND);
    glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
    glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
    glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
    glPolygonMode(GL_NONE,GL_LINE);

    do_Actual_Drawing();

    glDisable(GL_LINE_SMOOTH);
    glDisable(GL_POINT_SMOOTH);
    glDisable(GL_POLYGON_SMOOTH);
    glDisable(GL_BLEND);
    glPopMatrix();

    }
    Above code is wrking on Qt4.5 but not working on QT 5.7.0 version.
    How to write opengl code on Qt 5.7.0 version ?

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qt 5.7 version widget promoting to opengl

    What does "not working" mean exactly?
    Does it not build`
    Does it build, but not behave the same way?

    I didn't do anything with GLWidget since Qt5x, so I can't say from experience, but from the docs it doesn't look that much has changed in how you should use it.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Promoting Widget, plotting
    By Blitzor DDD in forum Qt Programming
    Replies: 6
    Last Post: 25th July 2016, 17:31
  2. Promoting to custom widget
    By cia.michele in forum Newbie
    Replies: 2
    Last Post: 26th September 2010, 11:38
  3. Promoting widget in Designer
    By evident in forum Qt Programming
    Replies: 5
    Last Post: 24th July 2010, 22:06
  4. Error when promoting a custom widget
    By engin in forum Qt Tools
    Replies: 1
    Last Post: 15th December 2006, 16:00
  5. Promoting a custom widget derived from QWidget Qt4
    By high_flyer in forum Qt Tools
    Replies: 1
    Last Post: 2nd March 2006, 18:50

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.