From 10:00 CET Friday 22nd November we will adjust how the server works to deal with some recently reported problems. Therefore there may be a load problem, if you experience more problems than usual trying to access the forum then please PM AndyS or any of the moderators so they can inform me.


How to combine stylesheet descendant selector with property selector?



  • I had expected the following would work:

    *[styleAsPresetPanel="true"] QPushButton,
    *[styleAsPresetPanel="true"] QCheckBox
    {
       /* stylesheet */
    }
    

    This would mean that stylesheet would need to apply to any QPushButton or QCheckBox that is a descendant of any object that has the dynamic property styleAsPresetPanel set to true.

    Am I trying to do something that is simply not possible, or do I need to change the syntax?



  • I just noted that without the '*' it does work, in other words, the following works:

    QFrame[styleAsPresetPanel="true"] QPushButton,
    QFrame[styleAsPresetPanel="true"] QCheckBox
    {
        /* stylesheet */
    }
    

    Allthough this is enough for me to continue for now, my original question remains. I'd expect this to work with the '*' as well, but that doesn't seem to work. Is that a bug I should file, or are my expectations wrong?