Path: csiph.com!eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'cc:addr:python-list': 0.09; 'minus': 0.09; 'received:openend.se': 0.09; 'received:theraft.openend.se': 0.09; 'advance': 0.10; 'subject:not': 0.11; 'size,': 0.13; 'thu,': 0.15; 'cause.': 0.16; 'from:addr:lac': 0.16; 'from:addr:openend.se': 0.16; 'from:name:laura creighton': 0.16; 'layout,': 0.16; 'message- id:@fido.openend.se': 0.16; 'received:fido': 0.16; 'received:fido.openend.se': 0.16; 'resize': 0.16; 'resizing': 0.16; 'screen,': 0.16; 'skip:q 50': 0.16; 'subject:screen': 0.16; 'width,': 0.16; 'app': 0.16; 'debugging': 0.18; 'laura': 0.18; 'widget': 0.18; 'all,': 0.20; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'cc:no real name:2**0': 0.22; 'fine': 0.28; 'interface': 0.29; '-0700,': 0.29; 'received:se': 0.29; 'thinks': 0.29; 'task': 0.30; 'screen': 0.32; 'maybe': 0.33; 'useful': 0.33; 'quite': 0.35; 'something': 0.35; 'but': 0.36; 'should': 0.36; 'there': 0.36; 'smaller': 0.36; 'subject:: ': 0.37; 'charset:us-ascii': 0.37; 'things': 0.38; 'stuff': 0.38; 'does': 0.39; 'space': 0.40; 'some': 0.40; 'your': 0.60; 'header :Message-Id:1': 0.61; 'more': 0.63; 'information': 0.63; 'laptop': 0.67; 'useful.': 0.72; 'hand': 0.82; '>how': 0.84; 'header:In- reply-to:1': 0.84 To: Hedieh Ebrahimi cc: python-list@python.org From: Laura Creighton Subject: Re: PySide window does not resize to fit screen In-reply-to: <24851466-7de1-408f-a0a0-548d42d21ab4@googlegroups.com> References: <24851466-7de1-408f-a0a0-548d42d21ab4@googlegroups.com> Comments: In-reply-to Hedieh Ebrahimi message dated "Thu, 01 Oct 2015 06:44:25 -0700." MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16989.1443716352.1@fido> Content-Transfer-Encoding: quoted-printable Date: Thu, 01 Oct 2015 18:19:12 +0200 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (theraft.openend.se [82.96.5.2]); Thu, 01 Oct 2015 18:19:14 +0200 (CEST) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1443716363 news.xs4all.nl 23728 [2001:888:2000:d::a6]:40222 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:97287 In a message of Thu, 01 Oct 2015 06:44:25 -0700, Hedieh Ebrahimi writes: >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. screenGeometry =3D QApplication.instance().desktop().screenGeometry() to find out your desktop size in pixels. availGeometry =3D QApplication.instance().desktop().availableGeometry() is the same thing minus the space for the task bar, so maybe more useful. width, height =3D availGeometry.width(), availGeometry.height() Finding out what pyside thinks the size is can be useful for debugging problems, but this stuff should already be happening automatically. There= is something not quite right with your layout, and brutally resizing things by hand is treating the symptom, not the cause. Laura