Initial commit

This commit is contained in:
torsten committed 2026-08-13 18:33:10 +02:00
commit b7d90b9afe
16245 files changed
+3396666

No files matched your search

@@ -0,0 +1,35 @@
#include "pre_screen.h"
#include <QStyleOption>
#include <QPainter>
Screen::Screen()
: QWidget()
{
setBgColor(QColor("black"));
setContentsMargins(0, 0, 0, 0);
}
Screen::~Screen()
{
const auto p1Widgets = findChildren<QWidget *>(QString(), Qt::FindDirectChildrenOnly);
for (QWidget *w : p1Widgets)
w->setParent(nullptr);
}
void Screen::setBgColor(const QColor &color)
{
setStyleSheet(QStringLiteral("Screen { background: %1; background-color: %1; }").arg(color.name()));
}
void Screen::paintEvent(QPaintEvent *) // needed to apply the style sheet...........
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}