Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+39
@@ -0,0 +1,39 @@
|
||||
#include "pre_screen.h"
|
||||
|
||||
#include <LtsUtilsGui/LtsUtilsGuiDds/dds_vector_to_pixmap.h>
|
||||
|
||||
#include <QPainter>
|
||||
#include <QStyleOption>
|
||||
|
||||
|
||||
Screen::Screen()
|
||||
{
|
||||
setBgColor(QColor("black"));
|
||||
setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
setWindowIcon(LtsUtils::iconFromSvg(QStringLiteral(":/style/execute_presentation.svg")));
|
||||
setWindowTitle(tr("Presentation Screen"));
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
Reference in new issue
Block a user