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. Slow resizing dialog box
Forum Updated to NodeBB v4.3 + New Features

Slow resizing dialog box

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

    Greetings.

    I have a dialog box that displays an image and several other widgtes (Buttons, GroupBox, ListWidget, ect). The dialog can be resized manually by the user.

    Well, when the dialog shows large images (3000x4000) there is a clear lag (ie resizing the dialog is slow) when trying to resize the dialog. When tasting with smaller images (for example, 500x600) no such problem.

    I guess the lag is due to the size of the images, the problem is that the images with which the application works are precisely of 3000x4000 (or similar size). How I can avoid this lag?

    Thanks in advance for any help and / or suggestions.

    Isaac Pérez
    Programming is understanding.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      thEClaw
      wrote on last edited by
      #2

      A couple of possibilities:
      1. Don't resize the image until resizing of the dialog is finished. I have seen that behavior with other software.
      Maybe there is a setting for this, I would probably try to hack something together using "QObject::blockSignals":http://qt-project.org/doc/qt-5.1/qtcore/qobject.html#blockSignals or by reimplementing the resize/update function of the widget.

      2. The images size may be huge, but does the representation inside your dialog have to be? "QImage::scaled":http://qt-project.org/doc/qt-5.1/qtgui/qimage.html#scaled-2 respectively "QPixmap::scaled":http://qt-project.org/doc/qt-5.1/qtgui/qpixmap.html#scaled-2 would offer you the ability to limit the view onto the image to something more reasonable. A desktops resolution might be a good point of reference, since more won't be of any advantage anyway.

      3. Correlated to the other two: While resizing the window show a placeholder image with a much lower resolution (750*1000 could speed things up by about a factor of ten). This should keep the interface snappy and you still have a good idea of what happens to the image. Of course, after resizing is finished, you need to go back to the original image. Unless you decide to take route two, where that lower resolution might be all you need.

      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