miqt/qt/gen_qfileiconprovider.cpp

43 lines
1.2 KiB
C++
Raw Normal View History

#include <QFileIconProvider>
#include <QFileInfo>
#include <QIcon>
#include <QString>
2024-08-29 07:01:51 +00:00
#include <QByteArray>
#include <cstring>
#include <qfileiconprovider.h>
2024-08-29 07:01:51 +00:00
#include "gen_qfileiconprovider.h"
#include "_cgo_export.h"
QFileIconProvider* QFileIconProvider_new() {
return new QFileIconProvider();
}
QIcon* QFileIconProvider_Icon(const QFileIconProvider* self, int typeVal) {
return new QIcon(self->icon(static_cast<QFileIconProvider::IconType>(typeVal)));
2024-08-29 07:01:51 +00:00
}
QIcon* QFileIconProvider_IconWithInfo(const QFileIconProvider* self, QFileInfo* info) {
return new QIcon(self->icon(*info));
}
struct miqt_string* QFileIconProvider_Type(const QFileIconProvider* self, QFileInfo* info) {
QString _ret = self->type(*info);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
return miqt_strdup(_b.data(), _b.length());
}
2024-08-29 07:01:51 +00:00
void QFileIconProvider_SetOptions(QFileIconProvider* self, int options) {
self->setOptions(static_cast<QFileIconProvider::Options>(options));
}
int QFileIconProvider_Options(const QFileIconProvider* self) {
QFileIconProvider::Options _ret = self->options();
return static_cast<int>(_ret);
2024-08-29 07:01:51 +00:00
}
void QFileIconProvider_Delete(QFileIconProvider* self) {
delete self;
}