Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QtDesigner for Android - I'm not getting what I see at all, padding has no effect
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
designercssandroid
2 Posts 2 Posters 1.5k 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.
  • M Offline
    M Offline
    MXXIV
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • SeeLookS Offline
      SeeLookS Offline
      SeeLook
      wrote on last edited by SeeLook
      #2

      Try to load another style of Qt.

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

      Maybe then it will be more obedient.

      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