miqt/qt/gen_qdesktopservices.cpp

40 lines
968 B
C++
Raw Normal View History

#include <QDesktopServices>
#include <QObject>
#include <QString>
2024-08-29 19:01:51 +12:00
#include <QByteArray>
#include <cstring>
#include <QUrl>
#include <qdesktopservices.h>
2024-08-29 19:01:51 +12:00
#include "gen_qdesktopservices.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern C */
#endif
bool QDesktopServices_OpenUrl(QUrl* url) {
return QDesktopServices::openUrl(*url);
}
void QDesktopServices_SetUrlHandler(struct miqt_string scheme, QObject* receiver, const char* method) {
QString scheme_QString = QString::fromUtf8(scheme.data, scheme.len);
QDesktopServices::setUrlHandler(scheme_QString, receiver, method);
}
void QDesktopServices_UnsetUrlHandler(struct miqt_string scheme) {
QString scheme_QString = QString::fromUtf8(scheme.data, scheme.len);
QDesktopServices::unsetUrlHandler(scheme_QString);
}
2024-11-19 19:29:06 +13:00
void QDesktopServices_Delete(QDesktopServices* self, bool isSubclass) {
if (isSubclass) {
delete dynamic_cast<QDesktopServices*>( self );
} else {
delete self;
}
}