Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Strange slider behavior

    Mobile and Embedded
    1
    2
    424
    Loading More Posts
    • 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.
    • Flaming Moe
      Flaming Moe last edited by

      Hey ho Giggity,

      i´m stumbling in my way on Qt on an Android driven XPeria.
      Basicly i´m making up a very simple Apple to get a feeling for different kind of things.
      https://www.dropbox.com/s/bqnir2gg8sz9ehk/Screenshot_2015-03-12-21-23-46.jpg?dl=0
      One of them is to give a slider a custom appearance by applying stylesheets
      S1->setStyleSheet("QSlider::groove:horizontal{border: 40px solid #800040; height: 10px; background: red; margin: 20px 0} QSlider::handle:horizontal{background: blue; margin: 70px; border 20px solid black; width: 70px; height: 70px}");

      What makes me wondering is that i can´t scroll the slider. It only moves, if i "double-klick" with my finger somewhere on the groove. Then the handle come over. But i can´t press the handle directly and move it.

      Does someone have a suggestion?

      A lovely day for a ̶g̶̶u̶̶i̶̶n̶̶n̶̶e̶̶s̶ DUFF^^

      1 Reply Last reply Reply Quote 0
      • Flaming Moe
        Flaming Moe last edited by

        Ok, solved it my self.
        The stylesheet syntax was wrong. Actually i have little problems to figure out the mechanisms.

        This works:

        slider1->setGeometry(50, 370, 900, 140);

        slider1->setStyleSheet("QSlider::groove:horizontal{border: 20px solid #800040; height: 10px; background: red; margin: 90px 0} QSlider::handle:horizontal{background-color: green; border: 3px solid blue; width: 140px; border-radius: 3px; margin: -65px}");

        A lovely day for a ̶g̶̶u̶̶i̶̶n̶̶n̶̶e̶̶s̶ DUFF^^

        1 Reply Last reply Reply Quote 0
        • First post
          Last post