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. QLabel partially over a QOpenGlWidget
Forum Updated to NodeBB v4.3 + New Features

QLabel partially over a QOpenGlWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
qopenglwidget
1 Posts 1 Posters 757 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.
  • D Offline
    D Offline
    DavidArmand
    wrote on last edited by DavidArmand
    #1

    Hi,

    I have a problem when I render a QLabel partially over a QOpenGlWidget and another QLabel.
    The QOpenGlWidget and the QLabel under have the same black background.
    The render of the QLabel over is not the same over the QOpenGlWidget and the QLabel.

    Here the code :

    QApplication* l_app = new QApplication(argc, argv);
    QWidget* l_widget = new QWidget();
    l_widget->setObjectName("l_widget");
    l_widget->setStyleSheet("QWidget#l_widget{"\
                                            "    background-color:rgba(255, 255, 255, 255);" \
                                       "}");
    
    QVBoxLayout* l_layout = new QVBoxLayout();
    l_widget->setLayout(l_layout);
    
    QLabel* l_label = new QLabel();
    l_label->setObjectName("l_label");
    l_label->setText("Label Under");
    l_label->setStyleSheet("QLabel#l_label{"\
                           "    background-color:rgba(0, 0, 0, 255);" \
                           "    color : rgb(190,190,190);"
                           "    font: 40pt;"
                           "    font-weight : bold"
                                       "}");
    
    QOpenGLWidget* l_openGLWidget = new QOpenGLWidget();
    
    l_layout->addWidget(l_label);
    l_layout->addWidget(l_openGLWidget);
    
    QLabel* l_labelOver = new QLabel(l_widget);
    l_labelOver->setObjectName("l_labelOver");
    l_labelOver->setText("Label Over");
    l_labelOver->setStyleSheet("QLabel#l_labelOver{"\
                               "    background-color:rgba(255, 0, 0, 100);" \
                               "    color : rgb(190,190,190);"
                               "    font: 35pt;"
                               "    font-weight : bold"
                                           "}");
    l_labelOver->setGeometry(150,150,300,300);
    
    l_widget->setMinimumSize(QSize(600,600));
    l_widget->setMaximumSize(QSize(600,600));
    l_widget->show();
    
    int res = l_app->exec();
    return res;
    
    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