1 Star 0 Fork 1

rykren/HotelPlatformClient

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
globalvars.cpp 2.86 KB
一键复制 编辑 原始数据 按行查看 历史
Orange_Kang 提交于 2019-09-01 11:54 . 商家端:
#include "globalvars.h"
#include <QBitmap>
#include <QPainter>
ConfigOperate GlobalVars::g_localConfig;
int GlobalVars::count = 0;///酒店符合条件的记录个数
SaveInfo GlobalVars::g_localSave;
UserInfo GlobalVars::g_localUser;
HotelInfo GlobalVars::g_localHotel;
HouseInfo GlobalVars::g_localHouse;
ReserveInfo GlobalVars::g_localReserve;
CommentInfo GlobalVars::g_localComment;
ImageList GlobalVars::g_hotelImageList;
ImageList GlobalVars::g_houseImageList;
UserInfoList* GlobalVars::g_userInfoList = new UserInfoList();
ReserveInfoList* GlobalVars::g_reserveInfoList = new ReserveInfoList();
CommentInfoList* GlobalVars::g_commentInfoList = new CommentInfoList();
HotelInfoList* GlobalVars::g_hotelManageList = new HotelInfoList();
HotelInfoMap GlobalVars::g_hotelManageMap;
QMap<QString,QString> GlobalVars::g_serverStyleSheet;
ImageListMap GlobalVars::g_commentImageListMap;
QQueue<QString> GlobalVars::g_msgQueue;
QQueue<ImageMsgMap> GlobalVars::g_ImageMsgQueue;
QVector<QString> GlobalVars::week(7,"");
GlobalVars::GlobalVars()
{
}
void GlobalVars::setWeek(QVector<QString> weekVec)
{
week = weekVec;
}
void GlobalVars::setWeek(QStringList weekList)
{
for (int i = 0; i < weekList.size(); i++)
{
week[i] = weekList.at(i);
}
}
void GlobalVars::setHotelServerStyleSheetMap()
{
g_serverStyleSheet.insert("免费停车", "border-image: url(:/images/littleIcon/park.png);");
g_serverStyleSheet.insert("收费停车", "border-image: url(:/images/littleIcon/park.png);");
g_serverStyleSheet.insert("接送服务", "border-image: url(:/images/littleIcon/transfer.png);");
g_serverStyleSheet.insert("热水洗浴", "border-image: url(:/images/littleIcon/bath.png);");
g_serverStyleSheet.insert("电吹风", "border-image: url(:/images/littleIcon/electricHairDrier.png);");
g_serverStyleSheet.insert("温泉", "border-image: url(:/images/littleIcon/hotSpring.png);");
g_serverStyleSheet.insert("有线上网", "border-image: url(:/images/littleIcon/network.png);");
g_serverStyleSheet.insert("无线上网", "border-image: url(:/images/littleIcon/wifi.png);");
g_serverStyleSheet.insert("行李寄存", "border-image: url(:/images/littleIcon/baggage.png);");
g_serverStyleSheet.insert("餐厅", "border-image: url(:/images/littleIcon/diningHall.png);");
}
QPixmap GlobalVars::PixmapToRound(const QPixmap &src, int radius)
{
if (src.isNull()) {
return QPixmap();
}
QSize size(2*radius, 2*radius);
QBitmap mask(size);
QPainter painter(&mask);
painter.setRenderHint(QPainter::Antialiasing);
painter.setRenderHint(QPainter::SmoothPixmapTransform);
painter.fillRect(0, 0, size.width(), size.height(), Qt::white);
painter.setBrush(QColor(0, 0, 0));
painter.drawRoundedRect(0, 0, size.width(), size.height(), 99, 99);
QPixmap image = src.scaled(size);
image.setMask(mask);
return image;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/rykren/HotelPlatformClient.git
git@gitee.com:rykren/HotelPlatformClient.git
rykren
HotelPlatformClient
HotelPlatformClient
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385