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
Tag: pyqt5
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:
Can’t stop thread at all (unless I cause an exception)
So I am working on a GUI (PyQt5) and I am multi-threading to be able to do data acquisition and real-time plotting concurrently. Long story short, all works fine apart from stopping the thread that handles the data acquisition, which loops continuously and calls PySerial to read the com port. When a button on the GUI is pressed, I want
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 Python: How to go through Individual Row of Data from MySQL Query Result
I am trying to add item in a QComboBox in PyQt5 using Python. I am having problems in adding data from the SQL Query per row. This results to only a single item added into the Combo Box: What I want to happen in the ComboBox is like this (Add a total of 5 items in the Combo Box) Edit:
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:
How to darken selected text of `textEdit.find()` in PyQt5?
I have this method that finds a term in a textEdit: Now the function is working properly but the textedit.find(term) seems to just lightly highlight the found text like this My question is if textedit.find(term) can select the found text like this Answer You have to change the color associated with QPalette::Highlight: