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. Qt: “ResizeEvent” to receive the size of the window and set it to the size of a QLabel
Forum Updated to NodeBB v4.3 + New Features

Qt: “ResizeEvent” to receive the size of the window and set it to the size of a QLabel

Scheduled Pinned Locked Moved Unsolved General and Desktop
c++ qtc++qt5.6qtcreatorqt5.4
4 Posts 3 Posters 1.8k Views 2 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.
  • H Offline
    H Offline
    hassene
    wrote on last edited by
    #1

    Qt/c++: I want to use ResizeEvent to receive the size of the window and set it to the size of a QLabel, in order to make the image stretched and adapted to the window's dimensions.by a left click of the mouse I can resize my window and the image takes a new size. the problem is that I'm new with Qt and I did not found examples of resizeEvent in the net.

    K 1 Reply Last reply
    0
    • H hassene

      Qt/c++: I want to use ResizeEvent to receive the size of the window and set it to the size of a QLabel, in order to make the image stretched and adapted to the window's dimensions.by a left click of the mouse I can resize my window and the image takes a new size. the problem is that I'm new with Qt and I did not found examples of resizeEvent in the net.

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @hassene

      Hi andwelcome to devnet forum

      Somehow you have duplicated your post, please avoid duplication of posts.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • H Offline
        H Offline
        hassene
        wrote on last edited by
        #3

        Sorry it was unintentional

        mrjjM 1 Reply Last reply
        0
        • H hassene

          Sorry it was unintentional

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @hassene
          Hi and welcome
          Is there a reason you simply dont use a layout ?
          To make it autofollow the size of window ?
          if you place a QLabel on a form ( mainwindow.ui) , right click somewhere on
          empty form, and select Layout menu and select layout, the label will follow maniform.
          https://doc.qt.io/qt-5.10/examples-layouts.html

          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