Feature-wise comparison of QtWebKit reboot with official sources:
https://github.com/annulen/webkit/wiki/Comparison-with-QtWebKit-5.6
Note that we are very close to feature parity now, i.e. there are very little features that work with legacy QtWebKit and are not yet supported with reboot, and their number is constantly lowering.
Hi, and welcome!
@Peter-Goteh said in will javascript const keyword be available for PyQt4 QtWebkit ?:
i do want to know if the javascript implementation used in PyQt4 QtWebkit will allow for the use of const keyword for ES6.
Qt 4 reached end-of-life in 2011. ES6 was released in 2015.
So, the answer is no.
@JonB Yep, I've just found that I need to wait for loading page before printing and the solution is connect loadFinished signal to method I need, that do printToPdf() in it. I thought that WebEngineView does not need to wait for the local html file to load, but it was mistaken.
UPD: Also, I've found a way to print multiple pdfs. You need to make a QEventLoop obj, connect loadFinished signal to QEventLoop::quit and after setHtml just call loop.exec() and you can guarantee that file you need will load and prints correctly only after loading of the previous page code.
Example:
// Header
class MyClass : public QObject
{
Q_OBJECT
private:
QEventLoop loop;
QWebEngineView *webView;
public:
void saveCardPdf();
// Cpp
MyClass::MyClass(QObject *parent ): QObject(parent)
{
webView = new QWebEngineView();
connect(webView, &QWebEngineView::loadFinished, &loop, &QEventLoop::quit);
}
...
void MyClass::saveCardPdf()
{
...
// Load your html code..
webView->setHtml(html); // html - string of one page
loop.exec();
webView->page()->printToPdf(path);
// Modify name for another file
path.replace(".pdf", "_1.pdf");
webView->setHtml(html1); // html1 - string of another page
loop.exec();
webView->page()->printToPdf(path);
}
It's not perfect solution, but I think you understand the idea
Many converters show this glitch while converting. I tried using another online HTML to PDF converter and my problem was solved. You should try it too.
You seem to describe a client only application which connects to an existing REST service. If so, then QNetworkAccessManager is the class to build your client upon.
I am using QT5.8. & c++.
Qt VirtualKeyboard is available in Qt 5.8.
For C++: If you mean that you're using Qt Widgets, there's an integration with Qt VirtualKeyboard, too: https://doc.qt.io/qt-5/qtvirtualkeyboard-deployment-guide.html#integration-method
Getting the same error ("No WebView plug-in found!) when trying to run the minibrowser sample with
Qt 6.3.1
macOS 11.6.7
XCode 13.2.1
It really would be useful to have a minimal Qt WebView example actually working!
UPDATE: I found a workaround on macOS - set the following environment variable in the Run environment:
QT_WEBVIEW_PLUGIN=native
However this hasn't worked on Linux, where the setting (I think) would be:
QT_WEBVIEW_PLUGIN=webengine
None of this is mentioned anywhere in Qt6 docs for WebView as far as I know. I had to read the source at
https://code.qt.io/cgit/qt/qtwebview.git/tree/src/webview/qwebviewfactory.cpp?h=6.3.1
to find that out. And the source code itself is not clear - the comments there suggest that the native web runtime is not used on macOS.
Which is the opposite of what the docs suggest: https://doc.qt.io/qt-6/qtwebview-index.html - "On macOS, the system web view is used in the same manner as iOS."
Does anybody at Qt care to comment on this? The lack of working examples and clear documentation on this make it seem like the whole WebView is deprecated or unmaintained.
@Augustas said in Qt 6 No WebView plug-in found!:
edit: Just to add to your answer: it seems that you also need to install Qt WebChannel packet for WebView to work. So in total you need to install:
Qt WebEngine
Qt Positioning
Qt WebChannel
Qt WebView
Good catch. Thanks for letting us know!
(I didn't notice it before because I usually install everything, for convenience)
@Tacc said in Map QWidget center position to QGraphicsScene coordinates?:
I'm getting all those positions in the constructos of each item/widget.
That's why it's a shame that you did not show the code where you were printing the values. I did not know you were doing that.
Can you help me with that?
In what sense? If you move things and want to output their position, add a function you can call (e.g. from a menu item) while you develop/debug, or use something like QGraphicsItem::itemChange() or QGraphicsScene::changed() to recognise it has moved.
@Konstantin-Tokarev Thank you for the link . But I already solved my problem with QTextCursor and QTextDocument sice I only needed to print to a PDF ,also I am working on Qt 5.13.0 so I don't want to mess with my environment as I am still kind of a noob xD and I hate environment -related issues . But thanks a lot though .
I fixed this by added
webSettings.setDatabaseEnabled(true);
webSettings.setDomStorageEnabled(true);
in constructor of QtAndroidWebViewController.java
end rebuild WebView.
@Konstantin-Tokarev
I have build debug libraries with below options to configure script
-debug , -webkit-debug,
is there any option i should pass so that trace gives us more information?
@Swati777999 said in Why are pointer objects created while defining a class?:
I want to know why are pointer objects created in the definition of a class instead of simply creating an object of that class.
There can be multiple different reasons. Some reasons are:
To save space. The size of a pointer is always 32 bits or 64 bits (4 bytes or 8 bytes) on today's common PCs, but the size of a class/struct depends on the sizes of all its members. If an object is too big, it cannot be created on the stack (or it becomes easier to trigger a stack overflow).
Because some objects cannot be copied. For example, you cannot have QList<QWidget>; you must use QList<QWidget*>
Because of style/convention. Qt uses pointers to show that an object is an Identity object, and it uses non-pointers to show that an object is a Value object: https://doc.qt.io/qt-6/object.html#qt-objects-identity-vs-value
@Ryna said in How to provide Username and password while using QWebEngineView:
http://172.10.4.1
Look at the HTML source code of that page and find how the username/password are sent to the web server once the user is done with entering such values