j2969719 / doublecmd-plugins

Additions for Double Commander (third-party)
100 stars 24 forks source link

qt5 error when using wlxwebkit_qt5 #26

Closed crotoc closed 2 years ago

crotoc commented 2 years ago

I am trying to preview html using plugin of wlxwebkit_qt5. My system is wslg ubuntu 2204 lts, and I have installed required libraries (libqt5webkit5) and the plugin can be added. When pressing ctrl+Q to preview a html file, it throws an error:

QWidget: Must construct a QApplication before a QWidget

Can some help me fix the question? I am not familiar with c++ and qt5 so cannot debug it by myself.

I am using DC to view some htmls on a remote server and prevent from downloading them to local computer.

Thanks!

j2969719 commented 2 years ago

please provide more information about Double Commander (F1 > Copy to clipboard)

crotoc commented 2 years ago

image

j2969719 commented 2 years ago

this is a plugin for doublecmd-qt not gtk

crotoc commented 2 years ago

Because double commander is opened under windows sub linux, so I can not copy the information to clipboard.

Does it mean I need to download a QT version of double commander?

j2969719 commented 2 years ago

yes, if you need this particular plugin

crotoc commented 2 years ago

wlxwebkit is a plugin that I have successfully installed and previewed some htmls. The only problem is the wlxwebkit cannot zoom in and out the page so that I can screenshot some results. Do you have recommendations of that? A plugin that can view html and zoom in/out when needed. Thanks!

j2969719 commented 2 years ago

this is simply not implemented only basic webpage view is implemented here, nothing more

crotoc commented 2 years ago

I tried qt5 version and there is no problem for viewing html. No zoom in/out as well. Hope you can help implement it in sometime the future. I will be trying to implement it if I am able to figure out how to do it. Thanks very much!

j2969719 commented 2 years ago

btw webengine_qt5 also doesnt support ctrl + mouse wheel zoom out of the box?

crotoc commented 2 years ago

The webendine_qt5 can be added but fails to work. The error msg is :

_Qt WebEngine seems to be initialized from a plugin. Please set Qt::AAShareOpenGLContexts using QCoreApplication::setAttribute before constructing QGuiApplication. WebEngineContext used before QtWebEngine::initialize() or OpenGL context creation failed.

An empty page is shown after waiting for about a miniute.

j2969719 commented 2 years ago

added hotkeys for zoom (Ctrl+Plus, Ctrl+Minus, Ctrl+0) ...but since they dont work in Ctrl+Q also added an additional panel with buttons (it can be disabled in the $DC_CONFIG_PATH/j2969719.ini config).

crotoc commented 2 years ago

Bro, thanks so much! I just read some documents about qt5 and you have done it. Appreciate a ton!