更新代码
This commit is contained in:
@@ -2533,16 +2533,24 @@ void QUIHelper::runWithSystem(const QString &strName, const QString &strPath, bo
|
||||
#endif
|
||||
}
|
||||
|
||||
QString QUIHelper::getIP(const QString &url)
|
||||
{
|
||||
//取出IP地址
|
||||
QRegExp regExp("((?:(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d))");
|
||||
regExp.indexIn(url);
|
||||
return url.mid(url.indexOf(regExp), regExp.matchedLength());
|
||||
}
|
||||
|
||||
bool QUIHelper::isIP(const QString &ip)
|
||||
{
|
||||
QRegExp RegExp("((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)");
|
||||
return RegExp.exactMatch(ip);
|
||||
QRegExp regExp("((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)");
|
||||
return regExp.exactMatch(ip);
|
||||
}
|
||||
|
||||
bool QUIHelper::isMac(const QString &mac)
|
||||
{
|
||||
QRegExp RegExp("^[A-F0-9]{2}(-[A-F0-9]{2}){5}$");
|
||||
return RegExp.exactMatch(mac);
|
||||
QRegExp regExp("^[A-F0-9]{2}(-[A-F0-9]{2}){5}$");
|
||||
return regExp.exactMatch(mac);
|
||||
}
|
||||
|
||||
bool QUIHelper::isTel(const QString &tel)
|
||||
@@ -3503,6 +3511,10 @@ bool QUIHelper::isWebOk()
|
||||
|
||||
void QUIHelper::initTableView(QTableView *tableView, int rowHeight, bool headVisible, bool edit)
|
||||
{
|
||||
//取消自动换行
|
||||
tableView->setWordWrap(false);
|
||||
//超出文本不显示省略号
|
||||
tableView->setTextElideMode(Qt::ElideNone);
|
||||
//奇数偶数行颜色交替
|
||||
tableView->setAlternatingRowColors(false);
|
||||
//垂直表头是否可见
|
||||
|
||||
@@ -642,6 +642,8 @@ public:
|
||||
//设置开机自启动
|
||||
static void runWithSystem(const QString &strName, const QString &strPath, bool autoRun = true);
|
||||
|
||||
//从字符串获取IP地址
|
||||
static QString getIP(const QString &url);
|
||||
//判断是否是IP地址
|
||||
static bool isIP(const QString &ip);
|
||||
//判断是否是MAC地址
|
||||
@@ -651,7 +653,6 @@ public:
|
||||
//判断是否是合法的邮箱地址
|
||||
static bool isEmail(const QString &email);
|
||||
|
||||
|
||||
//16进制字符串转10进制
|
||||
static int strHexToDecimal(const QString &strHex);
|
||||
//10进制字符串转10进制
|
||||
|
||||
Reference in New Issue
Block a user