Changeset View
Changeset View
Standalone View
Standalone View
qt5/style/qtcurve_plugin.cpp
Show First 20 Lines • Show All 159 Lines • ▼ Show 20 Line(s) | |||||
160 | { | 160 | { | ||
161 | init(); | 161 | init(); | ||
162 | return key.toLower() == "qtcurve" ? new Style : nullptr; | 162 | return key.toLower() == "qtcurve" ? new Style : nullptr; | ||
163 | } | 163 | } | ||
164 | 164 | | |||
165 | StylePlugin::~StylePlugin() | 165 | StylePlugin::~StylePlugin() | ||
166 | { | 166 | { | ||
167 | runAllCleanups(); | 167 | runAllCleanups(); | ||
168 | if (m_eventNotifyCallbackInstalled) { | ||||
168 | QInternal::unregisterCallback(QInternal::EventNotifyCallback, | 169 | QInternal::unregisterCallback(QInternal::EventNotifyCallback, | ||
169 | qtcEventCallback); | 170 | qtcEventCallback); | ||
170 | } | 171 | } | ||
172 | } | ||||
171 | 173 | | |||
172 | void | 174 | void | ||
173 | StylePlugin::init() | 175 | StylePlugin::init() | ||
174 | { | 176 | { | ||
175 | std::call_once(m_ref_flag, [] { | 177 | std::call_once(m_ref_flag, [this] { | ||
176 | QInternal::registerCallback(QInternal::EventNotifyCallback, | 178 | QInternal::registerCallback(QInternal::EventNotifyCallback, | ||
177 | qtcEventCallback); | 179 | qtcEventCallback); | ||
180 | m_eventNotifyCallbackInstalled = true; | ||||
178 | #ifdef QTC_QT5_ENABLE_QTQUICK2 | 181 | #ifdef QTC_QT5_ENABLE_QTQUICK2 | ||
179 | QQuickWindow::setDefaultAlphaBuffer(true); | 182 | QQuickWindow::setDefaultAlphaBuffer(true); | ||
180 | #endif | 183 | #endif | ||
181 | #ifdef Qt5X11Extras_FOUND | 184 | #ifdef Qt5X11Extras_FOUND | ||
182 | if (qApp->platformName() == "xcb") { | 185 | if (qApp->platformName() == "xcb") { | ||
183 | qtcX11InitXcb(QX11Info::connection(), QX11Info::appScreen()); | 186 | qtcX11InitXcb(QX11Info::connection(), QX11Info::appScreen()); | ||
184 | } | 187 | } | ||
185 | #endif | 188 | #endif | ||
186 | }); | 189 | }); | ||
187 | } | 190 | } | ||
188 | 191 | | |||
189 | } | 192 | } |