1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
---|---|
2 | // |
3 | // SPDX-License-Identifier: GPL-3.0-or-later |
4 | |
5 | #include "windowtheme.h" |
6 | |
7 | #include <QApplication> |
8 | #include <QFile> |
9 | #include <QDebug> |
10 | |
11 | void WindowTheme::setTheme(const QString &file) |
12 | { |
13 | QFile qssFile(file); |
14 | if (!qssFile.open(QFile::ReadOnly)) { |
15 | qCritical()<< "Failed can't open qss file"<< file; |
16 | return; |
17 | } |
18 | qApp->setStyleSheet(qssFile.readAll()); |
19 | } |
20 |