代码拉取完成,页面将自动刷新
同步操作将从 Qt开源项目集合/火绒 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "kidsprotect.h"
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QGridLayout>
#include <QLabel>
#include <QCheckBox>
#include <QPushButton>
#include "utils.h"
QWidget *CreateCfgItem(QString icon, QString title, QString tip)
{
QPushButton *item = new QPushButton();
item->setStyleSheet("QPushButton{border-style:none;background: #fff; border: 0; }"
"QPushButton:hover {background: #fffcf8; border: 1px solid #ffe7c1; }");
item->setFixedHeight(90);
QLabel *labelIcon = new QLabel();
QLabel *labelTitle = CreateCustomLabel(title, "#444444", 14);
QLabel *labelTip = CreateCustomLabel(tip, "#777777", 12);
QCheckBox *checkBox = new QCheckBox();
checkBox->setStyleSheet("QCheckBox::indicator{width: 32px; height: 32px; }"
"QCheckBox::indicator:checked {border-image:url(:/img/100/switch-ON.png);}"
"QCheckBox::indicator:unchecked {border-image:url(:/img/100/switch-OFF.png);}");
checkBox->setCursor(Qt::PointingHandCursor);
labelIcon->setPixmap(QPixmap(icon));
labelIcon->setFixedWidth(36);
QHBoxLayout *layoutTop = new QHBoxLayout();
layoutTop->addWidget(labelTitle);
layoutTop->addStretch(1);
layoutTop->addWidget(checkBox);
QVBoxLayout *layoutRight = new QVBoxLayout();
layoutRight->addStretch(1);
layoutRight->addLayout(layoutTop);
layoutRight->addWidget(labelTip);
layoutRight->addStretch(1);
layoutRight->setSpacing(2);
layoutRight->setContentsMargins(10, 0, 0, 0);
QHBoxLayout *layoutMain = new QHBoxLayout(item);
layoutMain->addWidget(labelIcon);
layoutMain->addWidget(CreateSeparator(true));
layoutMain->addLayout(layoutRight);
layoutMain->setContentsMargins(20, 10, 20, 10);
layoutMain->setSpacing(10);
return item;
}
KidsProtect::KidsProtect(QWidget *parent) : BaseChildPane(parent)
{
m_strTitle = "访问控制";
InitCtrl();
}
void KidsProtect::InitCtrl()
{
QVBoxLayout *layoutTitle = new QVBoxLayout();
layoutTitle->addWidget(CreateCustomLabel("将计算机调整为更适合访客使用的状态"));
layoutTitle->addWidget(CreateCustomLabel("为防止访问控制配置以及其它配置被修改,推荐使用密码保护", "#777777", 14));
layoutTitle->setSpacing(10);
QVBoxLayout *layoutTopBtn = new QVBoxLayout();
layoutTopBtn->addWidget(CreateCustomButton("密码保护"));
layoutTopBtn->addStretch();
QHBoxLayout *layoutTop = new QHBoxLayout();
layoutTop->addLayout(layoutTitle);
layoutTop->addStretch(1);
layoutTop->addLayout(layoutTopBtn);
QGridLayout *layoutCfg = new QGridLayout();
layoutCfg->addWidget(CreateCfgItem(":/img/100/kidprotect/online.png", "上网时间段控制", "控制计算机上网的时间段或者累计的上网时长"), 0, 0, 1, 1);
layoutCfg->addWidget(CreateCfgItem(":/img/100/kidprotect/website.png", "网站内容控制", "限制计算机访问特定类型网站"), 0, 1, 1, 1);
layoutCfg->addWidget(CreateCfgItem(":/img/100/kidprotect/program.png", "程序执行控制", "限制指定应用程序的执行"), 1, 0, 1, 1);
layoutCfg->addWidget(CreateCfgItem(":/img/100/kidprotect/udisk.png", "U盘使用控制", "限制未信任的U盘接入计算机"), 1, 1, 1, 1);
QVBoxLayout *layoutMain = new QVBoxLayout(this);
layoutMain->addLayout(layoutTop);
layoutMain->addWidget(CreateSeparator());
layoutMain->addLayout(layoutCfg);
layoutMain->addStretch(1);
layoutMain->setContentsMargins(40, 30, 40, 30);
layoutMain->setSpacing(20);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。