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. Using style sheets... a few questions.
Forum Updated to NodeBB v4.3 + New Features

Using style sheets... a few questions.

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 734 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.
  • P Offline
    P Offline
    primem0ver
    wrote on last edited by
    #1

    I have a couple questions about using style sheets in Qt with widgets.

    I am using Qt Designer to create a user interface for a dialog box. I do not want to embed the pictures used in the style sheet as a resource. However, the dialog is part of a plugin. When using style sheets in a plugin to load a file such as a background image or an icon we are to use the following syntax:
    @
    "background-image: url(path/image.png);"
    @

    1. I understand "path" is relative but I cannot figure out what it is relative to when the program is actually executed. (In the designer it is relative to the location of the .ui file). I have used the working plugin directory as well as the executable directory as the assumed base directory for what "path/image.png" is added to. Neither have worked.

    2. Is it possible to use an alpha in a stylesheet so that a button or other ui object is transparent, or in my case, to allow a little of the background show through? QtDesigner seems to have a problem with using the following syntax in the style sheet: "background-color: rgba(255, 255, 255, 200);" when I enter that using the color picker.

    3. Can I assume that each object can have its own stylesheet?

    4. Do stylesheets get passed on to child objects? Because that is the way it looks in QtDesigner. I don't want my buttons and other objects to use the same background image (in which case they use the same object, only set to the top left corner which looks odd). Instead, I want the dialog background image to show behind the button (though mostly obscured by the button's background color).

    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