Skip to content

Commit

Permalink
webengine: inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
minorua committed Nov 24, 2023
1 parent 5dfad16 commit 6140363
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
8 changes: 3 additions & 5 deletions q3dwebengineview.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,20 +120,18 @@ def __init__(self, parent=None):
# if DEBUG_MODE:
# self.settings().setAttribute(QWebSettings.DeveloperExtrasEnabled, True)

#TODO:
def showInspector(self):
dlg = QDialog(self)
dlg.setAttribute(Qt.WA_DeleteOnClose)
dlg.resize(800, 500)
dlg.setWindowTitle("Qgis2threejs Web Inspector")

wi = QWebInspector(dlg)
wi.setPage(self._page)
ins = QWebEngineView(dlg)
self._page.setDevToolsPage(ins.page())

v = QVBoxLayout()
v.setContentsMargins(0, 0, 0, 0)
v.addWidget(wi)
v.addWidget(ins)

dlg.setLayout(v)
dlg.show()
dlg.exec_()
1 change: 0 additions & 1 deletion q3dwebkitview.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,3 @@ def showInspector(self):

dlg.setLayout(v)
dlg.show()
dlg.exec_()
3 changes: 0 additions & 3 deletions viewer/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ function init(off_screen, debug_mode, webengine) {

if (webengine) {
// Web Channel
console.log("initBridge()");
new QWebChannel(qt.webChannelTransport, function(channel) {
window.pyObj = channel.objects.bridge;
pyObj.sendScriptData.connect(function (script, data) {
Expand All @@ -36,12 +35,10 @@ function init(off_screen, debug_mode, webengine) {
eval(script);
});

console.log("QWebChannel() callback");
_init(off_screen, debug_mode);

pyObj.onInitialized();
});
console.log("end of initBridge()");
}
else {
// WebKit Bridge
Expand Down

0 comments on commit 6140363

Please sign in to comment.