For example, Visual studio when trying to report a problem displays the following window:
In which the red rectangle highlighted interspersed browser. With what can this be done in your Qt application so that the widget displays a default browser window inside some widget? And how can I give the command to refresh the page to this interspersed browser?
|
2 answers
Since yrHeTaTeJlb does not want to add a modern code to your answer, keep:
#include <QWebEngineView> #include <QApplication> int main(int argc, char **argv) { QWebEngineView view; view.load(QUrl("http://ru.stackoverflow.com/questions/553640/Как-запустить-браузер-внутри-своей-программы-qt")); view.show(); return app.exec(); } and in the project file:
QT += gui webenginewidgets - Now errors in the project file have disappeared, but cannot be compiled due to a C1083 error - it is impossible to find / open the included QWebEngineView file ... Very strange, even Qt Creator itself suggests this library, but does not allow it to be copied. - Nik
- @Nik,
qmakeon the project make. - ixSci 3:54 pm - But look, I’m doing everything right with qmake: I added the path to qmake.exe to the Path variable and now I’ve done qmake projectname.pro on the command line from the project directory right? - Nik
- @Nik, are you using QtCreator? - ixSci
- Yes, I use it. - Nik
|
Well, if at the level of hello world, here's an example from the book by Max Schlee on Qt 5.3
#include<QtWidgets> #include<QtWebKitWidgets> int main(int argc, char **argv){ QApplication app(argc, argv); QWebView webView; webView.load(QUrl("http://www.bhv.ru")); webView.show() return app.exec(); } In the * .pro file should be QT += widgets webkit webkitwidgets This topic is QT += widgets webkit webkitwidgets detail in Chapter 46 of the book.
Qt 5.3. Professional C ++ programming
- Thanks for the answer! But when I try to include the QT + = widgets webkit webkitwidgets line in the pro file, I get the error: "Project ERROR: Unknown module (s) in QT: webkit webkitwidgets". And the resulting browser will have the same display capabilities as, for example, chrome? i.e. html5, css3 and other new things? - Nik
- Rewrite the example of new technologies, webkit probably already cut out. There is now a Chromium-based engine. - ixSci
- @ixSci in fact, I would just open the default browser already installed on the system, and not write my own ... Can I somehow do this? - Nik
- @Nik, and what version of the library? - yrHeTaTeJlb
- @yrHeTaTeJlb qt 5.7. But I say, I would not want to write my browser, is it possible to run the system already installed on the system by default? - Nik
|