1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/curriculum-design-express_station_system_gui

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
help.h 1.6 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
怎样 Отправлено 02.01.2020 06:38 ff82641
#pragma once
#include <QMessageBox>
#include <QWidget>
#include <QString>
#include <string>
#include "date.h"
#include <QDateTime>
#include <QPalette>
#include <QPixmap>
#include <QLabel>
using namespace std;
class help
{
public:
static void msgbox(QWidget* w,QString title,QString content)
{
QMessageBox::information(w,title,content,QMessageBox::Ok);
}
static QString toQStr(string str) { return QString::fromStdString(str); }
static date refreshTime()
{
QDateTime local(QDateTime::currentDateTime());
QString year=local.toString("yyyy");
QString month=local.toString("MM");
QString day=local.toString("dd");
QString hour=local.toString("hh");
QString minute=local.toString("mm");
return date(year.toInt(),month.toInt(),day.toInt(),hour.toInt(),minute.toInt());
}
static void setBackground(QWidget *w,QString path)
{
QPalette pal=w->palette();
QPixmap pix=QPixmap(path);
pix=pix.scaled(QSize(358,600),Qt::KeepAspectRatio);
pal.setBrush(QPalette::Background,QBrush(pix));
w->setPalette(pal);
}
static void setBackground(QWidget *w,QColor c)
{
QPalette pal=w->palette();
pal.setBrush(QPalette::Background,c);
w->setPalette(pal);
}
static void setLabelBackground(QLabel *l, QColor bg,QColor text)
{
QPalette palette_2;
palette_2.setColor(QPalette::Background,bg);
palette_2.setColor(QPalette::WindowText,text);
l->setAutoFillBackground(true);
l->setPalette(palette_2);
}
};

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/curriculum-design-express_station_system_gui.git
git@api.gitlife.ru:oschina-mirror/curriculum-design-express_station_system_gui.git
oschina-mirror
curriculum-design-express_station_system_gui
curriculum-design-express_station_system_gui
master