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. how can adjust dimension from stylesheet settings in px due to screen dpi
QtWS25 Last Chance

how can adjust dimension from stylesheet settings in px due to screen dpi

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 1.7k 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.
  • mmcmmcM Offline
    mmcmmcM Offline
    mmcmmc
    wrote on last edited by mmcmmc
    #1

    I can detect screen dpi and resize widgets in code. But how can i re-scale dimensions comes from stylesheet?

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

      Hi,

      What dimension are you referring to ?

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

      mmcmmcM 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        What dimension are you referring to ?

        mmcmmcM Offline
        mmcmmcM Offline
        mmcmmc
        wrote on last edited by
        #3

        @SGaist Hi,
        I would like to adjust dimensions like max-width, min-width xx px. I would like to re-scale px to dpi..

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

          Then you should create your style sheet dynamically so you can update the values you need from code.

          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
          0
          • mmcmmcM Offline
            mmcmmcM Offline
            mmcmmc
            wrote on last edited by
            #5

            So you mean i should make a dynamic style sheet creator which part of my app. Yes it's a idea but not practical way.

            Can't i handle style sheet engine or applicator in qt class somewhere?

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

              Why a style sheet generator ? How are you currently setting the style sheet ?

              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
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved