This commit is contained in:
2026-03-05 10:59:06 +01:00
parent 99f30a6798
commit 3b53a945f9
11 changed files with 133 additions and 13 deletions

View File

@@ -11,20 +11,27 @@
#include <QWebEngineScriptCollection>
#include <QWebEngineScript>
#include <QMoveEvent>
#include <QWindow>
WebviewWindow::WebviewWindow(QWidget *parent)
WebviewWindow::WebviewWindow(WebviewWindow *parent)
: QMainWindow{parent}
{
_view = nullptr;
_must_close = false;
_devtools = nullptr;
_parent = parent;
_window_created = false;
_moved = 0;
_resized = 0;
if (parent != nullptr) {
setWindowModality(Qt::WindowModality::WindowModal);
setWindowFlag(Qt::WindowType::Dialog, true);
}
connect(&_resize_timer, &QTimer::timeout, this, &WebviewWindow::triggerResize);
connect(&_move_timer, &QTimer::timeout, this, &WebviewWindow::triggerMove);
}
@@ -227,6 +234,7 @@ void WebviewWindow::triggerResize()
void WebviewWindow::showEvent(QShowEvent *event)
{
_window_created = true;
EventContainer show("show");
_container->triggerEvent(_view->id(), show);
}