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. palette for groupBox
Qt 6.11 is out! See what's new in the release blog

palette for groupBox

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 1.0k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I wrote:

     QPixmap bkgnd(":/immagini/sf.PNG");
        bkgnd = bkgnd.scaled(ui->groupBox->size(), Qt::IgnoreAspectRatio);
        QPalette palette = ui->groupBox->palette();
        palette.setBrush(QPalette::Background, bkgnd);
        ui->groupBox->setPalette(palette);
    
    

    it doesn't work

    jsulmJ 1 Reply Last reply
    0
    • ? A Former User

      I wrote:

       QPixmap bkgnd(":/immagini/sf.PNG");
          bkgnd = bkgnd.scaled(ui->groupBox->size(), Qt::IgnoreAspectRatio);
          QPalette palette = ui->groupBox->palette();
          palette.setBrush(QPalette::Background, bkgnd);
          ui->groupBox->setPalette(palette);
      
      

      it doesn't work

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #2

      @vale88 said in palette for groupBox:

      it doesn't work

      Would be nice to know what "doesn't work"...

      Did you check anything?
      Like https://doc.qt.io/qt-5/qpixmap.html#isNull

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      ? 1 Reply Last reply
      0
      • jsulmJ jsulm

        @vale88 said in palette for groupBox:

        it doesn't work

        Would be nice to know what "doesn't work"...

        Did you check anything?
        Like https://doc.qt.io/qt-5/qpixmap.html#isNull

        ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        @jsulm I don't see the image that I set

        jsulmJ 1 Reply Last reply
        0
        • ? A Former User

          @jsulm I don't see the image that I set

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @vale88 Then please check whether your pixmap is valid first...

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          ? 1 Reply Last reply
          0
          • jsulmJ jsulm

            @vale88 Then please check whether your pixmap is valid first...

            ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            @jsulm yes it's valid

            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