Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Help with old example of Qt widgets embedded in OpenGL

Help with old example of Qt widgets embedded in OpenGL

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    esnyder
    wrote on last edited by
    #1

    Hi!

    I was following this example:
    http://labs.qt.nokia.com/2008/06/27/accelerate-your-widgets-with-opengl/

    I wanted to use QDialog to add widgets into my scene just like the article explains. I wanted each widget to have its own title bar. However, when I follow the example, I see no title bar at all. I've also tried building the example project from git but it operates differently, as well - the dialogs have close buttons even though CustomizeWindowHint is specified.

    Is there a more up to date way to accomplish this? It seems either the example is pretty far out of date (it is from 2008!) or some of the Qt functionality simply doesn't work the same way.

    Here is a quick example of my code that shows no title bars:

    @
    QGraphicsView view;

    view.setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
    view.setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
    view.setScene(new MyGLScene(0));
    
    QWidget *dialog = new QDialog(0, Qt::CustomizeWindowHint | Qt::WindowTitleHint);
    dialog->setWindowOpacity(0.8);
    dialog->setWindowTitle("Sample");
    dialog->setLayout(new QVBoxLayout);
    dialog->layout()->addWidget(new QLabel("Hello!"));
    
    view.scene()->addWidget(dialog);
    
    view.show();
    

    @

    [[ Mark up code, Tobias ]]

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved