208 lines
5.4 KiB
C++
208 lines
5.4 KiB
C++
#include "setcontrolstyle.h"
|
|
|
|
SetControlStyle::SetControlStyle(QObject *parent) : QObject(parent)
|
|
{
|
|
m_uiName.clear();
|
|
}
|
|
|
|
void SetControlStyle::setUiName(QString uiName)
|
|
{
|
|
m_uiName = uiName;
|
|
}
|
|
|
|
QString SetControlStyle::getStyleSheet(QString controlName)
|
|
{
|
|
//样式表格式 <分辨率><主题><窗体名称><图片名称>
|
|
//例如图片路径 :/images/MainWidget/ButtonConnect_logo.png
|
|
QString style;
|
|
style = "background-color: rgba(245, 245, 245, 0);color: rgb(255, 255, 255);border:0px;border-image:url(:/images/";
|
|
|
|
style += m_uiName + "/";
|
|
style += controlName + "_logo.png);";
|
|
|
|
return style;
|
|
}
|
|
|
|
QString SetControlStyle::getStyleSheet1(QString controlName)
|
|
{
|
|
//样式表格式 <分辨率><主题><窗体名称><图片名称>
|
|
//例如图片路径 :/images/1920x1080/theme1/EmbMainWidget/ButtonConnect_logo.png
|
|
QString style;
|
|
style = "background-color: rgba(245, 245, 245, 0);color: rgb(255, 255, 255);border:0px;border-image:url(:/images/";
|
|
|
|
//分辨率
|
|
QString str;
|
|
str.clear();
|
|
switch (g_emResolut)
|
|
{
|
|
case resolution1910:
|
|
str = "_1910";
|
|
break;
|
|
case resolution1006:
|
|
str = "_1006";
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
style += m_uiName + "/";
|
|
style += controlName + str + "_logo.png);";
|
|
|
|
return style;
|
|
}
|
|
|
|
QString SetControlStyle::getBorderImageStyleSheet(QString controlName)
|
|
{
|
|
//样式表格式 <分辨率><主题><窗体名称><图片名称>
|
|
//例如图片路径 :/images/1920x1080/theme1/EmbMainWidget/ButtonConnect_logo.png
|
|
QString style;
|
|
style = "background-color: rgba(245, 245, 245, 0);color: rgb(255, 255, 255);border:0px;border-image:url(:/images/";
|
|
|
|
//分辨率
|
|
QString str;
|
|
str.clear();
|
|
switch (g_emResolut)
|
|
{
|
|
case resolution1910:
|
|
str = "_1910";
|
|
break;
|
|
case resolution1006:
|
|
str = "_1006";
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
style += m_uiName + "/";
|
|
style += controlName + str + "_logo.png);";
|
|
|
|
return style;
|
|
}
|
|
|
|
QString SetControlStyle::getTopStyleSheet(QString controlName)
|
|
{
|
|
//样式表格式 <分辨率><主题><窗体名称><图片名称>
|
|
//例如 :/images/1920x1080/theme1/EmbMainWidget/buttonPatternSet_logo
|
|
QString style = ":/images/";
|
|
|
|
style += m_uiName + "/";
|
|
style += controlName + "_logo.png";
|
|
|
|
return style;
|
|
}
|
|
|
|
QString SetControlStyle::getBottomStyleSheet(QString parentName)
|
|
{
|
|
//样式表格式 <分辨率><主题><窗体名称><图片前缀>
|
|
//例如 :/images/EmbMainWidget/frameMainFunction
|
|
QString style = ":/images/";
|
|
|
|
style += m_uiName + "/";
|
|
style += parentName;
|
|
|
|
return style;
|
|
}
|
|
|
|
QString SetControlStyle::getBottomStyleSheet1(QString parentName)
|
|
{
|
|
//样式表格式 <分辨率><主题><窗体名称><图片前缀>
|
|
//例如 :/images/EmbMainWidget/frameMainFunction
|
|
QString style = ":/images/";
|
|
|
|
QString str;
|
|
str.clear();
|
|
|
|
switch (g_emResolut)
|
|
{
|
|
case resolution1910:
|
|
str = "1910_";
|
|
break;
|
|
case resolution1006:
|
|
str = "1006_";
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
style += m_uiName +"/" + str;
|
|
style += parentName;
|
|
|
|
return style;
|
|
}
|
|
|
|
QString SetControlStyle::getBtnStyleSheet(QString iconName)
|
|
{
|
|
QString path = ":/images/";
|
|
|
|
path += m_uiName + "/";
|
|
path += iconName;
|
|
|
|
QString style = "QPushButton{"+QString(LABELNAVYBLUESTYLE)+"border-image: url(" + path + "_p0.png" + ");border:0px;}";
|
|
style += "QPushButton:pressed{border-image: url(" + path + "_p1.png" + ");}";
|
|
style += "QPushButton:disabled{border-image: url(" + path + "_p2.png" + ");}";
|
|
|
|
return style;
|
|
}
|
|
|
|
QString SetControlStyle::getSharedStyleSheet()
|
|
{
|
|
//样式表格式 <分辨率><主题><窗体名称><图片名称>
|
|
//例如图片路径 :/images/1920x1080/theme1/EmbMainWidget/ButtonConnect_logo.png
|
|
QString style;
|
|
style = "background-color: rgba(245, 245, 245, 0);color: rgb(255, 255, 255);border:0px;border-image:url(:/images/";
|
|
|
|
//分辨率
|
|
QString str;
|
|
str.clear();
|
|
switch (g_emResolut)
|
|
{
|
|
case resolution1910:
|
|
str = "_1910";
|
|
break;
|
|
case resolution1006:
|
|
str = "_1006";
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
style += "SharedIcon/WidgetFrameBack"+ str +"_logo.png);";
|
|
|
|
return style;
|
|
}
|
|
|
|
QString SetControlStyle::getSharedTopStyleSheet(QString controlName)
|
|
{
|
|
//样式表格式 <分辨率><主题><窗体名称><图片名称>
|
|
//例如 :/images/1920x1080/theme1/EmbMainWidget/buttonPatternSet_logo
|
|
QString style = ":/images/";
|
|
style += "SharedIcon/";
|
|
style += controlName + "_logo.png";
|
|
|
|
return style;
|
|
}
|
|
|
|
QString SetControlStyle::getSharedBottomStyleSheet(QString parentName)
|
|
{
|
|
//样式表格式 <分辨率><主题><窗体名称><图片前缀>
|
|
//例如 :/images/1920x1080/theme1/EmbMainWidget/frameMainFunction
|
|
QString style = ":/images/";
|
|
style += "SharedIcon/";
|
|
style += parentName;
|
|
|
|
return style;
|
|
}
|
|
|
|
QString SetControlStyle::getSharedBtnStyleSheet(QString iconName)
|
|
{
|
|
QString path = ":/images/";
|
|
path += "SharedIcon/";
|
|
path += iconName;
|
|
|
|
QString style = "QPushButton{"+QString(LABELNAVYBLUESTYLE)+"border-image: url(" + path + "_p0.png" + ");border:0px;}";
|
|
style += "QPushButton:pressed{border-image: url(" + path + "_p1.png" + ");}";
|
|
style += "QPushButton:disabled{border-image: url(" + path + "_p2.png" + ");}";
|
|
|
|
return style;
|
|
}
|