Button labels stay greyed out after setEnabled(True) [closed] - python

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I want to disable and later re-enable a bunch of QPushButtons and QRadioButtons. Disabling them using button.setEnabled(False) works perfectly, the button outline and label are greyed out and it's not clickable anymore.
However, after doing button.setEnabled(True) later, the outline returns from grey to white, but the label stays grey.
Did I miss something or is this a bug in Qt?

Solution:
Turns out this problem is caused by me using multiple threads.
I solved the problem by switching from python threading to QThread and catching the started() / finished() signals of the new thread to disable/enable the UI elements.

Related

Camera For My Pygame OpenGL game wont work [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed yesterday.
Improve this question
I am following along with Let's Code 3D Engine in Pygame. OpenGL Tutorial https://www.youtube.com/watch?v=eJDIsFJN4OQ&t=695s and it is not working like when ever I rotate the camera with my mouse it hits the edge of the screen and it wont move the camera any more i also cant look down for some reason I even downloaded the guys code and ran it and it still wouldn't let me turn all the way here is all of my code pastebin.com/52cVLQvm

pygame.image.load not doing anything [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 months ago.
Improve this question
I am trying to follow a tutorial to make a game with python and the pygame library. In the tutorial, this is used to set the icon of the window:
icon = pygame.image.load('icon.png')
pygame.display.set_icon(icon)
It does changes the icon, but to another generic icon which is not 'icon.png' at all!
icon.png is in the same directory as my .py, and I get no error message.
What is happening?
The error that you have come across was a problem with the tutorial video, not you that is the correct code I suggest watching/finding a new totorial.

How Can I Get a Python Tkinter Window Open And Close By Itself? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
Basically When The User Clicks On a "Reset" Button It Has To Exit The Current Window And Open It Again So It "Resets". I Hope Someone's Got an Answer Cuz' I Really Need To Finish This Program, and StackOverflow Is a Really Large Programmer Community!
try this for closing the tab automatically
root. destroy()
but if you want to close after a particular amount of time please do use the sleep command use this
w = tk.Tk()
w.after(30000, lambda: w.destroy()) # Destroy the widget after 30 seconds
w.mainloop()

Serial Graphical LCD control with Python over SPI from Raspberry Pi [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to use the Sharp LS027B7DH01 LCD display here: http://www.sharpmemorylcd.com/resources/LS027B7DH01_Spec.pdf
http://www.mouser.com/ProductDetail/Sharp-Microelectronics/LS027B7DH01/?qs=muFWWzTLGEIPdePNc1A/NQ==
I need to control it with a Raspberry Pi programmed in python 2.7. It is a 400x240 display controlled via SPI, but no controller chip part number is identified. There are only 4 commands to write to it, and each display line is written one at at time. I've not been able to find an existing driver to use with it (but honestly, I'm not sure I am searching for the right things)
I could write a driver from the ground up to do text and graphics and everything, but it seems like a lot of work, and surely something like this has to already exist...
Any assistance would be appreciated!
The best solution I have found is to create bitmaps of the entire screen area with other tools such as pybmp, PIL, etc and simply dump that image to the LCD for display.

making paint in pyqt or qt [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
i have just received a task to implement a software that paints over pictures (pretty much like microsoft paint )
i have no idea where to start or how to do that. do anyone have a good reference or idea for painting in qt or pyqt ?
this will be highly appreciated
thanks in advance
You'll be working with the QImage class, which represents bitmap images. It has methods for changing the colour at a given pixel using setPixel. There is am Image Viewer Example provided with Qt and PyQT should come with the same example in Python. However it uses a Qlabel to display the image so you may want to use a different widget, perhaps a custom QWidget subclass. You can start with that and add functionality to detect the mouse position in the , mouse clicks, etc and change the colours.
Check out Qt painting class QPainter:
https://doc.qt.io/archives/qt-4.7/qpainter.html
Have you looked at the scribble example included in PyQt? It does basic drawing, saving, loading, etc.

Categories