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. Add a new widget in QGridLayout - Backgroud not displayed
Forum Updated to NodeBB v4.3 + New Features

Add a new widget in QGridLayout - Backgroud not displayed

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 880 Views 1 Watching
  • 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.
  • M Offline
    M Offline
    Mistrale
    wrote on last edited by
    #1

    Hi,

    I have a QWidget with a QGridLayout containing two others widget. When I dynamically add a new widget to the grid and want to show it, it shows the new widget but not its background. None of its parents widget have a background css style. How can I resolv this so my new background widget is shown ?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What background should there be ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Mistrale
        wrote on last edited by Mistrale
        #3

        an image set in the css with qt designerw. I have basically two designer class : News and Everwyhere Window, and the code below :

        GUI::EverywhereWindow::EverywhereWindow(QWidget *parent) :
        QWidget(parent),
        ui(new Ui::EverywhereWindow),
        _menuOpen(true)
        {
        ui->setupUi(this);

        GUI::News *news = new GUI::News(this);
        ui->gridLayout->addWidget(news, 2, 0);
        ui->globalWidget->hide();
        

        }

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Are you sure the image is found at run time ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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