From 539b399021c550e8364488fbbc6adda8277d382c Mon Sep 17 00:00:00 2001 From: YueBiang Date: Sat, 27 Mar 2021 16:39:47 +0800 Subject: [PATCH] move impl of InitLabelText from header file to cpp --- frameworks/components/ui_label.cpp | 7 +++++++ interfaces/kits/components/ui_label.h | 7 +------ tools/qt/simulator/libui/libui.pro | 6 +++++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/frameworks/components/ui_label.cpp b/frameworks/components/ui_label.cpp index 6d7c417..da4a65a 100644 --- a/frameworks/components/ui_label.cpp +++ b/frameworks/components/ui_label.cpp @@ -139,6 +139,13 @@ UILabel::~UILabel() } } +void UILabel::InitLabelText() +{ + if (labelText_ == nullptr) { + labelText_ = new Text(); + } +} + int16_t UILabel::GetWidth() { InitLabelText(); diff --git a/interfaces/kits/components/ui_label.h b/interfaces/kits/components/ui_label.h index 66d64bb..be12f18 100755 --- a/interfaces/kits/components/ui_label.h +++ b/interfaces/kits/components/ui_label.h @@ -409,12 +409,7 @@ protected: Text* labelText_; void RefreshLabel(); - virtual void InitLabelText() - { - if (labelText_ == nullptr) { - labelText_ = new Text(); - } - } + virtual void InitLabelText(); private: friend class LabelAnimator; diff --git a/tools/qt/simulator/libui/libui.pro b/tools/qt/simulator/libui/libui.pro index 16429fd..530cab6 100644 --- a/tools/qt/simulator/libui/libui.pro +++ b/tools/qt/simulator/libui/libui.pro @@ -9,7 +9,11 @@ CONFIG += c++11 # any Qt feature that has been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS +DEFINES += QT_DEPRECATED_WARNINGS \ + "ENABLE_SHAPING=0" \ + "ENABLE_ICU=0" \ + "ENABLE_VECTOR_FONT=1" \ + "ENABLE_BITMAP_FONT=0" DEFINES += QT_COMPILER -- GitLab