Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. bakground color inherited from background widget PyQT5 Designer
Forum Updated to NodeBB v4.3 + New Features

bakground color inherited from background widget PyQT5 Designer

Scheduled Pinned Locked Moved Unsolved Qt for Python
2 Posts 2 Posters 436 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.
  • F Offline
    F Offline
    Federikowsky
    wrote on 3 Nov 2022, 12:44 last edited by
    #1

    I opened a new file as QWidget in PyQT5 and put some QPushButtons in it. but by inserting the background into Widget, the same image is also inherited as the background of the button and any other element I try to insert on it. I add this on styleSheet of widget

    border-image: url("myUrl");
    

    i also tried with this styleSheet, but the result is not full screen as expected

    background-image: url("VolleyBall_Pitch.png"); 
    background-repeat: no-repeat; 
    background-position: center;
    

    Screenshot 2022-11-03 at 13.42.53.png

    1 Reply Last reply
    0
    • F Offline
      F Offline
      feiyuhuahuo
      wrote on 9 Nov 2022, 07:08 last edited by
      #2

      You can try specify the objectName to make the style only work on that widget. Use "#". Like this afc2e7ad-b2c0-4797-851b-c1ed37f01e7b-image.png
      "tab" is the objectName , if I put some buttons in "tab",the button will not inherit the background style.

      1 Reply Last reply
      0

      1/2

      3 Nov 2022, 12:44

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved