QtDesigner for Android - I'm not getting what I see at all, padding has no effect



  • I created simple Qt iu form in Qt Designer. I thought it is kind of WYSIWYG editor for Qt, but I'm starting to think it's more like WYSITUTWYG.

    Jokes aside, I am trying to use CSS as much as possible so that we can quickly change design once we have an idea that doesn't look like crap. This is the CSS, which is applied to MainWindow:

    * {
    margin: 0;
    padding: 0;
    }
    QWidget {
        background-color: black;
        color: white;
        font-family: Arial;
    }
    *[class="h1"] {
        color: yellow;
        background-color: rgb(50, 191, 12); /* light green*/
        font-size: 15pt;
        padding: 6px 8px 6px 8px;
    }
    QPushButton {
        background-color: rgb(50, 191, 12); /* light green*/
        color: black;
        padding: 2px 5px 2px 5px;
    }
    *[class="datapointWidget"], DataPoint {
       border: 1px solid white;
    }
    

    I am using custom dynamic property to use [class="h1"] selector. This one thing actually works really well.

    image description

    This is the result:

    image description

    As you can see we have some problems here:

    • padding has no effect at all
    • magically, yellow border appeared around headings
    • buttons did show green background but still also render natively
    • DataPoint widget has no border

    One thing that actually holds well is the weird right margin - the one thing I hoped was just a Designer visual bug, but actually appears in the program.



  • Try to load another style of Qt.

    QApplication a;
    a.setStyle(QStyleFactory::create("Fusion"));
    

    Maybe then it will be more obedient.


Log in to reply
 

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