mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-26 13:27:05 +08:00
update
This commit is contained in:
parent
28a42d7ecc
commit
3a0f6355c8
@ -27,7 +27,6 @@ FluScrollablePage{
|
||||
id: bg
|
||||
fillMode:Image.PreserveAspectCrop
|
||||
anchors.fill: parent
|
||||
asynchronous: true
|
||||
verticalAlignment: Qt.AlignTop
|
||||
sourceSize: Qt.size(960,640)
|
||||
source: "qrc:/example/res/image/bg_home_header.png"
|
||||
|
@ -27,7 +27,6 @@ FluScrollablePage{
|
||||
id: bg
|
||||
fillMode:Image.PreserveAspectCrop
|
||||
anchors.fill: parent
|
||||
asynchronous: true
|
||||
verticalAlignment: Qt.AlignTop
|
||||
sourceSize: Qt.size(960,640)
|
||||
source: "qrc:/example/res/image/bg_home_header.png"
|
||||
|
@ -26,6 +26,9 @@ Q_IMPORT_QML_PLUGIN(FluentUIPlugin)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
qputenv("QT_QUICK_CONTROLS_STYLE","Basic");
|
||||
#ifdef Q_OS_WIN
|
||||
qputenv("QT_QPA_PLATFORM","windows:darkmode=2");
|
||||
#endif
|
||||
#ifdef Q_OS_LINUX
|
||||
//fix bug UOSv20 does not print logs
|
||||
qputenv("QT_LOGGING_RULES","");
|
||||
@ -35,6 +38,7 @@ int main(int argc, char *argv[])
|
||||
QGuiApplication::setOrganizationName("ZhuZiChu");
|
||||
QGuiApplication::setOrganizationDomain("https://zhuzichu520.github.io");
|
||||
QGuiApplication::setApplicationName("FluentUI");
|
||||
QGuiApplication::setApplicationDisplayName("FluentUI Exmaple");
|
||||
QGuiApplication::setApplicationVersion(APPLICATION_VERSION);
|
||||
SettingsHelper::getInstance()->init(argv);
|
||||
Log::setup("example");
|
||||
|
@ -2,43 +2,30 @@
|
||||
#define SINGLETON_H
|
||||
|
||||
#include <QMutex>
|
||||
#include <QScopedPointer>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
|
||||
template <typename T>
|
||||
class Singleton {
|
||||
public:
|
||||
static T* getInstance();
|
||||
|
||||
Singleton(const Singleton& other) = delete;
|
||||
Singleton<T>& operator=(const Singleton& other) = delete;
|
||||
|
||||
private:
|
||||
static std::mutex mutex;
|
||||
static T* instance;
|
||||
Q_DISABLE_COPY_MOVE(Singleton)
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
std::mutex Singleton<T>::mutex;
|
||||
template <typename T>
|
||||
T* Singleton<T>::instance;
|
||||
template <typename T>
|
||||
T* Singleton<T>::getInstance() {
|
||||
if (instance == nullptr) {
|
||||
std::lock_guard<std::mutex> locker(mutex);
|
||||
static QMutex mutex;
|
||||
QMutexLocker locker(&mutex);
|
||||
static T* instance = nullptr;
|
||||
if (instance == nullptr) {
|
||||
instance = new T();
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
#define SINGLETON(Class) \
|
||||
private: \
|
||||
friend class Singleton<Class>; \
|
||||
friend struct QScopedPointerDeleter<Class>; \
|
||||
\
|
||||
public: \
|
||||
static Class* getInstance() { \
|
||||
return Singleton<Class>::getInstance(); \
|
||||
@ -48,6 +35,6 @@ private: \
|
||||
private: \
|
||||
Class() = default; \
|
||||
Class(const Class& other) = delete; \
|
||||
Class& operator=(const Class& other) = delete;
|
||||
Q_DISABLE_COPY_MOVE(Class);
|
||||
|
||||
#endif // SINGLETON_H
|
||||
|
@ -102,6 +102,7 @@ T.ComboBox {
|
||||
height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin)
|
||||
topMargin: 6
|
||||
bottomMargin: 6
|
||||
modal: true
|
||||
contentItem: ListView {
|
||||
clip: true
|
||||
implicitHeight: contentHeight
|
||||
|
@ -102,6 +102,7 @@ T.ComboBox {
|
||||
height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin)
|
||||
topMargin: 6
|
||||
bottomMargin: 6
|
||||
modal: true
|
||||
contentItem: ListView {
|
||||
clip: true
|
||||
implicitHeight: contentHeight
|
||||
|
@ -26,7 +26,6 @@ T* Singleton<T>::getInstance() {
|
||||
#define SINGLETON(Class) \
|
||||
private: \
|
||||
friend class Singleton<Class>; \
|
||||
\
|
||||
public: \
|
||||
static Class* getInstance() { \
|
||||
return Singleton<Class>::getInstance(); \
|
||||
|
Loading…
Reference in New Issue
Block a user