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. Qt Creator and dynamic property

Qt Creator and dynamic property

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 866 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.
  • gfxxG Offline
    gfxxG Offline
    gfxx
    wrote on last edited by A Former User
    #1

    I try to use stylesheet dynamic property on qt creator without succes ...

    
    ****** in qtcreator stylesheet ****************
    QComboBox  {color: black; border: 3px solid #5E749C;text-align: top;padding: 4px;border-radius: 7px; border-bottom-left-radius: 7px;background: white;width: 15px;height: 54px;} /* with or whitout is the same*/
    QComboBox [urgent = false] {color: black; border: 3px solid #5E749C;text-align: top;padding: 4px;border-radius: 7px; border-bottom-left-radius: 7px;background: white;width: 15px;height: 54px;}
    QComboBox [urgent = true] {color: black; border: 3px solid #5E749C;text-align: top;padding: 4px;border-radius: 7px; border-bottom-left-radius: 7px;background: green;width: 15px;height: 54px;}
    QComboBox:drop-down {color: black; border: 3px solid #5E749C;text-align: top;padding: 4px;border-radius: 5px; border-bottom-left-radius: 5px;background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0,stop: 0 #fff, stop: 1 #eee,stop: 0.5 #ddd,stop: 1 #eee );width: 44px;  max-height: 44px;}
    QComboBox:down-arrow {image: url(/home/b/res/downarrow.png); width: 24px; height: 24px;}
    
    
    /*******  then in main windows function foo *******/
    
            ui->m1comboBox->setProperty("urgent", true);
            ui->m1comboBox->style()->unpolish(ui->m1comboBox);
            ui->m1comboBox->style()->polish(ui->m1comboBox);
            //ui->m1comboBox->update(); /* with or without is the same*/
    

    but nothings appens ...

    regards
    Giorgio

    bkt

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      That's because your stylesheet is wrong, there should be no space between QComboBox and [.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3
      • gfxxG Offline
        gfxxG Offline
        gfxx
        wrote on last edited by
        #3

        works like a charm...
        regards
        giorgio

        bkt

        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