Re: PySide window does not resize to fit screen

2017-11-14 Thread Heli
Hi Chris and others, 

I have re-designed my user interface to include layouts and now it fits the 
screen perfectly.

Thanks a lot for all your help on this thread, 
Best 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PySide window does not resize to fit screen

2015-10-05 Thread Hedieh Ebrahimi
Hi Chris, 

Thanks for your answer. I get your point now. 
Unfortunately there are not layouts in my user interface. 
Smaller widget have been grouped using group boxes and then all these group 
boxes are put on the central widget.

I would like to recreate my user interface using one of the designer software 
that exist.

Could you recommend any free designer software that I can create my user 
interface with?

Thank you 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PySide window does not resize to fit screen

2015-10-05 Thread Hedieh Ebrahimi
is this free to use for commercial use?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PySide window does not resize to fit screen

2015-10-05 Thread Laura Creighton
In a message of Mon, 05 Oct 2015 01:18:33 -0700, Hedieh Ebrahimi writes:
>Could you recommend any free designer software that I can create my user 
>interface with?
>
>Thank you 

Qt Designer works with PySide.
http://doc.qt.io/qt-5/designer-quick-start.html

Laura
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PySide window does not resize to fit screen

2015-10-05 Thread Chris Warrick
On 5 October 2015 at 13:20, Hedieh Ebrahimi  wrote:
> is this free to use for commercial use?
> --
> https://mail.python.org/mailman/listinfo/python-list

Yeah, you can use Qt Designer to create a nice layout and the
pyside-uic tool to generate code (that you will need to clean up
later).

-- 
Chris Warrick 
PGP: 5EAAEA16
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PySide window does not resize to fit screen

2015-10-05 Thread Michael Torrie
On 10/05/2015 05:20 AM, Hedieh Ebrahimi wrote:
> is this free to use for commercial use?

Yes of course.  There's also the newer Qt Creator program if you want to
use Qt 5.  The license of the Designer and Creator programs does not
apply to the output of these programs (the .ui XML files).

You'll want to read up on the documentation.  Here's a couple of links
for starters:

http://doc.qt.io/qt-4.8/designer-layouts.html
https://wiki.qt.io/QtCreator_and_PySide (works with .ui files from
Designer also)

Even if you don't use a GUI designer, you should construct your GUI with
layout managers so that your interfaces can adjust and look good on a
variety of screen sizes and DPI.  It's pretty simple once you wrap your
brain around the idea.

Another method of working with .ui files it to load them at runtime:
https://srinikom.github.io/pyside-docs/PySide/QtUiTools/QUiLoader.html


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PySide window does not resize to fit screen

2015-10-02 Thread Chris Warrick
On 2 October 2015 at 15:10, Hedieh Ebrahimi  wrote:
> Thanks Laura,
>
> In my user interface I have many group boxes that are located inside the main 
> widget. All the group boxes and their child widgets have fixed sizes.
>
> How can I use the width and height I get from availableGeometry or 
> ScreenGeometry to multiply
>
> screenGeometry = QApplication.instance().desktop().screenGeometry()
> availGeometry = QApplication.instance().desktop().availableGeometry()
> width, height = availGeometry.width(), availGeometry.height()
>
> to resize my geometry by a ratio? Is this a good approach?
> --
> https://mail.python.org/mailman/listinfo/python-list

This is NOT a good approach.  A good approach involves using a layout.
See my previous e-mail for details.

Geometry is not going to help you here, especially since you would
need a ton of code to resize everything on **any** window size change
event.  And you especially do not need the screen size, because it
would still hinder changing window sizes.

-- 
Chris Warrick 
PGP: 5EAAEA16
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PySide window does not resize to fit screen

2015-10-02 Thread Hedieh Ebrahimi
Thanks Laura, 

In my user interface I have many group boxes that are located inside the main 
widget. All the group boxes and their child widgets have fixed sizes. 

How can I use the width and height I get from availableGeometry or 
ScreenGeometry to multiply 

screenGeometry = QApplication.instance().desktop().screenGeometry() 
availGeometry = QApplication.instance().desktop().availableGeometry() 
width, height = availGeometry.width(), availGeometry.height() 

to resize my geometry by a ratio? Is this a good approach?
-- 
https://mail.python.org/mailman/listinfo/python-list


PySide window does not resize to fit screen

2015-10-01 Thread Hedieh Ebrahimi
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


Re: PySide window does not resize to fit screen

2015-10-01 Thread Chris Warrick
On 1 October 2015 at 15:44, Hedieh Ebrahimi  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 
PGP: 5EAAEA16
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PySide window does not resize to fit screen

2015-10-01 Thread Laura Creighton
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 = QApplication.instance().desktop().screenGeometry()
to find out your desktop size in pixels.
availGeometry = QApplication.instance().desktop().availableGeometry()
is the same thing minus the space for the task bar, so maybe more
useful.

width, height = 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

-- 
https://mail.python.org/mailman/listinfo/python-list