Skip to content

Qt for Python

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

3.2k Topics 13.9k Posts
  • 0 Votes
    4 Posts
    96 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
    50 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
    208 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
    86 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
    47 Views
    No one has replied
  • 1 Votes
    2 Posts
    91 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
    242 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
    471 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
    155 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
    92 Views
    K

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

  • crop the image

    Unsolved
    2
    0 Votes
    2 Posts
    73 Views
    SGaistS

    Hi,

    Is that related to this thread ?

  • crop the image

    Unsolved
    5
    0 Votes
    5 Posts
    155 Views
    SGaistS

    Where in that code is the cropping done ?

  • Multi column context menu

    Unsolved
    7
    0 Votes
    7 Posts
    178 Views
    GrecKoG

    A QTableWidget doesn't seem to be most solution thing for this, you are not presenting data.

    A QHboxLayout of QVBoxLayout would be the solution I'd try.

  • PyCapsule in Shiboken bindings

    Unsolved
    1
    1 Votes
    1 Posts
    55 Views
    No one has replied
  • Logging

    Unsolved
    2
    0 Votes
    2 Posts
    94 Views
    sierdzioS

    @MasterQ said in Logging:

    What does the qCWarning, qCDebug, ... do? The first parameter is an object. What object? I could not find a suitable documentation.

    This is for categorized logging, more info here: https://doc.qt.io/qt-6/qloggingcategory.html. I don't know if it works with Python.

  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • 0 Votes
    2 Posts
    107 Views
    JonBJ

    @mlperini
    My 2 cents. Only my assumptions.

    The pip install of PySide6 is intended for Python use and deliberately standalone/self-contained/isolated from whatever Qt6 you may or may nor have outside on the system. If you have an incompatible version out there it doesn't matter.

    Conversely the non-Python world just sees what is out there in the system, nothing to do with the Python. So again if they're incompatible it doesn't matter.

    This works fine for distinct applications. But I can imagine that if you want to mix Python and system/C++ in one process don't you need them to be the exact same version to avoid grief?

  • How to go about creating drag/drop tabs?

    Unsolved
    1
    0 Votes
    1 Posts
    68 Views
    No one has replied
  • modified Qt example editabletreemodel

    Solved
    6
    0 Votes
    6 Posts
    165 Views
    MasterQM

    Oh dear, it's Friday.

    the isue was that I called

    i11 = ProjectsTreeItem(["11", "12"])

    instead of

    i11 = ProjectsTreeItem(["11", "12"],i1)

    I've forgotten to give the parent parameter, which is set to None as default.