Ok, so this is something I have done for the corporation I work for, unfortunately, it also means that I cannot share many details. What I did was to make a Qt application run from within the browser but as a separate process called from a browser plugin. I used firebreath to make the cross platform/browser plugin. When I got that part working, getting Qt to show in the browser was just a matter of sending the parent window ID as a command line parameter to the application and setting it as the parent.
#include <QApplication>
#include <QWidget>
#include <windows.h>
#pragma comment(lib, "user32.lib")
int main(int argc, char *argv[])
{
widget.setAttribute(Qt::WA_NativeWindow);
SetParent
(widget.
winId(),
(WId
)QString::toULong(application.
arguments().
at(1)));
widget.show();
return application.exec();
}
#include <QApplication>
#include <QWidget>
#include <windows.h>
#pragma comment(lib, "user32.lib")
int main(int argc, char *argv[])
{
QApplication application(argc, argv);
QWidget widget;
widget.setAttribute(Qt::WA_NativeWindow);
SetParent(widget.winId(), (WId)QString::toULong(application.arguments().at(1)));
widget.show();
return application.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks