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-image || Border-image not working
Forum Updated to NodeBB v4.3 + New Features

Background-image || Border-image not working

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

    I'm building an application on Qt and I want to give a background image to the application. When I'm programming in my house, this piece of code works but when I make it in other place, this background image stops working...

    this -> mainWindow -> setStyleSheet("QMainWindow { \
                                                border-image: url(:/resources/BackGround.png) 0 0 0 0 stretch stretch; \
                                         }");
    

    Somebody can help me? Thanks BTW.

    JonBJ 1 Reply Last reply
    0
    • Q QSourceCreator

      I'm building an application on Qt and I want to give a background image to the application. When I'm programming in my house, this piece of code works but when I make it in other place, this background image stops working...

      this -> mainWindow -> setStyleSheet("QMainWindow { \
                                                  border-image: url(:/resources/BackGround.png) 0 0 0 0 stretch stretch; \
                                           }");
      

      Somebody can help me? Thanks BTW.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @QSourceCreator
      Are you absolutely sure that your built executable image contains the specified resource? You might verify by trying e.g. QPixmap pixmap(":/resources/BackGround.png"); and verifying !pixmap.isNull() at runtime in your code run on the other machine.

      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