Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. scaling

    Log in to post
    • All categories
    • S

      Unsolved Qt 6.3.1 Windows icons are upscaled at 125% scaling instead of downscaled from @2x
      Qt 6 • scaling qicon qt6.3.1 • • Stiaan

      2
      1
      Votes
      2
      Posts
      198
      Views

      S

      It's probably the same as https://bugreports.qt.io/browse/QTBUG-90634

    • C

      Solved How can I make my app ignore window's "HIGH DPI SCALING"?
      General and Desktop • widgets dpi awareness scaling • • Curtwagner1984

      12
      0
      Votes
      12
      Posts
      2798
      Views

      C

      @J-Hilk said in How can I make my app ignore window's "HIGH DPI SCALING"?:

      [Platforms]
      WindowsArguments = dpiawareness=0

      Thank you! I tried to used this before but I've put incorrect syntax in this file. This works.

    • Guy Gizmo

      Unsolved Is there any way to smoothly scale and draw a section of a QPixmap that's defined by a QRectF?
      General and Desktop • qpixmap qpainter scaling qrectf • • Guy Gizmo

      3
      0
      Votes
      3
      Posts
      252
      Views

      Guy Gizmo

      I'm afraid that doesn't help for my use case, since I need the images to appear as clear and clean as possible when being scaled down.

    • K

      Unsolved Gauge strange margin and labels problems
      QML and Qt Quick • gauge scaling margin label • • Kyeiv

      1
      0
      Votes
      1
      Posts
      100
      Views

      No one has replied

    • J

      Unsolved Enable or Disable High DPI scaling on a specific Widget
      General and Desktop • qt5 highdpi scaling qwidget • • johnyang

      3
      0
      Votes
      3
      Posts
      1172
      Views

      J

      In one of my project, a bit of resolution seems to be lost when scaling (150%). It is plotting a complicated graph for signal processing. We are thinking whether we can just plot the graph according to the scaling factor (e.g. running the math calculation ourslef and generate a graph double the size for high resolution etc) and not to scale this part of the widget by using the high dpi setting.

    • D

      Solved Significant window corruption with HiDPI scaling enabled on X11 + Qt 5.12 / 5.14
      General and Desktop • scaling hidpi • • DamonLynch

      2
      0
      Votes
      2
      Posts
      197
      Views

      D

      The code to fix this problem was really unexpected and quite time consuming. The kicker is that QGuiApplication.devicePixelRatio() always returns 1.0 under Gnome, regardless of what scaling is actually set to. That means Gdk must be called to determine the scaling value.

      import gi gi.require_version('Gdk', '3.0') from gi.repository import Gdk def any_screen_scaled_gdk() -> bool: """ Detect if any of the screens on this system have scaling enabled. Uses GDK to do the querying. :return: True if found, else False """ try: display = Gdk.Display.get_default() except Exception: import logging logging.exception( 'An unexpected error occurred when querying the systems display parameters. Exception:' ) return False if display: try: for n in range(display.get_n_monitors()): monitor = display.get_monitor(n) if monitor.get_scale_factor() > 1: return True return False except AttributeError: # get_n_monitors() was introduced in gtk 3.22 try: screen = display.get_default_screen() for monitor in range(screen.get_n_monitors()): if screen.get_monitor_scale_factor(monitor) > 1: return True except Exception: import logging logging.exception('An unexpected error occurred when querying Gdk. Exception:') return False def any_screen_scaled_qt() -> bool: """ Detect if any of the screens on this system have scaling enabled. Call before QApplication is initialized. Uses temporary QGuiApplication. :return: True if found, else False """ app = QGuiApplication(sys.argv) return app.devicePixelRatio() > 1.0
    • M

      Unsolved How to fix scaling issue in Qt desktop application.
      General and Desktop • scaling resolution alignment • • Maikkannan

      6
      1
      Votes
      6
      Posts
      1679
      Views

      Y

      @Maikkannan said in How to fix scaling issue in Qt desktop application.:

      increased

      Do you run it on a 2K screen?

    • Y

      Solved Printing and positioning
      General and Desktop • printing scaling • • YuriQ

      6
      0
      Votes
      6
      Posts
      504
      Views

      Y

      Finally. This code works fine.

      void onPrint(QPrinter* printer) { QPagedPaintDevice* device = printer; QPainter painter; painter.begin(device); int w = device->width(); int h = device->height(); painter.drawLine(0,0,w,h); painter.drawLine(0,h,w,0); painter.drawEllipse(QPointF(w/2, h/2), w/10, w/10); painter.drawText(0, h, "pixels"); printer->newPage(); painter.end(); }
    • D

      Unsolved Smoothed icons with high dpi support in Qt app
      General and Desktop • high dpi image scaling qt 5.11 • • daljit97

      2
      0
      Votes
      2
      Posts
      2340
      Views

      SGaist

      Hi,

      Did you already saw the related part of QIcon’s documentation ?

    • M

      Unsolved Wide scale 3D model vizualiation
      General and Desktop • 3drender qt5.9 scaling simulation • • madsm

      2
      0
      Votes
      2
      Posts
      610
      Views

      ?

      Hi! Have you seen the Qt 3D: Planets QML Example?

    • Phrogz

      Unsolved Scaling a BorderImage source before repeating
      QML and Qt Quick • borderimage qml scaling • • Phrogz

      4
      0
      Votes
      4
      Posts
      1155
      Views

      J

      In C++ you register your image provider by providing a new resource prefix (say you chose "myimage") then in QML it will look like this:

      source: "myimage://myborderImage"

      Read Qt doc about QQuickImageProvider class, there is an example of how to use it

    • R

      Solved Rendering to physical sizes, how to let it work on all platforms?
      QML and Qt Quick • pysical scaling dpi dpi awareness ppi • • RaDq1

      4
      0
      Votes
      4
      Posts
      1101
      Views

      R

      @johngod Thank you so much, you're right Screen.pixelDensity would be the complete solution if it was in qml,
      sifting trough the qt source i was able that it was derived from:

      double pixelpermm = QGuiApplication::primaryScreen()->physicalDotsPerInch() / 25.4 //physicalDotsPerInchX() & physicalDotsPerInchY() also exist

      and it seems to be correct on both my iPhone & iPad quite wel (better than all other ways I found so far)

      @Lorenz thanks, but for the time being I want to stick to Qt as it is a paid sdk as soon as you go commercial

    • R

      Unsolved Qt Designer on high DPI screens
      General and Desktop • qt designer hidpi high dpi scaling • • regs

      3
      0
      Votes
      3
      Posts
      2282
      Views

      SGaist

      Hi and welcome to devnet,

      I'd recommend posting this question to the Qt Creator mailing list. You'll find there Qt Creator's developers/maintainers. This forum is more user oriented.

    • MrBolton

      Unsolved QGraphicsView resizing
      General and Desktop • qgraphicsview qgraphicsscene scaling • • MrBolton

      6
      0
      Votes
      6
      Posts
      1917
      Views

      V

      ok will do

    • the_

      Unsolved HighDPI Displays Font Scaling / CSS
      General and Desktop • css scaling high dpi • • the_

      1
      0
      Votes
      1
      Posts
      553
      Views

      No one has replied

    • AllanE

      Unsolved Scalability on different screens resolution, wrong DPI
      QML and Qt Quick • scaling resolution devices screen • • AllanE

      3
      0
      Votes
      3
      Posts
      1762
      Views

      vikramg

      I have been looking into this myself, with no conclusive information on how to reliably accomplish this. It feels like Qt 5.6 ought to automagically do the scaling for you; I intend to post a new question in this forum asking about this. In the meanwhile, the first part of this video will be of interest to you:

      https://youtu.be/nNyhsdX6BsI?t=6m24s

      There is code at 06:24 that extracts the dpi value from the Android framework. Maybe that will work better, I have not tried it myself.

    • M

      Unsolved Qt Labs Controls & icon resources
      QML and Qt Quick • labs.controls controls 2 resources icons scaling • • morte

      2
      0
      Votes
      2
      Posts
      1188
      Views

      ekkescorner

      icons depend on DevicePixelRatio and are named this way:

      myIcon.png - corresponds to 1.0 and mdpi - use this name in qml
      myIcon@2x.png - 2.0 and xhdpi
      myIcon@3x.png - 3.0 and xxhdpi
      myIcon@4x.png - 4.0 and xxxhdpi

      if you want to know the DevicePixelRatio:

      C++
      qApp->primaryScreen()......

    • S

      Unsolved QWidget in QGraphicsView not scaled correctly in OSX
      General and Desktop • qgraphicsview scaling osx • • szergejbubka

      12
      0
      Votes
      12
      Posts
      2970
      Views

      SGaist

      Thanks !

    • G

      Solved Scaling QPixmap to fit Label
      General and Desktop • scaling qpixmap • • gabor53

      4
      0
      Votes
      4
      Posts
      31070
      Views

      G

      Thank you. Both worked though I guess it is supposed to be

      int w = ui->label->width (); int h = ui->label->height (); ui->label->setPixmap (pix.scaled (w,h,Qt::KeepAspectRatio));
    • D

      Scaling and layouts problem
      Mobile and Embedded • scaling android • • deleted368

      2
      0
      Votes
      2
      Posts
      835
      Views

      P

      @DerBaer

      The QML version did/does not scale Android UIs correctly. The Qt C++ UI may be the same.

      With the version I am using, I was forced to create a ratio based on the Android device screen resolution relative to the desktop resolution for all on screen objects..text, fonts, images, etc.

      Probably may not be what you want to hear, but you may have to handle the scaling yourself...unless this behavior has been fixed.