Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qwindowsmimeconverter.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
6#include <QtCore/qt_windows.h>
7
8#include <QtGui/private/qguiapplication_p.h>
9#include <QtGui/qpa/qplatformintegration.h>
10
12
117{
119 auto nativeWindowsApp = dynamic_cast<QWindowsApplication *>(QGuiApplicationPrivate::platformIntegration());
120 Q_ASSERT(nativeWindowsApp);
121 nativeWindowsApp->registerMime(this);
122}
123
130{
132 auto nativeWindowsApp = dynamic_cast<QWindowsApplication *>(QGuiApplicationPrivate::platformIntegration());
133 Q_ASSERT(nativeWindowsApp);
134 nativeWindowsApp->unregisterMime(this);
135}
136
145{
147 auto nativeWindowsApp = dynamic_cast<QWindowsApplication *>(QGuiApplicationPrivate::platformIntegration());
148 Q_ASSERT(nativeWindowsApp);
149 return nativeWindowsApp->registerMimeType(mimeType);
150}
151
static QPlatformIntegration * platformIntegration()
Native interface to QGuiApplication, to be retrieved from QPlatformIntegration. \inmodule QtGui.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
QWindowsMimeConverter()
Constructs a QWindowsMimeConverter instance.
static int registerMimeType(const QString &mimeType)
Registers the MIME type mimeType, and returns an ID number identifying the format on Windows.
virtual ~QWindowsMimeConverter()
Constructs a QWindowsMimeConverter instance.
Combined button and popup list for selecting options.
const char * mimeType
#define Q_ASSERT(cond)
Definition qrandom.cpp:47