1 Star 0 Fork 0

GXDE OS/GXDE 热区

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
widget.cpp 3.06 KB
一键复制 编辑 原始数据 按行查看 历史
gfdgd xi 提交于 2026-02-01 09:33 +08:00 . 新增多屏幕适配
#include "widget.h"
#include <QDebug>
#include <QScreen>
Widget::Widget(QScreen *screen, QWidget *parent) : QWidget(parent)
{
TopLeft = new requ(screen, requ::TopLeft);
TopRight = new requ(screen, requ::TopRight);
LowerLeft = new requ(screen, requ::LowerLeft);
LowerRight = new requ(screen, requ::LowerRight);
qaq = new QSettings(QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/.config/GXDE/gxde-requ/gxde-requ-setting.qaq",
QSettings::IniFormat);
QString kwinrules;
QFileInfo file1(QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/.config/ukui-kwinrulesrc");
qDebug()<<file1.exists();
if(file1.exists() == false)
{
kwinrules="deepin-kwinrulesrc";
} else {
kwinrules="ukui-kwinrulesrc";
}
QFile file(QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/.config/" + kwinrules);
file.open(QFile::ReadOnly);
QString r = QLatin1String(file.readAll());
file.close();
QSettings tmp(QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/.config/" + kwinrules, QSettings::IniFormat);
qDebug() << r;
if(!r.contains("gxde-requ",Qt::CaseSensitive))
{
QSettings *tmp = new QSettings(QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/.config/" + kwinrules,
QSettings::IniFormat);
tmp->setValue(QString::number(tmp->value("count").toInt()+1) + "/Description", "gxde-requ");
tmp->setValue(QString::number(tmp->value("count").toInt()+1) + "/desktop", -1);
tmp->setValue(QString::number(tmp->value("count").toInt()+1) + "/desktoprule", 2);
tmp->setValue(QString::number(tmp->value("count").toInt()+1) + "/wmclass", "gxde-requ gxde-requ");
tmp->setValue(QString::number(tmp->value("count").toInt()+1) + "/wmclasscomplete", true);
tmp->setValue(QString::number(tmp->value("count").toInt()+1) + "/wmclassmatch", 1);
tmp->setValue("count", tmp->value("count").toInt()+1);
}
TopLeft->setShell(qaq->value("TopLeftShell").toString());
TopRight->setShell(qaq->value("TopRightShell").toString());
LowerLeft->setShell(qaq->value("LowerLeftShell").toString());
LowerRight->setShell(qaq->value("LowerRightShell").toString());
qDebug() << qaq->value("TopLeftShell").toString();
qDebug() << qaq->value("TopRightShell").toString();
qDebug() << qaq->value("LowerLeftShell").toString();
qDebug() << qaq->value("LowerRightShell").toString();
//TopLeft->setGeometry(0, 0, 1, 1);
//TopRight->setGeometry(screenRect.width() - WIDGET_WIDTH, 0, 1, 1);
//LowerLeft->setGeometry(0, screenRect.height() - WIDGET_WIDTH, 1, 1);
/*LowerRight->setGeometry(screenRect.width() - WIDGET_WIDTH,
screenRect.height() - WIDGET_WIDTH,
1,
1);*/
TopLeft->show();
TopRight->show();
LowerLeft->show();
LowerRight->show();
}
Widget::~Widget() {
delete TopLeft;
delete TopRight;
delete LowerLeft;
delete LowerRight;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/GXDE-OS/gxde-requ.git
git@gitee.com:GXDE-OS/gxde-requ.git
GXDE-OS
gxde-requ
GXDE 热区
master

搜索帮助