#include "BitMaps.h" BitMaps::BitMaps(QObject *parent) : QObject(parent) { RemUI_SwitchStyles << ":/Icos/Icos/LED1_Grey.png" << ":/Icos/Icos/LED1_Green.png" << ":/Icos/Icos/LED1_Rad.png"; RemUI_PutterStyles << ":/Icos/Icos/Arrow_Stop.png" << ":/Icos/Icos/Arrow_Push.png" << ":/Icos/Icos/Arrow_Pull.png"; RemUI_ModeStyles << "" << ":/Icos/Icos/arrow1.png" << ":/Icos/Icos/arrow2.png" << ":/Icos/Icos/arrow3.png"; RemUI_SpeedStyles << "" << ":/Icos/Icos/Arrow_Low.png" << ":/Icos/Icos/Arrow_High.png"; } /** * @brief ListChoice_2Mode 从List里面 根据b1和b2的状态,选取一个子进行返回 * b1 且 !b2 则 返回 子1 * !b1 且 b2 则 返回 子2 * 否则 则返回 子0 (如果inNull为真,则返回空字符串) * @param List 欲选取的字符串序列 * @param b1 控制变量1, * @param b2 控制变量2 * @param isNull 是否在b1 b2 不满足条件的情况下,返回空 * @return 返回选中的子字符串 */ QString BitMaps::ListChoice_2Mode(const QStringList List, const bool b1,const bool b2,const bool isNull){ if(b1 && !b2) return List[1]; else if(!b1 && b2) return List[2]; else return isNull ? "" : List[0]; } /** * @brief ListChoice_2Mode 从List里面 根据b1和b2的状态,选取一个子进行返回 * b1 且 !b2 且 !b3 则 返回 子1 * !b1 且 b2 且 !b3 则 返回 子2 * !b1 且 !b2 且 b3 则 返回 子3 * 否则 则返回 子0 (如果inNull为真,则返回空字符串) * @param List 欲选取的字符串序列 * @param b1 控制变量1, * @param b2 控制变量2 * @param b3 控制变量3 * @param isNull 是否在b1 b2 b3 不满足条件的情况下,返回空 * @return 返回选中的子字符串 */ QString BitMaps::ListChoice_3Mode(const QStringList List, const bool b1,const bool b2,const bool b3,const bool isNull){ if(b1 && !b2 && !b3) return List[1]; else if(!b1 && b2 && !b3) return List[2]; else if(!b1 && !b2 && b3) return List[3]; else return isNull ? "" : List[0]; }