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. Qss Slider Question
Forum Updated to NodeBB v4.3 + New Features

Qss Slider Question

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 450 Views
  • 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.
  • H Offline
    H Offline
    hunter Li
    wrote on last edited by hunter Li
    #1

    ui.xxx->setStyleSheet(
    "QSlider::handle:horizontal{width: 50px; height: 50px; }"
    );
    Perhaps my question is a bit silly. I don't know what the pre condition for QSlider to control the size of the slider is. At least, I seem to have no problem with this line of code. Maybe it can be displayed in CSS, but I don't see the appropriate style.

    jsulmJ JoeCFDJ 2 Replies Last reply
    0
    • H hunter Li

      ui.xxx->setStyleSheet(
      "QSlider::handle:horizontal{width: 50px; height: 50px; }"
      );
      Perhaps my question is a bit silly. I don't know what the pre condition for QSlider to control the size of the slider is. At least, I seem to have no problem with this line of code. Maybe it can be displayed in CSS, but I don't see the appropriate style.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @hunter-Li said in Qss Slider Question:

      but I don't see the appropriate style

      What do you mean by that?
      If you set stylesheet then it overrides the WHOLE stylesheet.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      JonBJ 1 Reply Last reply
      0
      • jsulmJ jsulm

        @hunter-Li said in Qss Slider Question:

        but I don't see the appropriate style

        What do you mean by that?
        If you set stylesheet then it overrides the WHOLE stylesheet.

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @jsulm
        I might be wrong, but I think the ui.xxx->setStylesheet() indicates that OP is setting this on xxx widget? I think he is saying it is not taking effect (assuming his xxx widget holds the QSlider?

        1 Reply Last reply
        0
        • H hunter Li

          ui.xxx->setStyleSheet(
          "QSlider::handle:horizontal{width: 50px; height: 50px; }"
          );
          Perhaps my question is a bit silly. I don't know what the pre condition for QSlider to control the size of the slider is. At least, I seem to have no problem with this line of code. Maybe it can be displayed in CSS, but I don't see the appropriate style.

          JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by
          #4

          @hunter-Li
          https://doc.qt.io/qt-6/stylesheet-examples.html#customizing-qslider
          and
          https://stackoverflow.com/questions/38071131/how-to-adjust-a-qsliders-handle

          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