Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #97285

Re: PySide window does not resize to fit screen

References <24851466-7de1-408f-a0a0-548d42d21ab4@googlegroups.com>
Date 2015-10-01 17:07 +0200
Subject Re: PySide window does not resize to fit screen
From Chris Warrick <kwpolska@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.297.1443712037.28679.python-list@python.org> (permalink)

Show all headers | View raw


On 1 October 2015 at 15:44, Hedieh Ebrahimi <hemla21@gmail.com> wrote:
> Dear all,
>
> I am using Pyside to create a user interface for my app.
> The app works fine on my computer with big screen, but when I take it to my laptop with smaller screen size, it does not resize to match the screen size.
>
> How can I make my main widget get some information about the screen size and resize automatically?
>
> Thanks in Advance for your answers.
> --
> https://mail.python.org/mailman/listinfo/python-list

The correct way to do this is to lay your application out using a
layout.  The available layouts are:

* QHBoxLayout
* QVBoxLayout
* QGridLayout
* QFormLayout

The exact layout to use depends on your needs.

What are you using to create your Qt code? Are you using Qt Designer
or are you writing the code by hand?  If you are using Qt Designer,
use the “Lay Out…” buttons in the Form menu or on the tool bar.  If
you are writing Qt code by hand, it looks roughly like this (for a
VBox; Grid and Form are more complicated as they involve positioning):

lay = QtGui.QVBoxLayout(self)  # your central widget, dialog, main
window — whichever one exists
btn = QtGui.QButton("Hello", lay)
lay.addWidget(btn)

Please check with Qt documentation for more details

-- 
Chris Warrick <https://chriswarrick.com/>
PGP: 5EAAEA16

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

PySide window does not resize to fit screen Hedieh Ebrahimi <hemla21@gmail.com> - 2015-10-01 06:44 -0700
  Re: PySide window does not resize to fit screen Chris Warrick <kwpolska@gmail.com> - 2015-10-01 17:07 +0200
  Re: PySide window does not resize to fit screen Laura Creighton <lac@openend.se> - 2015-10-01 18:19 +0200
    Re: PySide window does not resize to fit screen Hedieh Ebrahimi <hemla21@gmail.com> - 2015-10-02 06:10 -0700
      Re: PySide window does not resize to fit screen Chris Warrick <kwpolska@gmail.com> - 2015-10-02 15:25 +0200
        Re: PySide window does not resize to fit screen Hedieh Ebrahimi <hemla21@gmail.com> - 2015-10-05 01:18 -0700
          Re: PySide window does not resize to fit screen Laura Creighton <lac@openend.se> - 2015-10-05 12:51 +0200
            Re: PySide window does not resize to fit screen Hedieh Ebrahimi <hemla21@gmail.com> - 2015-10-05 04:20 -0700
              Re: PySide window does not resize to fit screen Chris Warrick <kwpolska@gmail.com> - 2015-10-05 15:32 +0200
              Re: PySide window does not resize to fit screen Michael Torrie <torriem@gmail.com> - 2015-10-05 10:28 -0600
            Re: PySide window does not resize to fit screen wxjmfauth@gmail.com - 2015-10-05 11:28 -0700

csiph-web