1.定义初始化为false的bool类型、2.qtrelease版本发布时,提示:could not find or load the Qt platform plugin "window"

来源:互联网 发布:java 文件读取 编辑:程序博客网 时间:2024/06/08 07:01

1.定义初始化为false的bool类型

class lds_bool{

public:
    lds_bool(bool value):b(value){}
    inline lds_bool operator=(bool other){b = other;return *this;}
    inline operator const void *() const
    { return b ? static_cast<const void *>(this) : static_cast<const void *>(0); }
protected:
    bool b;
};
class lds_bool_default_true : public lds_bool
{
public:
    inline lds_bool_default_true():lds_bool(true){}
    inline lds_bool_default_true operator=(bool other){b = other;return *this;}
};
class lds_bool_default_false : public lds_bool
{
public:
    inline lds_bool_default_false():lds_bool(false){}
    inline lds_bool_default_false operator=(bool other){b = other;return *this;}
};
2.qtrelease版本发布时,提示:could not find or load the Qt platform plugin "window"
2.1 静态函数,添加数据库对象时会有这种情况
如:static public_sql::sql_db = QSqlDatabase::addDatabase("QMYSQL");
2.2 静态函数,添加qApp路径时会有
如:static public_sql:path = qApp->applicationPath();
0 0