AndroidStyle: use std::make_shared()
More efficient, because control block and tracked object are co-located in a single memory allocation. Change-Id: Id18e2d06db43568eb34c2e2d129d1b116af73acb Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
parent
f2fbee5134
commit
14d189f787
@ -218,7 +218,7 @@ QJsonObject AndroidStyle::loadStyleData()
|
||||
static std::shared_ptr<AndroidStyle> loadAndroidStyle(QPalette *defaultPalette)
|
||||
{
|
||||
double pixelDensity = qEnvironmentVariableIsSet("QT_AUTO_SCREEN_SCALE_FACTOR") ? QtAndroid::pixelDensity() : 1.0;
|
||||
std::shared_ptr<AndroidStyle> style(new AndroidStyle);
|
||||
std::shared_ptr<AndroidStyle> style = std::make_shared<AndroidStyle>();
|
||||
style->m_styleData = AndroidStyle::loadStyleData();
|
||||
if (style->m_styleData.isEmpty())
|
||||
return std::shared_ptr<AndroidStyle>();
|
||||
|
Loading…
Reference in New Issue
Block a user