mirror of
https://gitee.com/drabel/LibQQt.git
synced 2025-01-04 10:18:44 +08:00
update qqt authority function and fix macOS work root
This commit is contained in:
parent
4e5274a44c
commit
340064959b
BIN
screenshot/6.png
Normal file
BIN
screenshot/6.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 523 KiB |
BIN
screenshot/7.png
Normal file
BIN
screenshot/7.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 212 KiB |
@ -44,7 +44,7 @@ defineReplace(copy_config) {
|
||||
#如果 TARGET 没有配置 APP_CONFIG_PWD 那么返回,不拷贝任何配置
|
||||
#qmake 或逻辑为 | 或者 ||
|
||||
isEmpty(APP_CONFIG_PWD)|isEmpty(APP_DEPLOY_PWD) {
|
||||
message("$${TARGET} hasn't deploied any cofig files")
|
||||
message("$${TARGET} hasn't deploied any config files")
|
||||
greaterThan(QT_MAJOR_VERSION, 5):return()
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ isEmpty(APP_CONFIG_PWD)|isEmpty(APP_DEPLOY_PWD) {
|
||||
##qmake 与逻辑为 :
|
||||
!isEmpty(APP_CONFIG_PWD):!isEmpty(APP_DEPLOY_PWD) {
|
||||
CONFIG += app_copy_config
|
||||
message("$${TARGET} has deploied some cofig files")
|
||||
message("$${TARGET} has deploied some config files")
|
||||
}
|
||||
|
||||
contains(CONFIG, app_copy_config) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <qqtmsgbox.h>
|
||||
#include <qqtcore.h>
|
||||
#include <qqtframe.h>
|
||||
#include <qqtversion.h>
|
||||
#include <QFile>
|
||||
#include <QTextCodec>
|
||||
#include <QSettings>
|
||||
@ -38,9 +39,14 @@ QQtApplication::QQtApplication ( int& argc, char** argv ) :
|
||||
QSettings::setPath ( QSettings::IniFormat, QSettings::UserScope, CONFIG_PATH );
|
||||
QSettings::setPath ( QSettings::IniFormat, QSettings::SystemScope, CONFIG_PATH );
|
||||
|
||||
#ifdef __DARWIN__
|
||||
QDir::setCurrent ( qApp->applicationDirPath() );
|
||||
#endif
|
||||
|
||||
pline() << "app root:" << qApp->applicationDirPath();
|
||||
pline() << "app work root:" << QDir::currentPath();
|
||||
pline() << "Qt version:" << QT_VERSION_STR;
|
||||
pline() << "LibQQt version:" << STR ( QQT_VERSION );
|
||||
|
||||
#ifdef __EMBEDDED_LINUX__
|
||||
pline() << "QTDIR:" << QProcessEnvironment::systemEnvironment().value ( "QTDIR" );
|
||||
|
@ -1,10 +1,17 @@
|
||||
#include "qqtframe.h"
|
||||
#include <QDir>
|
||||
|
||||
QSqlDatabase managerDB;
|
||||
QString gUserName;
|
||||
QString gPassword;
|
||||
QString gAuthority;
|
||||
int gAuthority;
|
||||
|
||||
bool hasAuthority ( int authId )
|
||||
{
|
||||
if ( authId < gAuthority )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void QQtFrameMsgHandler ( QtMsgType type, const char* msg )
|
||||
{
|
||||
|
@ -15,6 +15,8 @@
|
||||
#include <QDebug>
|
||||
#include <QSqlDatabase>
|
||||
#include <QSqlError>
|
||||
#include <QDir>
|
||||
#include <qqt-local.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -46,6 +48,14 @@ enum
|
||||
Authority_Level,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
Auth_Admin = 0,
|
||||
Auth_Manager,
|
||||
Auth_User,
|
||||
Auth_Max
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
Method_Id = 0,
|
||||
@ -164,7 +174,7 @@ enum
|
||||
extern QSqlDatabase managerDB;
|
||||
extern QString gUserName;
|
||||
extern QString gPassword;
|
||||
extern QString gAuthority;
|
||||
extern int gAuthority;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -176,4 +186,7 @@ void QQt4FrameMsgHandler ( QtMsgType type, const char* msg );
|
||||
void QQt5FrameMsgHandler ( QtMsgType type, const QMessageLogContext& context, const QString& content );
|
||||
#endif
|
||||
|
||||
/*当前登陆用户 是否具有 函数要求的权限*/
|
||||
bool hasAuthority ( int authId = Auth_Admin );
|
||||
|
||||
#endif // QQTFRAMEDEFINE_H
|
||||
|
@ -1,2 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
curpath=$(pwd)
|
||||
#qmake syntax error, so do this
|
||||
curpath=$(pwd)
|
||||
|
@ -71,9 +71,9 @@ defineReplace(copy_qqt_on_mac) {
|
||||
################################################
|
||||
#TARGET must be equals to pro name ? no, TARGET must be placeed before qqt_library.pri
|
||||
#qmake pro pri is sequential
|
||||
message(Link QQt to $${TARGET} $${QKIT_PRIVATE} \
|
||||
at $${QT_VERSION} $${SYSNAME} $${BUILD} \
|
||||
on $${QMAKE_HOST.os})
|
||||
message(Build $${TARGET} at $${OUT_PWD}/$${QKIT_STD_DIR})
|
||||
message(Link QQt to $${TARGET} [QKIT=$${QKIT_PRIVATE}] \
|
||||
at [QKIT STD DIR=$${QKIT_STD_DIR}] on [Operating System=$${QMAKE_HOST.os}])
|
||||
|
||||
#-------module name QQt
|
||||
MODULE_NAME=QQt
|
||||
|
@ -51,5 +51,5 @@ QQT_VERSION2 = $$get_version_string_2( $${QQT_MAJOR_VERSION}, $${QQT_MINOR_VERSI
|
||||
QQT_VERSION3 = $$get_version_string_3( $${QQT_MAJOR_VERSION}, $${QQT_MINOR_VERSION}, $${QQT_PATCH_VERSION} )
|
||||
QQT_VERSION4 = $$get_version_string_4( $${QQT_MAJOR_VERSION}, $${QQT_MINOR_VERSION}, $${QQT_PATCH_VERSION}, $${QQT_BUILD_VERSION} )
|
||||
QQT_VERSION = $${QQT_VERSION3}
|
||||
|
||||
DEFINES += QQT_VERSION=$${QQT_VERSION}
|
||||
message (Build QQt version: $$QQT_VERSION4)
|
||||
|
7
usage.md
7
usage.md
@ -13,5 +13,12 @@ QQT_BUILD_ROOT = /Users/abel/Develop/c0-buildstation
|
||||
QQT_SDK_ROOT = /Users/abel/Develop/d1-product
|
||||
APP_DEPLOY_ROOT = /Users/abel/Develop/d1-product
|
||||
|
||||
![设置成功显示](screenshot/6.png)
|
||||
如果设置成功,qmake应当显示如上例程的样子
|
||||
|
||||
#V2.1.6更新链接QQt的方法
|
||||
![链接QQt](screenshot/7.png "这是链接QQt的方法,pri都在LibQQt目录里")
|
||||
|
||||
|
||||
|
||||
[返回](.)
|
||||
|
Loading…
x
Reference in New Issue
Block a user