Skip to content
Advertisement

Tag: pyside2

QTextedit find() always returns False (pyside2)

I want to do some search and replace in a QTextEdit but QTextEdit.find() always returns False/finds nothing. Where is my mistake? Here is a (very) minimal reproducible example: Thx for that -.-: “This question already has an answer here: QTextEdit.find() doesn’t work in Python” That is not true. (Maybe read the questions and answers before stating something like that and

How to quit Qt application before main window is displayed

On launch, my Qt application displays a dialog box with some options, before displaying the main window. The dialog box has a ‘Start’ and ‘Cancel’ button. The same dialog box is used at a later time, after the main window is displayed, when the user clicks on a ‘New Game’ button. I’m trying to have the ‘Cancel’ button quit the

Is there a way to avoid typing QCoreApplication.translate(“Context”,?

To translate strings in PySide2 apps I need to call QCoreApplication.translate() and specify a context, which are a lot of characters to translate a short string. ie: QCoreApplication.translate(“MyClassName”, “Hello”) I tried to do something like this: This way QCoreApplication.translate() was called with the right context and in my sources I could have a shorter name, but the strings weren’t picked

Dynamically creating buttons and assigning click actions

I’m trying to practise by making a Pokedex. I’m trying to dynamically create a list of buttons inside of an OVBoxLayout based on the response from an API call. The list of buttons is generated correctly however, none of the buttons work, code below: The button.clicked.connect() doesn’t appear to be assigning the function to each button, anyone know why this

How to rotate an QImage

I want to rotate my QImage by the amount of x. I don’t want to use QPixMap or the PaintEvent if possible. I have already searched for possible solutions but they didn’t work. Right now i am trying to solve it with the QTransform method: I don’t get any error message the image is just not rotated. Answer I found

Advertisement