Skip to content

Qt for Python

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

3.3k Topics 14.6k Posts
  • QTableView with `from __feature__ import snake_case, true_property`

    Unsolved
    3
    0 Votes
    3 Posts
    573 Views
    SGaistS
    Hi and welcome to devnet, QTableView has no "model" property hence you are replacing the setModel method with your model object. If anything you might be able to use "set_model" in place of setModel.
  • Help with breaklines on PlainTextEdit

    Solved
    2
    0 Votes
    2 Posts
    250 Views
    eyllanescE
    @Black-Cat In the .txt you have 12 characters since "\n" is 2 characters but "\n" is a character (carrier return). A possible solution is to replace those 2 characters with the one you want: with open('text.txt') as x: y = x.read() y = y.replace("\\n", "\n") # or # y = y.replace(r"\n", "\n") self.shell_host.insertPlainText(y)
  • closeEvent not running

    Solved
    36
    0 Votes
    36 Posts
    6k Views
    SGaistS
    @DoubleFelix said in closeEvent not running: I don't know how to close this AFAIK, you can't close the thread however you can either delete your post or post a link to the new thread.
  • Why click on button opens new PyQt window ?

    Unsolved
    5
    0 Votes
    5 Posts
    954 Views
    JonBJ
    @Samuel-Bachorik Why not show whatever it is you have now so we can see & understand?
  • Set text doesnt set text...

    Unsolved
    3
    0 Votes
    3 Posts
    280 Views
    Samuel BachorikS
    Thank you now it is working !!!!!
  • ComboBox Delegate edit the wrong row in QTableView

    Unsolved
    12
    0 Votes
    12 Posts
    1k Views
    SGaistS
    @JonB said in ComboBox Delegate edit the wrong row in QTableView: @SGaist @hachbani has complained that then an additional click to show the comboBox list For CurrentChanged, and other edit triggers, don't they just put the combobox in the cell but not expand it? I think the stackoverflow proposals are to do with getting the combo's dropdown list to pop up immediately (on the single-click-to-edit), which the OP was asking for. See ? You were right to argue, I missed the "triple click" issue :-)
  • 0 Votes
    3 Posts
    1k Views
    _
    @JonB it worked well. Thanks
  • QCompleter change value in all ComboBoxs

    Unsolved
    7
    0 Votes
    7 Posts
    884 Views
    F
    @mrjj said in QCompleter change value in all ComboBoxs: @Falassion You just need to do completer = qtw.QCompleter(completamento) for each self.elenco_alimenti_colazione[i].setCompleter(completer) They can use same list (completamento) Im 100% python noob but might be like for i in range (18): self.elenco_alimenti_colazione[i].addItem(row[1]) self.elenco_alimenti_colazione[i].setCompleter( qtw.QCompleter(completamento) ) so each gets its own instance (but same list ) Thanks ! It work! :D
  • QCameraViewfinder in .ui file.

    Moved Solved
    14
    0 Votes
    14 Posts
    2k Views
    I
    @eyllanesc thanks a lot! Changing the header file name helped. I have also fixed the multiple inheritance. I hope I will be able to avoid such problems in the future.
  • Dynamic change of font color in QTextEdit

    Unsolved
    3
    0 Votes
    3 Posts
    1k Views
    SGaistS
    Hi, Sounds a bit like you need QSyntaxHighlighter.
  • What license should be applied to PySide2 linking methode by using Pyinstaller?

    Solved
    2
    0 Votes
    2 Posts
    443 Views
    SGaistS
    Hi, these are generated files so their licence will follow the one you use for your application that's a question for the pyinstaller folks. However it's likely just gathering the modules you need and does not do any linking.
  • Set QLineEdit text from function in second file

    Unsolved
    5
    0 Votes
    5 Posts
    528 Views
    JonBJ
    @Samuel-Bachorik Probably make dj a member variable in self. As it stands, dj = Window() creates a Window, but then goes out of scope and so the Window gets destroyed as soon as you exit the onClick() slot. However, I suspect there is/may be some confusion here. You create one window = Window in the __main__ scope. Window is a QMainWindow. You then create a new, separate Window in onClick. Why? In normal case your program should have only one QMainWindow, why do you want a second one? If you want another window, why make it a QMainWindow?
  • QMediaPlayer Video Opens Second Window. Only One Desired. GStreamer Pipeline URI

    Solved
    4
    0 Votes
    4 Posts
    2k Views
    M
    The problem appears to be related to where you call player.setMedia. If I call it after setVideoOutput, everything works hunky dory
  • QGLWidget/high-dpi: convert mouse position to GL pixels?

    Solved
    2
    0 Votes
    2 Posts
    281 Views
    A
    Never mind, I just figured it out: ratio = self.window().devicePixelRatio()
  • 0 Votes
    5 Posts
    1k Views
    N
    @JonB thank you!
  • Set same size for a group of QlineEdit

    Unsolved
    5
    0 Votes
    5 Posts
    511 Views
    jsulmJ
    @Falassion You can set fix size on the widgets in these columns
  • How should I start a screen?

    Solved
    4
    0 Votes
    4 Posts
    424 Views
    SGaistS
    The code generated by Designer allows you to see the widget if you call the script directly. That's not what you want. Create your own main.py, import the widgets you want to use and implement the logic there.
  • Run pyqt5 on docker with ui file

    Unsolved python qt for python
    4
    0 Votes
    4 Posts
    5k Views
    SGaistS
    Hi, Your application does not run a web server therefore trying to access it with a web browser won't work. You will have to have a X11 server running on your Windows machine. See this article for an explanation about that.
  • Convention for pyqt5

    Unsolved
    3
    0 Votes
    3 Posts
    310 Views
    SGaistS
    Hi, The best thing to do is to properly separate your UI in functional units and then make custom widgets out of them.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    8 Views
    No one has replied