This commit is contained in:
2026-03-04 23:54:50 +01:00
parent 3a2abf90f6
commit a622739deb
11 changed files with 538 additions and 329 deletions

View File

@@ -12,11 +12,13 @@
#include <QHash>
#include <QQueue>
#include <QTimer>
#include <QEventLoop>
class WebViewQt;
class WebviewWindow;
class Command;
class CommandEvent;
class RKTWEBVIEW_QT_EXPORT Rktwebview_qt : public QObject
{
@@ -27,10 +29,11 @@ private:
QHash<int, WebviewWindow *> _views;
QHash<int, event_cb_t> _view_js_callbacks;
QQueue<Command *> _command_queue;
QTimer _process_commands;
QTimer _process_events;
int _evt_loop_depth;
QTimer _evt_loop_timer;
Rktwebview_qt **_handler;
int _argc;
@@ -41,9 +44,20 @@ private:
result_t doWindow(rktwebview_t w, int cmd);
public slots:
void processCommands();
void processJsEventQueues();
private slots:
void stopEventloop();
private:
void postCommand(Command *cmd);
void handleCommandEvent(CommandEvent *e);
void processCommand(Command *cmd);
// QObject interface
protected:
void customEvent(QEvent *event);
public:
void removeView(int id);
@@ -91,6 +105,7 @@ public:
public:
Rktwebview_qt(Rktwebview_qt **handler);
};
#endif // RKTWEBVIEW_QT_H