Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Background images

    General and Desktop
    2
    2
    639
    Loading More Posts
    • 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
      GrahamL last edited by

      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 Reply Quote 0
      • Jeroentjehome
        Jeroentjehome last edited by

        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 Reply Quote 0
        • First post
          Last post