Skip to content

Qt for Python

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

3.1k Topics 13.9k Posts
  • QtAsyncIO conflict with QDialog.exec()

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • Pyqt Signals connecting multiple slots

    Unsolved
    6
    0 Votes
    6 Posts
    41 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
  • 1 Votes
    8 Posts
    155 Views
    F

    As it is an issue of the underlying Qt library unrelated to the Python bindings it would have to reported under QTBUG though ( see https://wiki.qt.io/Reporting_Bugs / https://wiki.qt.io/Qt_for_Python/Reporting_Bugs ).

  • How to set QCamera resolution on Qt 6

    Solved
    4
    0 Votes
    4 Posts
    97 Views
    R

    @friedemannkleint Thx

  • QTableWidgetItem - type

    Solved
    4
    0 Votes
    4 Posts
    433 Views
    MasterQM

    OK, I found my mistake.

    It is not because of locale.string_format. Two of the columns are to separated positive and negative values. One is holding all positives and the other all negativs.

    If a positive value is found I created a QTableWidgetItem for the 'positive' column but forgott the create one for the 'negative' column and vice versa.

    Stupid!

  • LocalStorage in QWebEngineView not saved after running.

    Unsolved
    2
    0 Votes
    2 Posts
    39 Views
    JonBJ

    @Daic
    I don't know, but start by verifying

    Setting attribute QWebEngineSettings::LocalStorageEnabled is true. QWebEngineProfile::persistentStoragePath() is set to where you expect, does it get updated?
  • QTableView - CheckState

    Solved
    5
    0 Votes
    5 Posts
    90 Views
    MasterQM

    Yes, you are right. PartiallyChecked is the right key word here.

    Now I see, what the difference was between my C++ version and the Python version.

    @JonB said in QTableView - CheckState:

    If you are using 1, True or an expression returning true for Qt.CheckState.Checked that is wrong, and would set Qt.CheckState.PartiallyChecked.

    That was the point.

    thnx

  • 0 Votes
    14 Posts
    350 Views
    JoeCFDJ

    @Big_bo libqwebp.so needs libwebp.so.6. Type command:
    locate libwebp.so.6
    to find its path. Then add its path to your env lib path

  • 0 Votes
    4 Posts
    74 Views
    JonBJ

    @dark_matter_io
    So this is presumably a Qt6 issue rather than PyQt/PySide/Python. You can report at https://bugreports.qt.io/secure/Dashboard.jspa

  • 0 Votes
    2 Posts
    33 Views
    JonBJ

    @markleo
    PySide is not a language. It's just a bunch of Python code bindings to Qt functions written in C++. So your question is just about Python. To which you have answered that "Python is a weakly - typed language".

  • QTableView rows disabled?

    Solved
    9
    0 Votes
    9 Posts
    179 Views
    MasterQM

    @JonB said in QTableView rows disabled?:

    Then you will have to break down/build up till you find the difference in your code! Start by removing "front end identity model", just test directly on model (maybe non-SQL one as well as SQL one) and build back up from there.

    If I would like to find a reason for that behavior!

    At the moment I am satisfied to know about. There is an easy workaround as to set all flags by hand independently to what the framework does. That's enough for now. ... at least for me.

    I am sorry, but to dig deeper into the issue is actually out of my scope.

  • Error in exe file

    Unsolved
    3
    0 Votes
    3 Posts
    71 Views
    JonBJ

    @Mahdi_2020 said in Error in exe file:

    IndexError: list index out of range

    line338: root_object = engine.rootObjects()[0]

    engine.rootObjects() is not an array or, more likely, is an empty array so [0] is out of range.
    If it works under Creator but not outside then presumably creating the engine/objects fails outside because something is not set up right in the environment.

    When I run my program exe file

    When using Python you do not have an executable file, just a bunch of .py file scripts.

  • QFileDialog not started in needs dir

    Unsolved
    21
    0 Votes
    21 Posts
    2k Views
    JonBJ

    @cjw25 said in QFileDialog not started in needs dir:

    But the compilers on the other OSs are complaining that passing in zero is deprecated

    What dos this mean?

  • How to Disable Hover Effect for Arrows in PYQT6 QTreeView?

    Unsolved
    1
    0 Votes
    1 Posts
    31 Views
    No one has replied
  • 1 Votes
    2 Posts
    76 Views
    S

    I've found a solution using QAbstractNativeEventFilter to grab the keyboard events that never make it to the standard Qt event system.

  • QStyleOptionViewItem.rect

    Solved
    9
    0 Votes
    9 Posts
    199 Views
    MasterQM

    @JonB said in QStyleOptionViewItem.rect:

    @MasterQ said in QStyleOptionViewItem.rect:

    no, there is really no rect, see the documentation of PySide I provided. The IDE is right!

    No, there is indeed a rect member!

    Thank you for that information.

    My last tests confirm your answer, I was wrong about missing rect. Sry for the confusion.

  • QSystemTrayIcon doesn't show messages

    Solved
    8
    1 Votes
    8 Posts
    433 Views
    superagaS

    @jsulm said in QSystemTrayIcon doesn't show messages:

    I think it is the title of your application, try to change that

    Hi @jsulm, many thanks for your reply.
    I just tried both: QApplication.setApplicationDisplayName and QApplication.setApplicationName, but do not work.

    Any other idea?
    Cheers

  • translator files platform dependent?

    Unsolved
    5
    0 Votes
    5 Posts
    118 Views
    MasterQM

    Yes, it is PySide 6.8.0.2 on both OS.

    But on Linux I use Python 3.12 and on Windows 3.13

    --Edit: --
    the Python version doesn't matter!, Just tested.

  • 0 Votes
    3 Posts
    66 Views
    K

    @SGaist
    The problem with doing that is that it will reset the current transform, defeating the purpose of scaling/rotating the item.