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. Get current window size
QtWS25 Last Chance

Get current window size

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 34.2k 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.
  • A Offline
    A Offline
    Andell
    wrote on 27 Sept 2012, 19:50 last edited by
    #1

    Hi all,

    I need to get current size of window. User can resize this application as he wants, so I have to resize some pictures in it. Do you have any idea how to do it?

    Thanks for answering

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mlong
      wrote on 27 Sept 2012, 22:08 last edited by
      #2

      You can use QWidget's "size() property":http://qt-project.org/doc/qt-4.8/qwidget.html#size-prop on the root widget of the window. You can also use resizeEvent handling or layouts managers, or any other number of other methods, but it really depends on the logic of what kind of work you have to do. I'd suggest doing some searching for tips on how to resize content in a window. There are a lot of examples available.

      Software Engineer
      My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

      1 Reply Last reply
      0

      1/2

      27 Sept 2012, 19:50

      • Login

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