Skip to content

Qt for Python

For discussion and questions about Qt for Python (PySide 2)

3.1k Topics 13.6k Posts
  • Hi, how to use Qt Designer on macOS?

    Solved
    4
    0 Votes
    4 Posts
    84 Views
    jsulmJ

    @markleo said in Hi, how to use Qt Designer on macOS?:

    I don't find a button called "Design"

    Please look again: it is right there on the left side. It is greyed out because you do not have an ui file yet.

  • 0 Votes
    7 Posts
    167 Views
    SGaistS

    You're likely on Windows 11 and the new windows11 style has some issues.

  • 0 Votes
    1 Posts
    40 Views
    No one has replied
  • 0 Votes
    11 Posts
    157 Views
    JonBJ

    @JimLomax said in Draw lines,arcs at design time then change color on an event at runtime:

    There is no QGraphicsArcItem, the ellipse item can be told to create partial ellipses but I haven't found a way to make it create arcs - it creates pie pieces. 2. Using the QGraphicsPathItem sort of works but I haven't found a way to stop it adding a line to the start of the arc

    I don't have anything to say about QML vs widgets as I only use the latter. But if you are still interested in how to draw an arc on a QGraphicsScene without the pie/line QT QGraphicsScene Drawing Arc shows how to do that.

  • 0 Votes
    4 Posts
    84 Views
    SGaistS

    You're welcome !

    Since this is what you wanted, please mark the thread as solved using the "Topic Tool" button or the three dotted menu beside the answer you deem correct so that other forum users may know a solution has been found :-)

  • Divide the MainWindow class into smalller classes

    Unsolved
    8
    0 Votes
    8 Posts
    127 Views
    A

    Making everything into custom widgets would be more work that sticking with that big class, but I'll definitely keep this in mind. Thank you both @jsulm and @JonB for help.

  • 0 Votes
    2 Posts
    48 Views
    SGaistS

    Hi,

    It seems you have indeed found something. It's reproducible as well in C++.
    You should open a ticket on the bug tracker with you reproducer (don't forget to check if something similar has already been reported).

  • 0 Votes
    3 Posts
    53 Views
    B

    Hi and thanks for your welcome.
    Good question, I'm trying to create Qt bindings for Ada language.
    Some attempts with C++ were failing due to some C++ subtleties.
    But Python provides C API which I can used easily with Ada.
    I provide some very first Qt bindings for Ada.
    But class inheritance is still in Python.
    I wanted to make them full Ada. I'm able to instantiate a class inherited from QRasterWindow (for instance) but a call to the method metric (for instance) provoques a seg fault.
    (for simplicity I post the code in C)

  • How to properly restart QStateMachine

    Solved
    3
    0 Votes
    3 Posts
    64 Views
    A

    @SGaist

    Thanks

  • 0 Votes
    3 Posts
    82 Views
    H

    That works. If the parent has row() and column() values of -1, then that indicates the parent is the root node.

  • 1 Votes
    4 Posts
    167 Views
    jeremy_kJ

    @Toastito said in How does PyQt5 handle system dark and light mode transitions?:

    The downside is that PyQt5 will still send a palleteChanged signal/event when the system theme changes. Ideally, I would've been able to block it and implement my own.

    I haven't tried, but would expect an event filter to be able to filter out PaletteChange events.

    The QGuiApplication::paletteChanged signal doesn't appear to be connected to anything by default. QObject::disconnect() without a receiver would ensure that, for any existing objects at the time of the call. Note that disconnecting signals at random can have surprising results.

  • A few questions regarding shortcuts

    Moved Unsolved
    12
    0 Votes
    12 Posts
    253 Views
    G

    @jsulm Thank you. I will look into that!

  • 0 Votes
    2 Posts
    65 Views
    SGaistS

    Hi,

    It seems you would need an item on top of your images that you would paint transparently and then use something like QPainterPath to create the shape for your selection. The QGraphicsPathItem might be enough for your needs.

    Hope it helps

  • 0 Votes
    28 Posts
    872 Views
    jsulmJ

    @Al3x said in VPN connect app. PyQt5. how to display output in second display?:

    Because hes an ignorant fool!

    I already told you to stop to behave this way.
    You will be banned if you continue to insult other people.
    Last warning...

  • Check spelling in QLineEdit and QPlainTextEdit?

    Unsolved
    2
    0 Votes
    2 Posts
    71 Views
    SGaistS

    Hi,

    I don't think you can do it as integrated as you would like as neither of these widgets are native controls.

    From a quick search, the API of interest is NSSpellChecker.

  • Loading QPA plugin from Python

    Unsolved
    3
    0 Votes
    3 Posts
    76 Views
    JonBJ

    @3n3l
    I don't know about the whole area, but you can set an environment variable as the first statement in a Python program if that is what you need for the later code?

  • cross-compiling pyside2 for AArch64

    Unsolved
    2
    0 Votes
    2 Posts
    58 Views
    F

    This looks like your Qt version is way too old. PySide2 also does not support the platform; please use the current version (PySide 6), see https://doc.qt.io/qtforpython-6/gettingstarted/index.html for cross build instructions.

  • 1 Votes
    7 Posts
    227 Views
    A

    @DieterV said in "corrupted size vs. prev_size while consolidating" or "double free or corruption (!prev)" from thread:

    I can try to write a compact example that exhibits the same issues to demonstrate what I'm doing

    That would be nice

  • QTabWidget.tabCloseRequested

    Solved
    7
    0 Votes
    7 Posts
    148 Views
    JonBJ

    @MasterQ
    Yes, that allows you to delete whatever widget is on the tab if you wish.
    However, I don't think a tab has to have a widget, so to prevent error:

    if widget is not None: widget.deleteLater()
  • QTreeWidget - read/display XML?

    Locked Unsolved
    6
    0 Votes
    6 Posts
    164 Views
    Axel SpoerlA

    @Al3x said in QTreeWidget - read/display XML?:

    Ive shared all information in my first post.

    Why start a duplicate topic then? How should anybody know that this is a duplicate?
    You are wasting the time of voluntary contributors. Duplicate topics are discouraged. Don't do it again.
    I'll lock this topic. Continue here.