PySimpleGUI / PySimpleGUI/PySimpleGUI

[Bug/Question] My problem is Qt 'port' doesn't center windows by default.

Open
#2,646 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
13.8k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Type of Issues (Enhancement, Error, Bug, Question)
  • Unsure, definitely a question
Operating System
  • Kubuntu 19.10 (eoan)
Python version
  • Python 3.7
PySimpleGUI Port and Version
  • PySimpleGUIQt - 0.31.0
  • PySimpleGUI - 4.15.2
Your Experience Levels In Months or Years

Your Experience Levels In Months or Years

  • 4 mos Python programming experience
  • 10 yrs Programming experience overall
  • no Have used another Python GUI Framework (tkiner, Qt, etc) previously (yes/no is fine)?
You have completed these steps:
  • Read instructions on how to file an Issue
  • Searched through main docs http://www.PySimpleGUI.org for your problem
  • Searched through the readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
  • Looked for Demo Programs that are similar to your goal http://www.PySimpleGUI.com
  • Note that there are also Demo Programs under each port on GitHub
  • Run your program outside of your debugger (from a command line)
  • Searched through Issues (open and closed) to see if already reported
Code or partial code causing the problem
My Problem

Per the documentation (unless I missed something regarding the Qt 'port' of PySimpleGUI) I expected to have a centered window if I provide no 'location' argument. This works as expected in PySimpleGUI (tested using the second snippet below) but not when using PySimpleGUIQt (as evidenced by running the first snippet below).

I understand that PySimpleGUIQt is still less mature and polished than PySimpleGUI, I just wanted to not only ensure that you're aware of this behavior but also to ask if you have any advice on how to work around this?

Example Snippets

If I run the following, I get a window that shows up any ol' place it chooses:


import PySimpleGUIQt as qt

layout = [
    [qt.Text('This is a text field'), qt.InputText('')],
    [qt.Button('OK')]
    ]

window = qt.Window('Test Window', layout=layout)

while True:
    event, values = window.read(timeout=100)

However, if running the following, it performs as expected (centering the window on one's screen):


import PySimpleGUI as gui

layout = [
    [gui.Text('This is a text field'), gui.InputText('')],
    [gui.Button('OK')]
    ]

window = gui.Window('Test Window', layout=layout)

while True:
    event, values = window.read(timeout=100)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior using the PySimpleGUIQt Window call and the first Python snippet, then compare it with the PySimpleGUI example that centers the window. No source file or test is named; done would require determining whether the Qt port should center windows by default and documenting or verifying the resulting behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.