18584

How to enable resizing of a window in Qt

Question:

I'm new to Qt and I'm trying to figure out a way to auto-resize in Qt. The goal is for the user to be able to drag the window to make it bigger and everything resizes to the size of the window. Does anyone have any tips?

Answer1:

First of all <em>(note it for your further Qt-develepers life)</em>, read official documentation. You can read it through QtCreator <a href="http://qt-project.org/doc/qtcreator-2.8/creator-help.html" rel="nofollow">using the Help Mode</a>, or through <a href="http://qt-project.org/doc/" rel="nofollow">official documentation site</a>.

As <em>ratchet freak</em> mentioned, you need to read <a href="http://qt-project.org/doc/qt-5/layout.html" rel="nofollow">official tutorial on layouts</a>. Also, I recommend you read about Layout management in one of best books on Qt: "C++ GUI Programming with Qt 4" by Jasmin Blanchette and Mark Summerfield (Part II: Intermediate Qt, 6. Layout Management).

Also, do not hesitate to watch video tutorials, just take a look at <a href="https://www.youtube.com/results?search_query=qt+layout+tutorial" rel="nofollow">this list</a>. I recommend to watch <a href="https://www.youtube.com/playlist?list=PL2D1942A4688E9D63" rel="nofollow">VoidRealms' channel</a>.

Good luck in learning Qt!

Recommend

  • Qt creator compile error “cannot find uic.exe from msvc 2012 path”
  • Qt Error : Procedure Entry Not Found
  • How to disable adding 'd' suffix to debug library name in qmake on windows?
  • How to use QTcreator with the Visual Studios november CTP compiler?
  • Multiple folders in Java EE 6 web pages
  • tips for installing postgres for a rails project on a linux box
  • How can I make a circular menu icon? Please see details
  • Creating A C# & XNA 'Monster Dash' Like Game
  • Creating a checkmark inside a Pickerview [duplicate]
  • Programmatically change first page jQuery Mobile shows
  • Java Switch Statement Number Varies
  • Upload a Java and node.js project to Google AppEngine at once
  • reading the .fcs files
  • How to bring mp3 file information on jplayer
  • Why dsofile.dll still need Office Installation?
  • HTMLcollection 0 list length, [n] returns undefined, converting to an array returns an empty array
  • android with msaccess
  • Theme in user control
  • EJB @Schedule issue
  • Error:Execution failed for task ':app:dexDebug'. when importing ParseLoginUI as a module
  • How can I include multiple models in one view for in a Joomla 3.x component built with Component Cre
  • What is the best Linux distro to work with Ruby on Rails? [closed]
  • What is the official release update URL for Aptana Studio 3.0?
  • In a MEAN stack, how can I do one-time MongoDB indexing?
  • Python PIL remove sections of an image based on its colour
  • Consuming a web service with the Netbeans Platform
  • What does certain JVM do after loading ByteCode into memory?
  • How can i dump blob fields from mysql tables
  • runtime-check whether an instance (Base*) override a parent function (Base::f())
  • iOS: Detect app start via notification press
  • Initializer list vs. initialization method
  • Xamarin Forms - UWP Fonts
  • Finding past revisions of files in StarTeam w/ .NET SDK / C#
  • Java applet as stand-alone Windows application?
  • Jquery - Jquery Wysiwyg return html as a string
  • InvalidAuthenticityToken between subdomains when logging in with Rails app
  • SQL merge duplicate rows and join values that are different
  • LevelDB C iterator
  • Can't mass-assign protected attributes when import data from csv file
  • Reading document lines to the user (python)