Skip to content
Advertisement

Tag: pyqt5

How to Create a Tamil Phonetic keyboard inputs in python?

My target: create a Phonetic Keyboard in the Tamil language, using dictionary key mapping. My struggle: How to replace my keys with values and set that value to my textbox. For Example: If I press “K” in textbox1, then my textbox1.text will change into the Tamil letter “க்”, if I press “Ku” then textbox1.text will be replaced by the Tamil

error install PyQt5 on Yocto Linux – board Variscite

I have a problem installing a PyQt5 python package. I am in Yocto Linux environment (Hardknott kernel 5.10.35) on the Variscite board (DART-MX8M-PLUS). This is the log when I try to install with pip: Instead, this is the list of currently installed python packages: How can it be solved? Thanks in advance! Answer Do not bother installing packages natively on

PyQt5 very simple button input dialog

I thought I’ll try pyqt(5) for a change and wanted to create a simple dialog on startup of a script that let’s the user choose one of three options. My goal is a popup like this (on startup of a script) that will close on pushing one of the buttons and returns the value of the button that was pressed:

Python Widget with SizePolicy

Why the sizePolicy doesn’t affect on widgets that aren’t in layout? here is an example: But that doesn’t work, if you changed the main window size the red box still has the same size. So how can I make that red box resizeable when the parent (main window) is changing. NOTE: I don’t want to use Layouts for some reason.

How to get the text of the clicked item of Listwidget in PyQt5?

I was looking for a method to get a text/ name of the clicked element on a listWidget. This was my approach looks like: but it always crashes and gives me this error: Could someone please tell me what Im doing wrong? Answer The signature of your slot lamp_clicked is wrong. Take a look at QListWidget::itemClicked and note that the

PyQt5 window comes up empty

I’m trying to build a simple PyQt5 application . I have so far created a couple of widgets and have added them to my layout . Unfortunately my Window is not showing the lables or the pushbutton which I have created . Answer The problem is caused because the layout associated with the widgets is not associated with the window.

How do I modify spacing in nested PyQt layouts?

Currently, I have a nested QVBoxLayout in the first column of a QHBoxLayout, but no matter my changes to .setContentMargins or .setSpacing nothing changes in that first column. Leaves me with this result: What I want: Answer Use addStretch() method:

Advertisement