#๐Ÿ”’ PySide6 QMainWindow doesn't show up?

44 messages ยท Page 1 of 1 (latest)

fickle craneBOT
#

@viscid otter

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

atomic garden
#

@viscid otter I've recovered your message

#

Hi, lets start off by letting you know that I'm very new to Python.

I'm currently trying to make my little application to use QT with PySide6 instead of Tkinter, but I'm a bit confused about why the application window isn't showing up as it should but hovering over the app icon on the taskbar shows the UI (see screenshot).

I've googled a bit and there seems to be people with the same issue that got their stuff solved, but I'm not sure I quite understand the solutions popping up (maybe because I'm still not very experienced?)
So I figured I may as well see if there is any people on Discord that may be able to either explain or help!

I've done the basic design of the UI how I want it with QTDesigner.

I set up my py files like this for now
"main.py",
"window.py",
"window_ui.py",
"window.ui"

I've attached the files as well in case it would be helpful. (Ignore all the unnecessary imports, they'll be removed later)

But the basics of it is that launching the main.py script doesnt make the app window pop up as stated earlier.
Any help is appreciated, if more information is needed then tell me what you need and i'll try provide.

#

you can't share files here unfortunately

viscid otter
#

Yeah I noticed, thank you. Ill make the paste links the bot said!

atomic garden
#

As a pyqt dev, I always recommend staying far away from designer

atomic garden
#

doing the ui to py conversion process just makes such an absolute mess of code

#

I know it's not really helpful advice in the moment, but I'd really recommend trying to code it from scratch

#

also on a related note, the very first thing I built in qt (it was with designer, haha) was a spritesheet creator

#

basically the opposite of what you have here

#

just thought that was funny

viscid otter
#

I can see why haha, no worries!
I'll keep waiting for some answers, if I don't get any within a day I'll just resort to spend a day learning how to do it from the ground up.

viscid otter
atomic garden
#
def main():

    app = QApplication()
    window = AppWindow()
    window.show()
    app.exec()
#

I haven't used PySide6 yet, but previous versions require an argument in QApplication

#

try putting an empty list there

#
app = QApplication([])
atomic garden
atomic garden
#

PySide doesn't

viscid otter
#

Not exactly, I've worked on some fnf mods here and there for learning purposes, I like learning a bit about most things.

and yeah the list isnt required

atomic garden
#
MainWindow.setWindowOpacity(0.000000000000000)
#

this line caught my eye too

#

try commenting that out

viscid otter
#

oh wtf thats...

atomic garden
#

seems like you might be making an invisible window...

viscid otter
#

ARE YOU KIDDING ME

#

THAT WAS IT

#

how did i miss that HAHA

#

Thanks mate!

atomic garden
#

lol glad that was it!

#

Dug up my old sprite tool though for a laugh. Yours looks a lot better

viscid otter
#

haha thats kinda what my tkinter variant looks like

atomic garden
#

This was 5+ years ago though. I've come a long way since then ๐Ÿ˜‰

viscid otter
#

I bet! Haha!
Thanks again, despite me being slightly embarrassed now, but hey sometimes you miss simple stuff due to sheer frustration!

atomic garden
#

Np! Glad it's all working now

fickle craneBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.

#

๐Ÿ”’ PySide6 QMainWindow doesn't show up?