miqt/cmd/handbindings/binding.cpp

30 lines
716 B
C++
Raw Normal View History

2023-10-22 22:00:00 +00:00
#include "binding.h"
#include <QApplication>
#include <QWidget>
#include <QPushButton>
PQApplication QApplication_new(int* argc, char** argv) {
// QApplication takes these parameters byref, not by value
return new QApplication(*argc, argv);
2023-10-22 22:00:00 +00:00
}
PQWidget QWidget_new() {
return new QWidget();
}
void QWidget_show(PQWidget self) {
static_cast<QWidget*>(self)->show();
}
PQPushButton QPushButton_new(const char* label, PQWidget parent) {
return new QPushButton(label, static_cast<QWidget*>(parent));
}
void QPushButton_show(PQPushButton self) {
static_cast<QPushButton*>(self)->show();
}
int QApplication_exec(PQApplication self) {
return static_cast<QApplication*>(self)->exec();
}