Python Forum
[PyQt] How to clip layout to sides and bottom of main window?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] How to clip layout to sides and bottom of main window?
#3
(Mar-24-2021, 02:28 AM)deanhystad Wrote: Qt layouts grow to fill the window. What are you trying to do? You can achieve different affects by using layouts in layouts, layouts in widgets in layouts, different kinds of layouts, setting things like alignment for where widgets appear in layout, and setting stretch factors in a layout. If you can describe what you are trying to achieve I may be able to help you.

This is in Qt Designer. But I don't mind if it's in code; I'm not too fond of the Designer anyway. I'm beginner (I'm used to C# code, I don't mean that, but Qt GUI development). So please explain the relevant properties, methods, instead of "only" providing a solution :)
[Image: Og0o2BA.png]

Final goal:
[Image: PSrdLEj.png]

Here's another example with a line edit. The right edge of the line edit needs to touch the edge of its parent on the right.
This is in a horizontal layout. So if the layout auto-sizes with the form, then the line edit must autosize with the layout.
[Image: xz6oz4G.png]
Reply


Messages In This Thread
RE: How to clip layout to sides and bottom of main window? - by Valmont - Mar-24-2021, 01:23 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Interaction between Matplotlib window, Python prompt and TKinter window NorbertMoussy 3 2,515 Mar-17-2024, 09:37 AM
Last Post: deanhystad
Exclamation [Tkinter] Error when closing the main window with destroy TomasSanchexx 1 1,729 Aug-06-2023, 01:54 AM
Last Post: deanhystad
  [PyGUI] How to reuse a window layout based on mysql rowcount? retroisbest 2 3,461 Nov-09-2021, 09:02 AM
Last Post: retroisbest
  [PyQt] Can't get MDIarea to resize automatically with Main Window JayCee 4 5,017 Aug-02-2021, 08:47 PM
Last Post: JayCee
  "tkinter.TclError: NULL main window" Rama02 1 7,299 Feb-04-2021, 06:45 PM
Last Post: deanhystad
  pyqt5 layout Nickd12 8 6,164 Jan-18-2021, 09:09 AM
Last Post: Axel_Erfurt
  [Tkinter] Hi, Keep postition of main window after iconify() delphinis 3 4,203 Jul-12-2020, 06:59 AM
Last Post: DT2000
  [Tkinter] Auto re-fit frames sizes in main window Gilush 2 3,510 Jun-06-2020, 03:14 AM
Last Post: Gilush
  [Tkinter] How to add multiple frames to main window Dandy_Don 13 12,261 Apr-29-2020, 09:21 PM
Last Post: Dandy_Don
  tkinter window and turtle window error 1885 3 8,230 Nov-02-2019, 12:18 PM
Last Post: 1885

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020