Skip to content

Qt for Python

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

3.3k Topics 14.7k Posts
  • QIcon crop when drag and display it in a QScrollArea

    Unsolved
    2
    0 Votes
    2 Posts
    183 Views
    SGaistS
    Hi and welcome to devnet, Why are you doing all these scaling operation to, in the end, not used that scaled pixmap ? In any case, you should start by making it work without particular scaling or fixed size. Once you have ensured that you have the icon properly working, you can start scaling the icon, and only once you are sure you have what you want, fix the size of the QLabel. That said, why not use a QListView/QListWidget to show these icon.
  • qtCreator - debug python scripts?

    Unsolved qt for python
    2
    0 Votes
    2 Posts
    294 Views
    F
    See https://doc.qt.io/qtcreator/creator-python-development.html ; you need to create a Python project first.
  • 0 Votes
    4 Posts
    192 Views
    K
    Update on the Drag-and-Drop Issue: Root Cause Identified I've identified the bug: The issue is caused by running the application as Administrator, not by having Microsoft PowerToys FancyZones enabled. Thank you to everyone who provided feedback on this issue. After further investigation, I've determined that the primary cause of the drag-and-drop failure is running the PySide6 application with administrator privileges, not the presence of Microsoft PowerToys FancyZones. Root Cause Clarification Windows implements strict security isolation between processes running at different privilege levels. When a PySide6 application runs with administrator rights, it operates in a different security context than most desktop applications (including Windows Explorer, which typically runs at standard user level). This isolation prevents the cross-process communication necessary for drag-and-drop operations to function properly, resulting in the forbidden symbol (🚫). Recommended Solution Run your PySide6 application at standard user privilege level (without administrator rights). This is the most straightforward solution and maintains normal drag-and-drop functionality. If your application genuinely requires elevated privileges for certain operations, consider: Implementing alternative file selection methods in your UI (e.g., QFileDialog for file opens, command-line argument support, or copy/paste path handling). Restructuring your application so that only the specific components needing elevated privileges run as administrator, while the main GUI runs at standard user level. Why FancyZones Might Have Seemed Related PowerToys FancyZones, which manages window layouts, might have interacted visibly with the window of an elevated application, potentially making the issue more noticeable. However, the core permission isolation issue lies with the administrator privilege level itself. Verification You can verify this by running the provided example code without administrator privileges. Drag-and-drop should function correctly, even with FancyZones enabled. Apologies for the initial confusion regarding FancyZones, and I hope this clarification helps others experiencing similar issues.
  • QMessageBox not working

    Unsolved
    5
    0 Votes
    5 Posts
    510 Views
    jsulmJ
    @Borbixxx What does your post have to do with this topic? "But my code is not running as expected" - is not a problem description. closeEvent needs to be a method in a class derived from QWidget based class.
  • Building python-pyside2 for Almalinux 9

    Unsolved
    8
    0 Votes
    8 Posts
    466 Views
    P
    I have successfully built pyside2 with your help, many thanks. I'm building it again today more cleanly with steps documentation and rpm packaging of the binaries to deploy on numerous laptops and servers running almalinux9. Next I will try to build the Fedora35 Freecad version from the source rpm. Yes latest Freecad versions are based on pyside6 and qt6, but Almalinux provides qt5 (and optionally qt6) but not PySide6. I will also try this build later.
  • Building PySide6 with development install

    Unsolved
    5
    0 Votes
    5 Posts
    245 Views
    SGaistS
    Are you following this example ?
  • Is building for iOS supported?

    Unsolved
    12
    0 Votes
    12 Posts
    2k Views
    F
    The Qt Project Contribution guidelines are explained at https://contribute.qt-project.org/guidelines . The communication channels are listed at https://wiki.qt.io/Qt_for_Python / Community . The current state of affairs is visible at https://codereview.qt-project.org/c/pyside/pyside-setup/+/651061 . Some changes have been already submitted.
  • Issues with link switching via keyboard in QPlainTextEdit

    Solved
    7
    0 Votes
    7 Posts
    433 Views
    jeremy_kJ
    @wayfarer said in Issues with link switching via keyboard in QPlainTextEdit: @jeremy_k said in Issues with link switching via keyboard in QPlainTextEdit: Have you considered QTextBrowser? It has link handling APIs, and tab navigation between links works. I was hoping to avoid having to use a different widget since I've already built most of my app around the QPlainTextEdit. Besides, I vastly prefer its scrolling behavior. QTextEdit and QTextBrowser both cut off the text when the user scrolls past it, leaving it partially visible at the top of the window. QPlainTextEdit doesn't. It's a nice visual feature that makes the app feel much smoother. Switching to QTextBrowser seems like a viable solution, though I'll have to modify my existing code to work with it. I would prefer to keep the QPlainTextEdit scrolling behavior somehow if possible. Is there any particular reason why that flag doesn't work with QPlainTextEdit? The scrolling difference is due to QPlainTextEdit's override definition of QAbstractScrollArea::scrollContentsBy. The implementation is here. My guess is that handling of links, including navigation between them, isn't seen as part of the functionality of the widget. QTextEdit also lacks navigation between links. The QPlainTextEdit::textInteractionFlags contains what may be a revealing error: Specifies how the label should interact with user input if it displays text.
  • Updating to 6.9.1 breaks code which work under 6.9.0

    Unsolved
    6
    1 Votes
    6 Posts
    1k Views
    E
    Has 6.9.2 resolved this issue? I no longer have the code I could have used to test this.
  • DLL Problems - DLL load failed -> QtCore

    Solved
    3
    0 Votes
    3 Posts
    225 Views
    B
    Found the solution. PyQt6 6.9.1 is not compatible with Python below 3.10. Updating python version helped. Leaving for the future researchers.
  • How to disable a QAction when variable x is equal to y?

    Solved
    4
    0 Votes
    4 Posts
    243 Views
    W
    Thanks for the help. I ended up just checking the variable inside the function the action triggers so it gets disabled as needed when it's used. It's working perfectly now.
  • Can't load external themes when using PySide6

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    J
    @SGaist Hmm... interesting. Will look into that.
  • not able to get selection of pdf document

    Unsolved qt for python
    2
    0 Votes
    2 Posts
    1k Views
    F
    The QPdfView widget text selection functionality is currently not completely implemented or has bugs, see for example https://bugreports.qt.io/browse/QTBUG-131443 .
  • 0 Votes
    8 Posts
    3k Views
    F
    You have a mix of PySide6 and PyQt6 here, what are you using, really?
  • Protecting the source code from reverse engineering

    Solved
    4
    0 Votes
    4 Posts
    2k Views
    Axel SpoerlA
    I have used CodeMorpher a while back.
  • Using QTimer.SingleShot to Report Minimizedness Gets the State Wrong

    Unsolved
    12
    0 Votes
    12 Posts
    2k Views
    J
    Thanks for the advice!! In case anyone wants to look at the ticket here it is: https://bugreports.qt.io/browse/QTBUG-139410
  • Need some help migrating code from PySide2 to PySide6 (SideFX decided to update)

    Solved
    5
    0 Votes
    5 Posts
    1k Views
    SGaistS
    Excellent ! Then please mark the thread as solved using the "Topic Tools" button or the three dotted menu beside the answer you deem correct so other forum users may know a solution has been found :-)
  • If I want to adhere to the platform styles, what's the best Qt stack?

    Solved
    3
    0 Votes
    3 Posts
    337 Views
    RokeJulianLockhartR
    @JKSH, thank you. post/744511 explains well how to code for this.
  • How to report issues with Qt documentation?

    Unsolved
    5
    1 Votes
    5 Posts
    986 Views
    RokeJulianLockhartR
    @Alhazred, they appear to all be Python now: [image: 15ef3bc4-ae26-458e-aef6-1f2d7d87fb4f.png]
  • PySide6 and Nuitka Commercial

    Solved
    3
    0 Votes
    3 Posts
    304 Views
    A
    @SGaist Hi, ok, thank you. If I do not report back, assume it worked like the non-commercial version.