Syntax Question



  • ok im back again o.o this time its syntax...

    i have what i think is the precise class tree entry for something, but im not sure how to designate that i want to change that EXACT thing... im working with a QSS stylesheet in notepad, example bit from it is

    @
    Qwidget
    {
    margin-top: 23px;
    }
    @
    the object im trying to change is i think

    Superclass: QAbstractSlider
    Parentclass: QSlider
    Classname: OptionsDialog
    objectname: opacitySlider

    EDIT: please use @-tags for code highlighting, Gerolf



  • Use function setObjectName() on your object called opacitySlider, for example

    @
    setObjectName("opacitySlider");
    @
    and then in QSS file just put

    @
    QSlider#opacitySlider { } ..
    @

    EDIT: please use @-tags for code highlighting, Gerolf



  • i dont have access to the actual code file

    sweet, the latter part worked :O thanks! just got to try it out, was out driving and had access to the comp for only short periods xD



  • Hi kyanos,

    if you go through the "docs":http://doc.qt.nokia.com/4.7/stylesheet.html you can find all the possible "selectors and selector types":http://doc.qt.nokia.com/4.7/stylesheet-syntax.html#selector-types .
    Hope those links help for the next time :-)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.