Skip to content
  • PySide vs PyQt ui file load.

    Unsolved Qt for Python pyside
    8
    0 Votes
    8 Posts
    174 Views
    JonBJ
    @swoiwode Yes, you have made the right changes! Note how you changed from PyQt6.uic.loadUi(ui_file, self), which loaded into self and gave you self.label etc. over to self.ui = PySide6.QtUiTools.QUiLoader().load(ui_file), which returned into a newly created self.ui (or whatever you choose to call it) and hence gave you self.ui.label etc. It's just a different way of doing things, and PySide just does not offer that parameter or loading into self. Looking around at what examples there are on the web I found that actually even in PyQt more people had worked from self.ui = PyQt6.uic.loadUi(ui_file) which is also available and similar to the PySide way than that "non-standard" PyQt6.uic.loadUi(ui_file, self) which the code you inherited had chosen to use. Honestly you came across one of the few difference between PyQt and PySide right from the outset in the small script you were working on. 99% of the time you should find that same code simply works from PyQt to PySide.
  • 0 Votes
    3 Posts
    90 Views
    jeremy_kJ
    Another option: Use a single custom delegate for the entire view, and look up the screen position of the index to determine the desired drawing style.
  • 0 Votes
    4 Posts
    244 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.
  • 0 Votes
    5 Posts
    592 Views
    transistxrT
    @friedemannkleint This did not work either, although I wasn't getting any errors as such
  • Very slow QTableView multi-select on PySide6 for large dataset

    Unsolved Qt for Python pyside python
    10
    0 Votes
    10 Posts
    2k Views
    JonBJ
    @jeremy_k Oh I agree, and I am guessing that is what is happening. I am not a regular Python/PySide user, only occasional. At design time in the IDE I thought if you click on Qt.ItemFlag.ItemIsSelectable is takes you straight to an imported file where that is defined as a number in an enum. Which makes you (me) kind of think that can be done as a constant. But I suppose that is wishful thinking. Assuming the slow lookup is indeed required, it makes one reflect at just how many seemingly innocuous expressions, especially Qt ones, may be dotted around the code which could be in this situation and could be optimized if the coder happens to notice ad think about them. Which the OP may wish to look into if speed is such an issue.
  • QSqlQueryModel.setQuery() won´t accept strg

    Solved Qt for Python qt for python pyside
    5
    0 Votes
    5 Posts
    876 Views
    S
    Solved: Missing parenthesis in self.mod_Indication = QtSql.QSqlQueryModel correct: self.mod_Indication = QtSql.QSqlQueryModel()
  • 0 Votes
    2 Posts
    628 Views
    No one has replied
  • 0 Votes
    5 Posts
    867 Views
    G
    @SGaist Thanks for the suggestion! I’ll definitely try using commitDataRequest(). Just to clarify — will this method reliably block or cancel GUI-initiated shutdowns (like using the power-off button from GNOME or KDE) if I call manager.cancel() inside that slot? Also, does this approach still work reliably with modern session managers, given that some DEs (like GNOME) are moving away from traditional X11 session management? Are there any best practices for using commitDataRequest() together with D-Bus inhibitors or org.freedesktop.login1 to improve compatibility across desktop environments? Thanks again — I appreciate your insights!
  • PyQt TableWidget abilities

    Unsolved Qt for Python qt for python python pyside pyside2
    3
    0 Votes
    3 Posts
    640 Views
    SGaistS
    Hi and welcome to devnet, What exactly are you after ? Did you already went through the documentation of the corresponding class ? Did you check the examples using it ?
  • Unable to make use of QBoundingVolume

    Unsolved Qt for Python pyside python qt for python
    1
    0 Votes
    1 Posts
    293 Views
    No one has replied
  • 0 Votes
    2 Posts
    500 Views
    JonBJ
    @BGrimaud If you delete the ui_...py file and resave does that recreate it, and reflect new changes? Do you have the option to try a newer version of Creator?
  • QtAsyncio handle_sigint QDockWidget Timer Issue?

    Unsolved Qt for Python pyside
    1
    0 Votes
    1 Posts
    302 Views
    No one has replied
  • 0 Votes
    4 Posts
    1k Views
    M
    Out of curiosity, have you tried building this with "pure" nuitka (not via pyside6-deploy)? I have completely given up on pyside6-deploy, but never really have any problems with nuitka for any platform.
  • PySide6 Unsupported keyword on Grid Layout

    Unsolved Qt for Python pyside qt for python python
    9
    0 Votes
    9 Posts
    2k Views
    JonBJ
    Well it's nice to know it's in good hands :)
  • Release a Qpdf without loading a new one

    Solved Qt for Python qt for python python pyside
    11
    0 Votes
    11 Posts
    2k Views
    A
    I've finally found the solution, it was indeed the eventloop. The process will only be destroyed after the next loop. match_manager.py # Mettre à jour les variables dans le fichier Excel ExcelToPdfWorker.update_variables(excel_path, variables) # Connecter le signal avant de décharger le PDF match_widget.editor.pdf_unloaded.connect( lambda: self._convert_after_unload(match_widget, excel_path) ) match_widget.editor.unload_pdf() def _convert_after_unload(self, match_widget, excel_path): """Appelé quand le PDF est vraiment déchargé.""" self.excel_worker.excel_path = excel_path self.excel_worker.convert() # Une fois la conversion terminée, on peut recharger le PDF match_widget.editor.load_new_pdf(match_widget.pdf_path) editor.py def unload_pdf(self): """Ferme le PDF actuel et nettoie les références.""" # Détacher la vue du document actuel self.pdfView.setDocument(None) # Fermer et supprimer l'ancien document if self.pdfDocument: old_document = self.pdfDocument # Créer un nouveau document vide avant de détruire l'ancien self.pdfDocument = QPdfDocument(self) # Connecter le signal destroyed à l'émission de notre signal old_document.destroyed.connect(self.pdf_unloaded.emit) old_document.close() old_document.deleteLater() def load_new_pdf(self, pdf_path): """Charge un nouveau fichier PDF.""" # Charger le nouveau PDF self.pdfDocument.load(pdf_path) self.pdfView.setDocument(self.pdfDocument) print(f"Nouveau PDF chargé: {pdf_path}") return True I'm well aware that my code sucks. Here's the solution. As deleteLater() really destroy the PdfDocument and unload it, you have to wait until the end of a complete cycle and return to app.exec(). Then I put in a signal that will convert the file once the reference has been destroyed, since we know that this frees access You should know that I think this is the only method without making temporary files
  • 0 Votes
    4 Posts
    1k Views
    JonBJ
    @GrecKo said in Is there any state management library for PySide project?: In your example, can both your views share a common model? Alternatively could you have two models sharing some common underlying data? @markleo Following up this suggestion from @GrecKo. If the models really share the same data you could have that as a single, source model and then impose separate proxy models on top of that for each distinct view. But that relies on a common, shared, base model, not suitable if the models are really quite distinct.
  • 0 Votes
    3 Posts
    610 Views
    Pl45m4P
    @markleo said in Apart from the modules provided by the official website, are there any other third - party Qt modules? If so, is there a central repository similar to npmjs.org?: third - party Qt modules What are third-party Qt modules?! Modules not made by Qt devs and published in the official Qt releases are not "Qt"... Since Qt is still just a C++ GUI framework and still not its own programming language like JavaScript, there are thousands of projects made by users/contributors on GitHub and similar sites, which work with or add something to Qt... custom widgets, functions or just code snippets... Edit: What @ChrisW67 is referring to is what I meant..."extensions" like QxORM can be integrated because of Qt's C++ API... but so does every C++ library work with your C++ project
  • "Sharp" scaling for high DPI?

    Unsolved Qt for Python pyside python
    1
    0 Votes
    1 Posts
    246 Views
    No one has replied
  • Where are these tools after installing PySide6 on macOS?

    Unsolved Qt for Python pyside
    7
    0 Votes
    7 Posts
    1k Views
    SGaistS
    @markleo You have the conda base environment activated but used pip to install pyside6. So which pip did you use exactly ? What are the exact step you used ? What was the state of your terminal at that time ?