Skip to content

Qt for Python

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

3.3k Topics 14.8k Posts
  • Resources text file unable to be opened in Windows, but works fine in Linux

    Unsolved
    2
    0 Votes
    2 Posts
    11 Views
    T
    As a further update, I've found that the issue only arises with large-ish JSON text files (over 100k) in the resources; my smaller JSON file, of only around 20k, works just fine on Windows. Is there a maximum size for text files added to the resources on Windows?
  • PySide6.QtGraphs.QSurfaceDataProxy.resetArrayNp called with wrong argument types:

    Solved
    7
    0 Votes
    7 Posts
    64 Views
    SGaistS
    @G4IXT Hi, As an alternative you can very well install PySide6 in your conda environment using pip. That way you can use conda to manage your environments.
  • macOS Trackpad Gestures - Simultaneous Pinch & Pan?

    Unsolved
    2
    0 Votes
    2 Posts
    86 Views
    jsulmJ
    @mjiggidyj said in macOS Trackpad Gestures - Simulatneous Pinch & Pan?: any positional info I get from the QNativeGestureEvent during pinch (from pos(), etc) is not updated What about https://doc.qt.io/qt-6/qnativegestureevent.html#delta ?
  • [PySide6] Unable to listen to DBUS ScreenSaver ActiveChanged Signal

    Unsolved pyside
    1
    0 Votes
    1 Posts
    46 Views
    No one has replied
  • ModernGL with QOpenGLWidget isn't rendering

    Solved qt for python
    7
    0 Votes
    7 Posts
    1k Views
    H
    Hi, For those looking for a functional answer: import sys import moderngl as GL import numpy from PyQt6.QtWidgets import QApplication from PyQt6.QtOpenGLWidgets import QOpenGLWidget class Main(QOpenGLWidget): def __init__(self, parent=None): super().__init__(parent) def initializeGL(self): # Set up the OpenGL context using moderngl self.ctx = GL.create_context() self.ctx.clear(0, 0, 0) # Define shaders with error checking vertex_shader_code = ''' #version 330 core in vec3 in_vert; void main() { gl_Position = vec4(in_vert, 1.0); } ''' fragment_shader_code = ''' #version 330 core out vec4 fragColor; uniform vec4 color; void main() { fragColor = color; } ''' # Compile shaders and program self.program = self.ctx.program( vertex_shader=vertex_shader_code, fragment_shader=fragment_shader_code ) # Check for any shader compilation issues if not self.program: print("Shader program failed to compile.") return # Define triangle vertices (in normalized device coordinates) self.vertices = numpy.array([ 0.0, 0.5, 0.0, # Top vertex -0.5, -0.5, 0.0, # Bottom-left vertex 0.5, -0.5, 0.0 # Bottom-right vertex ], dtype='f4') # Create the buffer for the vertices self.vbo = self.ctx.buffer(self.vertices) # Create vertex array object (VAO) self.vao = self.ctx.simple_vertex_array(self.program, self.vbo, 'in_vert') # Set the uniform color (Red in this case) self.program['color'].value = (1.0, 0.0, 0.0, 1.0) # Red # EDITED: 1.0, 1.0, 1.0 is white. def resizeGL(self, w, h): # EDITED: Detect framebuffer again after resize. # To be fair: Claude AI gave me this solution. fbo = self.ctx.detect_framebuffer() fbo.use() self.ctx.viewport = (0, 0, w, h) def paintGL(self): # Clear the screen self.ctx.clear(0.0, 0.0, 0.0) # Draw the triangle self.vao.render() if __name__ == '__main__': app = QApplication([]) win = Main() win.resize(800, 600) win.show() sys.exit(app.exec())
  • Did pyside6 ever support macOS 10.13?

    Unsolved
    2
    0 Votes
    2 Posts
    87 Views
    I
    It doesn't appear so, no. The minimal version ever supported by Qt 6 (as seen in the 6.0 documentation archives) is 10.14 - https://doc.qt.io/archives/qt-6.0/supported-platforms.html.
  • Qt Designer - unable to replicate qtdesigner-manual form

    Unsolved
    12
    0 Votes
    12 Posts
    708 Views
    JonBJ
    @ReyCBXZRX I don't always follow the logic or English of what you write, but never mind :) A QSpinBox has a pair of "scroll arrows" at the right but it is not a "scrollbar". These are for inc/decrementing the number value and have nothing to do with scrolling or sizing. A QLineEdit is for entering text (rather than number), is single line and has no scrollbars. A QTextEdit or QPlainTextEdit is for multiline text, can be resized vertically and can have scrollbars. There are two ways of adding a layout to a widget in Designer. Each widget can have a layout set by right-clicking on it and selecting Layout > menu item. However for unknown/inexplicable reason this is only enabled when the parent widget has had at least one child widget placed on it, you cannot do it before you add any child widget, which is rather odd. Alternatively there are explicit layout items available at the top of the all the items you can drag from the left-hand side toolbar, these can be dragged and placed anytime. I have never understood/investigated whether there is any difference in result between these two methods. With layouts there should be no "overlapping", it is their job to prevent this. One tip: If you look at the Object Explorer --- the pane at the right which shows all your placed widgets in their hierarchy --- you will see a "red no entry" symbol on any widgets you have created which do not have a layout but should have. If you see that you know you should be adding a layout there.
  • How can I call the const method variant on a Qt object from Python?

    Unsolved qt for python pyside
    3
    0 Votes
    3 Posts
    141 Views
    K
    Thanks for clarifying. I suspected this would be the case but I thought it was worth asking the question.
  • Python 3.14 timeline

    Unsolved
    4
    0 Votes
    4 Posts
    223 Views
    F
    Qt for Python 6.10.1 /6.11 will support Python 3.14
  • QGraphicsAnchorLayout quirks and UI bugs.

    Unsolved pyside2 qt for python
    1
    0 Votes
    1 Posts
    67 Views
    No one has replied
  • QtQuick.VectorImage in PySide6

    Unsolved
    8
    0 Votes
    8 Posts
    692 Views
    SGaistS
    @usymbiote you can check the bug report system. If there's nothing related yet, please open a new ticket.
  • looking for a code editor widget for Qt for Python

    Unsolved
    9
    1 Votes
    9 Posts
    2k Views
    RokeJulianLockhartR
    @nutrx, work is being made toward this at invent.kde.org/frameworks/ktexteditor/-/issues/24 and its superordinate issue.
  • No suitable kits found

    Unsolved
    2
    0 Votes
    2 Posts
    149 Views
    jsulmJ
    @Milosz said in No suitable kits found: How to fix the problem? By manually adding your Python installation in Python/Interpreter in QtCreator settings.
  • PySide vs PyQt ui file load.

    Unsolved pyside
    8
    0 Votes
    8 Posts
    706 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.
  • Pyside on Boot2Qt in RaspberryPi5

    Unsolved
    2
    0 Votes
    2 Posts
    135 Views
    jsulmJ
    @Pritha-Suresh Since you're accessing the device via ssh you need to forward X11 if you want to run a GUI application this way, see -X ssh parameter, Also the error you get hints that you did not install X11 on the device.
  • Font clipping of custom Italic fonts

    Unsolved
    3
    0 Votes
    3 Posts
    219 Views
    M
    This was with PySide6 6.9.2, I also tried with 6.10.0 The OS is Windows 10 22H2
  • PySide on Phytec i.MX Pollux Board — Licensing and Platform Support

    Unsolved
    3
    0 Votes
    3 Posts
    299 Views
    P
    Hi! Thank you for the quick response. We are not going for deployments as of now. We will be showcasing the PySide capabalities as a product demo on Phytec Board. So two points from your response, Do we need commercial license for Pyside demo on Phytec board? Can I get more info on LGPLv3 and GPLv3? Thanks in advance!
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • PyQt6: QSvgWidget does not render when loading a QByteArray instead of a file

    Unsolved
    14
    0 Votes
    14 Posts
    1k Views
    JonBJ
    @ErwanM Yes, the ones there using the R"(-type construct are shown having leading & trailing newlines which will be in the resulting string. One guy does even say All the spaces and indentation and the newlines in the string are preserved. That's up to them for their examples where it doesn't matter. In your case of <?xml we simply cannot afford that. The one which starts std::string index_html=R"html( <!DOCTYPE html> would have a newline before the <!DOCTYPE html>, but maybe that is allowed, unlike for <?xml. Or maybe it isn't allowed either and they didn't check! Anyway, there we are, that's just how it is.
  • This topic is deleted!

    Solved
    4
    0 Votes
    4 Posts
    79 Views