Created
May 29, 2025 18:08
-
-
Save sulincix/f19441ff329d4db6efbbf5cb6c3d6025 to your computer and use it in GitHub Desktop.
Simple qt application that may fix lcd bad pixel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QApplication> | |
#include <QMainWindow> | |
#include <QPalette> | |
#include <QTimer> | |
/* For compile: | |
g++ main.cpp -o lcd-fix $(pkg-config --cflags --libs Qt6Widgets Qt6Core Qt6Gui) -fPIC | |
*/ | |
static QMainWindow *mainWindow; | |
QColor colors[] = {Qt::red, Qt::green, Qt::blue}; | |
static void changeColor(){ | |
QPalette palette = mainWindow->palette(); | |
palette.setColor(QPalette::Window, colors[rand()%3]); | |
mainWindow->setPalette(palette); | |
mainWindow->setAutoFillBackground(true); | |
} | |
int main(int argc, char *argv[]) { | |
QApplication app(argc, argv); | |
mainWindow = new QMainWindow(); | |
mainWindow->showFullScreen(); | |
QTimer *timer = new QTimer(mainWindow); | |
mainWindow->connect(timer, &QTimer::timeout, mainWindow, changeColor); | |
timer->start(1000/60); | |
return app.exec(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment