Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Issue loading UI with a fresh template
Qt 6.11 is out! See what's new in the release blog

Issue loading UI with a fresh template

Scheduled Pinned Locked Moved Unsolved Qt for Python
1 Posts 1 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mastrobottega_enf
    wrote on last edited by mastrobottega_enf
    #1

    Greetings!
    I'm a beginner both in Python and Qt, but I have some programming experience

    So here's the issue and how to replicate it:

    1. Start a project using this template: "Qt for Python - Window (UI file)"
    2. Select "QMainWindow" as base class
    3. Add any object into the UI through qt designer
    4. Save and run the program

    and all I see is an empty window, and the terminal does not show any error related to the UI
    Please notice that I didn't touch any of the automatically generated code

    Here's what the terminal says:
    17:23:03: Starting /usr/bin/python -u /home/enf/Projects/HealthCalcs/main.py...
    (now i close the window)
    17:23:11: /usr/bin/python exited with code 0

    This problem does not occur if I use "QWidget" as a base class

    I also happen to have this problem
    "Qt WebEngine seems to be initialized from a plugin. Please set Qt::AA_ShareOpenGLContexts using CoreApplication::setAttribute before constructing QGuiApplication."

    which I solved by pasting this line of code in my main function
    QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_ShareOpenGLContexts)

    Am I doing something wrong?

    Here's some extra information that might be useful:

    • OS Linux Manjaro KDE x64
    • qt-creator 4.12.4-1
    • Python 3.8.3
    1 Reply Last reply
    6

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved