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

Background images

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 886 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.
  • G Offline
    G Offline
    GrahamL
    wrote on last edited by
    #1

    Hi
    I have a widget to which I want to apply a background image
    I have done this by using a style sheet -
    @
    background-image: url(:/TestLogo/ASL2014 EMU Landscape background.jpg); background-position: top left; background-repeat: no-repeat;
    @
    This is fine as far as it goes-
    But when the window is re-sized by the user the image does not fill the whole of the widget.
    How is the best way to apply a background image to a widget and have it fill the whole of the widget when it is resized?

    Thanks

    1 Reply Last reply
    0
    • JeroentjehomeJ Offline
      JeroentjehomeJ Offline
      Jeroentjehome
      wrote on last edited by
      #2

      Use the border image, That will be resized automatic by a Widget. The background picture is a bit confusing ;-)
      @
      QString strStyle("QLabel{border-image: none}");
      ui->labelTitle->setStyleSheet(strStyle);
      @

      Greetz, Jeroen

      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