6#include <QtCore/qdebug.h>
11#if __has_include(<appmodel.h>)
18QComHelper::QComHelper(COINIT concurrencyModel)
21 concurrencyModel = COINIT(concurrencyModel | COINIT_DISABLE_OLE1DDE);
23 m_initResult = CoInitializeEx(
nullptr, concurrencyModel);
25 if (FAILED(m_initResult))
26 qErrnoWarning(m_initResult,
"Failed to initialize COM library");
29QComHelper::~QComHelper()
31 if (SUCCEEDED(m_initResult))
46#if defined(HAS_APPMODEL)
47 static const bool hasPackageIdentity = []() {
49 switch (
const auto result = GetCurrentPackageFullName(&
length,
nullptr)) {
50 case ERROR_INSUFFICIENT_BUFFER:
52 case APPMODEL_ERROR_NO_PACKAGE:
55 qWarning(
"Failed to resolve package identity (error code %ld)",
result);
59 return hasPackageIdentity;
void qErrnoWarning(const char *msg,...)
Combined button and popup list for selecting options.
bool qt_win_hasPackageIdentity()
GLenum GLuint GLenum GLsizei length