Skip to content

Qt for Python

For discussion and questions about Qt for Python (PySide & Shiboken)

3.2k Topics 13.9k Posts
  • ModernGL with QOpenGLWidget isn't rendering

    Solved
    6
    0 Votes
    6 Posts
    99 Views
    jsulmJ

    @ktechhydle If you enter "qt6 QWindow OpenGL" in Google first result is: https://doc.qt.io/qt-6/qtopengl-openglwindow-example.html

  • BLE Peripheral Requirements for Mac & Windows

    Unsolved
    1
    0 Votes
    1 Posts
    19 Views
    No one has replied
  • Fast loading of complex interfaces

    Solved
    6
    0 Votes
    6 Posts
    105 Views
    Q

    @JonB said in Fast loading of complex interfaces:

    Just one thing: let's say you leave it as-is because you don't want to divide it for whatever reason. Are you at least aware that Qt has a QSplashScreen?

    Didn't know that. I'll use it. tnx

    @jsulm said in Fast loading of complex interfaces:

    you can still design ui widgets for different parts of the user interface using designer.

    I think I'll do what you wrote. Thank you.

  • does pyside deploy encrypt source code?

    Unsolved
    2
    0 Votes
    2 Posts
    43 Views
    SGaistS

    Hi,

    For encryption, AFAIK, no.
    For your file loading issue, use Qt resource system.

  • How to add data files in nuitka

    Unsolved
    5
    0 Votes
    5 Posts
    108 Views
    M

    @Shyamnath How do I add project data files (images and QML files) to the pysidedeploy.spec file so that the generated executable file can be run anywhere?Because my data files are not being added.

  • 0 Votes
    2 Posts
    55 Views
    JonBJ

    @markleo

    Number of types in QtDataVisualization: 35

    Number of missing types: 0

    I read this as telling that there are no missing/types bindings for QtDataVisualization, it should work as-is.

  • PySide6 support for PyPy3.10

    Unsolved
    1
    0 Votes
    1 Posts
    36 Views
    No one has replied
  • QT for Python and TDD (Test Driven Development)

    Solved
    8
    0 Votes
    8 Posts
    130 Views
    SGaistS

    @JonB in that case the OP would be testing Qt rather than his own code.

    Nothing wrong with writing tests that allows to understand and confirm how a given framework works as advertised but it should not be the base for the tests of your actual code as it is a different goal.

  • 0 Votes
    2 Posts
    50 Views
    R

    I also submited an issue on Qt issue tracker https://bugreports.qt.io/browse/PYSIDE-2955

  • where is QJsonObject

    Solved
    8
    0 Votes
    8 Posts
    541 Views
    JonBJ

    Like I said, Qt's support for JSON or XML is not as comprehensive as Python's, and you can afford to use the latter in a Qt Python program if you want better support.

  • My app doesn't appear on screen

    Moved Unsolved
    2
    0 Votes
    2 Posts
    61 Views
    jsulmJ

    @Alberto123 said in My app doesn't appear on screen:

    What could I do?

    Provide information needed to find the issue.
    Especially the code...

  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    18 Views
    No one has replied
  • 0 Votes
    7 Posts
    123 Views
    D

    @JonB
    Okay. Now it is clear.
    I thought the QtSql data model will manage it for me.
    Thank you very much!

  • 0 Votes
    2 Posts
    73 Views
    SGaistS

    Hi,

    Qt has the QColorDialog.

    Would that work for you ?

    Otherwise, you can build your widget with Qt OpenGL related classes and use shaders if you want.

  • PySide6: Cannot call python method from QML

    Unsolved
    2
    0 Votes
    2 Posts
    47 Views
    No one has replied
  • Can't read from the standard input

    Solved
    8
    0 Votes
    8 Posts
    151 Views
    A

    @JonB
    Thanks for help. I experimented with sys.stdin.read(5) and it works. The data doesn't have to be binary, I can convert it, so using QTextStream, adding a trailing newline character and receiving with sys.stdin.readline() works as well.

  • Click-through window will blink due setWindowFlags

    Unsolved
    3
    0 Votes
    3 Posts
    265 Views
    L

    I run into the same issue. Except I am using Pyside2. Is there any way to fix this issue? Calling update hides the window. So after setWindowFlags function, I have to call show function but like OP it flickers. Not sure why this sort of design is implemented. Can this be remedied in a future version or is there a workaround? My code is like this:

    def setPassThroughMode(window, enable): if enable: # Set the window to be transparent for input window.setWindowFlags(QtCore.Qt.Tool | QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowTransparentForInput) else: # Restore the normal floating window behavior window.setWindowFlags(QtCore.Qt.Tool | QtCore.Qt.FramelessWindowHint) window.setAttribute(QtCore.Qt.WA_TransparentForMouseEvents, enable) window.setAttribute(QtCore.Qt.WA_NoMousePropagation, enable) # Ensure changes take effect window.show() # Reapply visibility to update flags def togglePassThroughMode(window): # Check if the window is valid if not shiboken2.isValid(window): return # Check if the window is in pass-through mode isPassThrough = isPassThroughEnabled(window) # Toggle the state using setPassThroughMode setPassThroughMode(window, not isPassThrough) # To turn it off, you have to call the function twice if isPassThrough: setPassThroughMode(window, not isPassThrough)

    I have to call it twice to turn these flags off also, not sure why that is.

  • QtAsyncIO conflict with QDialog.exec()

    Unsolved
    2
    0 Votes
    2 Posts
    80 Views
    SGaistS

    Hi and welcome to devnet,

    I haven't used that module yet however I think that manually triggering a secondary event loop like that is wrong.

    I just found this example which confirms my intuition.

  • Pyqt Signals connecting multiple slots

    Unsolved
    6
    0 Votes
    6 Posts
    115 Views
    JonBJ

    @Dwarrel said in Pyqt Signals connecting multiple slots:

    My assumption was indeed that the emit would be independent of the execution time of a listener (connected function). Knowing that that is not the case completely explains the observed behaviour.

    OIC!

    The behaviour depends on the parameters to connect() and whether the signalling object and the slot object are in the same or different threads.

    Assuming default --- no extra parameter to connect() ---

    If they are in the same thread signal/slot is executed directly, upon emit signal call, i.e. it behaves just like a direct call to the slot(s). Slots are executed consecutively per the order they were connect()ed. Signaller code does not continue until all slots have completed. If they are in different threads signal causes slot(s) to be executed queued. When slot object thread next enters Qt event loop slot(s) get executed. Order is actually undetermined. Signaller code continues immediately after emit, it does not wait. Extra parameter to connect() can be used to alter default behaviour, see docs. You still should not try DirectConnection across threads, you could choose QueuedConnection if same thread. But non-default is unusual, unless you know what you are doing.

    P.S.
    I just noticed you are Python. the above is still correct, but there can be extra restrictions with multiple threads to do with Python GIL. But nothing special if all same thread.

  • This topic is deleted!

    Unsolved
    3
    0 Votes
    3 Posts
    30 Views