Quantcast
Channel: QtWebEngine
Viewing all 13965 articles
Browse latest View live

[[qanda:topic_unsolved]] inputfile into html inside webengine not upload

$
0
0

Hello,
Why not upload file from inputfile element html ??
I have see this QT message in debug.
1f171588-c766-4cc6-a506-f3a29c16f6ee-image.png
All control for upload file is into javascript code.
What did I forget?
Thanks for your help.


[[qanda:topic_unsolved]] "Project ERROR: Could not find feature mirclient" on windows and msvc !!!!!!!!

$
0
0

webengine has a bug in select file from local disc in html ( i tested on 5.14.2)
but on other versions like 5.12.8 it is fine,
i cant wait for 5.15.0 and new bugs :D
now im building webengin from sources (git://code.qt.io/qt/qtwebengine.git) and in dev brach of this repo i faced NMAKE Fatal Error U1077
i changed branch to 5.12.8 that im sure html select file works in this version ... but when in ran qmake failed to create make file and shows this error: "Project ERROR: Could not find feature mirclient."
im using latest msvc on windows 10 and Qt5.14.2 kit and target is x86 windows ( qmake -spec win32-msvc ) and mirclient is for linux.
i tried this on webengine source from 5.12.8 setup too.

What is my problem????

but when i change branch to 5.15.0 no need mirclient
now im started nmake (It uses ninja) and im waiting for the result.

[[qanda:topic_unsolved]] I am having a 404 with Qtwebengine when it works fine on chromium.

$
0
0
@JonB Should not need to any other https address seems to work.

[[qanda:topic_unsolved]] Suppress warnings from QtWebEngineProcess[.exe]

$
0
0

Hi,

I have finally managed to deploy my application with Qt WebEngine (the documentation is really not up to date or is it?), and if I launch my application from the console (on Linux for example) then I am getting the following messages:

Qt WebEngine ICU data not found at /opt/Qt/5.12.8/gcc_64/resources. Trying parent directory...
Qt WebEngine ICU data not found at /opt/Qt/5.12.8/gcc_64. Trying application directory...
Installed Qt WebEngine locales directory not found at location /opt/Qt/5.12.8/gcc_64/translations/qtwebengine_locales. Trying application directory...
Qt WebEngine resources not found at /opt/Qt/5.12.8/gcc_64/resources. Trying parent directory...
Qt WebEngine resources not found at /opt/Qt/5.12.8/gcc_64. Trying application directory...

I checked the source code for QtWebEngineProcess and indeed, it looks for the ICU data and resources in different folders. However, as we can see, if it doesn't find what it needs in the a given folder, it generates a warning even though it eventually finds it.

This looks very unprofessional to me, so I am wondering whether I can get rid of those messages. At the end, I know that my application works fine once deployed, so I don't want to see those messages.

Cheers, Alan.

[[qanda:topic_unsolved]] Help with Upload Folders in JavaScript

$
0
0

Hello,

this is my last Chance to get my JavaScript Sourcecode for Uploading Folders in qtwebengine.

It works with the code:

function uploadFiles(files) {

    // Create a new HTTP requests, Form data item (data we will send to the server) and an empty string for the file paths.
    var xhr = new XMLHttpRequest();
    var data = new FormData();
    var paths = "";

    // Loop through the file list
    for (var i in files) {
        // Append the current file path to the paths variable (delimited by tripple hash signs - ###)
        paths += files[i].webkitRelativePath + "###";
        // Append current file to our FormData with the index of i
        data.append(i, files[i]);
    };
    // Append the paths variable to our FormData to be sent to the server
    // Currently, As far as I know, HTTP requests do not natively carry the path data
    // So we must add it to the request manually.
    data.append('paths', paths);

    // Open and send HHTP requests to upload.php
    xhr.open('POST', "ajax/progress_ordner.php", true);
    xhr.send(data);

}

the Code works fine in all Browsers including Chrome/Chromium on Windows but in QTWebEngine (on Windows too) there are no "files[i].webkitRelativePath" entries...

please help!

Greets
Robert

[[qanda:topic_unsolved]] Can I build QtWebEngine statically?

$
0
0
Hi and welcome to devnet, AFAIK, no it's not. As for why, to the best of my knowledge, chromium constraint.

[[qanda:topic_unsolved]] How can I select and copy text from a QPdfView widget?

$
0
0
@Igor-Bogomolov I know no more than in https://askubuntu.com/questions/1071771/where-is-the-text-selection-tool-in-qpdfview, which explains how to copy to clipboard, and states it is a "rudimentary tool".

[[qanda:topic_unsolved]] Clear cache & history Qt WebView

$
0
0

Hello,

I am developing an application that integrates with a Shopify store. Due to user requirements, the checkout must be made with a web view that loads a server-generated URL with information about the current user. This works perfectly until the user logs-out from the application and logs in with a different account: the credentials from the previous user are still loaded into the web view (at least in iOS).

Is there a way to clear history, cookies and data stored by the WebView, without the need to reinstall the application (Android/iOS)?

Thanks in advance!


[[qanda:topic_unsolved]] Touch not working in QtWebEngine after opening a DropDown menu

$
0
0

Hello everbody!

I stumbled across a QtWebEngine problem while using a touch display. I can browse normally through websites via my touch display, but when I click on a DropDown menu (for example on https://www.ebay.com/ clicking on "All categories" next to the search field), touch is not working anymore (or 1/30 touch clicks works). I can still close it via mouse/keyboard. After closing the DropDown menu, touch is working again.

I created a small example browser, there is nothing special in it:

BrowserWidget::BrowserWidget(QWidget *parent)
    : QWidget(parent), ui(new Ui::BrowserWidget),
      m_webView(new QWebEngineView(this)), m_page(new QWebEnginePage(this)) {
  ui->setupUi(this);
  ui->verticalLayout->addWidget(m_webView);

  m_page->setUrl(QUrl(QStringLiteral("https://www.ebay.com/")));
  m_webView->setPage(m_page);

  m_webView->setAttribute(Qt::WA_AcceptTouchEvents);
  m_webView->installEventFilter(this);
}

bool BrowserWidget::eventFilter(QObject *watched, QEvent *e) {
  qDebug() << "event: " << e->type();

  if (e->type() == QEvent::ChildAdded) {
    QChildEvent *ce = static_cast<QChildEvent *>(e);
    if (ce && ce->child()) {
      ce->child()->installEventFilter(this);
    }
  }

  return false;
}

I installed my event filter to the widgets in the QEvent::ChildAdded for a better debugging (so I can observe more events). When I close the DropDown with my mouse I get MouseButtonPress, FocusIn, ChildRemoved, ... events. But with touch I only get MouseButtonPress, nothing more.

This behaviour is always reproducable and I don't know if I did something wrong, because I can operate the browser via touch. I also added the Qt::WA_AcceptTouchEvents to the child widgets or the BrowserWidget itself, but it didn't make any difference.

I hope somebody of you can help me out, thank you!

[[qanda:topic_unsolved]] No WebView plug-in found!

$
0
0

Hi,

I made a simple crawler using Qt 5.15.0 and QML.
It works properly when launched from QtCreator.
But when I run it standalone, it doesn't work.

I ran windeployqt for sure, (--release --qmldir d:\qt\5.15.0...\qml)
and manually copied the QtWebView qml folder.
But it still doesn't work. So I activate the console.
It said, No WebView plug-in found!

So I copied all of qml, plugins, and dlls into the release folder.
I also added QT += webengine configuration.

I have no idea what to do anymore.

OS: Windows 10
SDK: Qt 5.15.0 MSVC2019 x64
Compiler: MSVC2017 (not 2019)

Can someone help me?

[[qanda:topic_unsolved]] QWebEngineUrlRequestInterceptor cause webview crash

$
0
0
Hey! I had a very similar problem where my application crashed when I tried to delete the interceptor (see https://stackoverflow.com/questions/59631239/qwebengine-deleting-qwebengineurlrequestinterceptor-results-in-crash) I did not have multiple webviews but multiple webpages, where I always created a new interceptor. It was sufficient to only use one interceptor. Hope this helps!

[[qanda:topic_solved]] Can't Build QTWebEngine With Xcode 11.5 on MacOS 10.15.5

$
0
0
The following command fixed. sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

[[qanda:topic_unsolved]] QtWebEngine signing issues

$
0
0
@kdg82 I have the same problem, if I open hardened runtime for my app, the QtWebEngineProcess crashed. Hope the official answer.

[[qanda:topic_unsolved]] Display PDF in 5.15

$
0
0
@RayL https://bugreports.qt.io/browse/QTBUG-84340 ? https://wiki.qt.io/Qt_5.15.0_Known_Issues ? The embedded PDF viewer in qtwebengine is non-functional. Fixed for 5.15.1. ?

[[qanda:topic_unsolved]] ERROR:extension_system_qt.cpp(122)] Failed to parse extension manifest.

$
0
0
@SGaist I have put up my issue below, which is wrt C++. Can you please let me know which initialization function we need to use in C++? I am getting this issue in C++.

[[qanda:topic_unsolved]] QML WebEngineView elements integrate in page and scroll

$
0
0

Hello, I have been suffering from this problem for a long time, maybe someone will help, I will be grateful.
there is a page where the web element is mounted in this page, but it does not fit the entire area, when you try to scroll, nothing happens in the element area. Everything works when to scroll through the green area (all in the example). The question is how to catch (handle) the WebEngineView focus?

if scroll green region = all is well
if mouse cursor in web page = does not scroll
but left click and swipe works

example

import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Window 2.12
import QtWebEngine 1.8
Window {
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")

    Flickable{
        id: pageFlickable
        width: parent.width
        height: parent.height

        Column {
            anchors.fill: parent
            Rectangle{
                width: parent.width
                height: 150
                color: "#93d905"
            }
            Item{
                id: descriptionTextForm
                width: parent.width
                height: webView.height

                WebEngineView {
                    id: webView
                    x:15
                    y:15
                    width: descriptionTextForm.width - 60
                    settings.focusOnNavigationEnabled: false

                    onContextMenuRequested: function(request) {
                        request.accepted = true
                    }

                    onHeightChanged: {
                            pageFlickable.contentHeight = webView.height + 150
                    }

                    onScrollPositionChanged: {
                       // console.log("scroll: " + scrollPosition.y)
                    }

                    onNewViewRequested: function(request) {
                        Qt.openUrlExternally(request.requestedUrl)
                    }

                    url: "https://www.qt.io/blog"
                    onLoadingChanged: {

                        webView.runJavaScript(
                                    "document.documentElement.scrollHeight;", function (i_actualPageHeight) {webView.height = i_actualPageHeight; });

                        if (loadRequest.errorString)
                            console.error(loadRequest.errorString);
                    }
                }
            }
        }
        ScrollBar.vertical: ScrollBar {
            width: 15
            policy: ScrollBar.AlwaysOn
        }
    }
}

[[qanda:topic_unsolved]] Using a proxy built into the application to access https response headers in QtWebEngine

$
0
0

I'm the maintainer of the Konqueror web browser for Linux (https://kde.org/applications/internet/org.kde.konqueror) and I'm trying to port it from QtWebKit to QtWebEngine, which is being quite difficult because of the differences between them.

In particular, one of the biggest problems is that Konqueror needs to manage the network requests and responses by itself (or rather, have it managed by the underlying KDE libraries), which isn't allowed by QtWebEngine.

The only idea that came to my mind is to write an http proxy and integrate it in Konqueror, then make QtWebEngine use it. This way, Konqueror would be able to see the response headers before they reach QtWebEngine and do whatever it needs with them.

While this works correctly with HTTP URLs it doesn't work with HTTPS because, of course, the proxy only sees the encrypted headers. I'm wondering whether it would be possible for Konqueror to create an SSL certificate and use it to encrypt the communication with QtWebEngine. What I'd hope to do would be something like this:

  • QtWebEngine sends the request to the proxy within Konqueror, encrypted using
    the key provided by Konqueror itself
  • Konqueror decrypts the request and sends it to the the server as usual
  • Konqueror receives the response from the server and analyzes it
  • Konqueror encrypts the response with its own certificate and sends it to
    QtWebEngine.

Unfortunately, QtWebEngine doesn't provide a way to tell it that the certificate provided by Konqueror must be trusted (of course, that certificate can't be installed system-wide). It does have a function which is called in case of a certificate error and which allows to ignore the error. However, my attempts so far have been unsuccessful.

Is what I'm hoping to achieve really impossible or am I doing something wrong?

Thanks in advance

Stefano

[[qanda:topic_solved]] QWebChannel - js: Uncaught ReferenceError: qt is not defined

$
0
0
when page finish,Run this! QString js; QFile jsFile(":/ServiceNumber/Resource/ServiceNumber/qwebchannel.js"); jsFile.open(QIODevice::ReadOnly); js = jsFile.readAll(); webView->page()->runJavaScript(js);

[[qanda:topic_unsolved]] Access violation in QQuickWebEngineViewPrivate::initializeProfile()

$
0
0

I'm working on a project using Qt 5.12.8 to embed the WebEngineView. If I embed the WebEngineView in a simple qml file and run only test part 1 things are working fine. However, if I run both test part 1 & test part 2 in sequence I get an access violation in QQuickWebEngineViewPrivate::initializeProfile().

Test case using gtest framework

TEST( QuickControlsLoadTest, DialogWebViewRaw )
{
	QUrl dirOfControls( "qml/DialogWebViewRaw.qml" );

	{
                // Test part 1
		QCoreApplication::setOrganizationName( "Example" );
		QApplication::setAttribute( Qt::AA_ShareOpenGLContexts ); // For WebView needed
		QCoreApplication::setAttribute( Qt::AA_EnableHighDpiScaling );
		int          m_argc( 1 );
		char*        m_argv[1];
		m_argv[0] = "";
		QApplication app( m_argc, m_argv );

		QtWebEngine::initialize();

		QQmlApplicationEngine appEngine;
		appEngine.load( dirOfControls );
		//app.exec();
	}
	{
                // Test part 2
		QCoreApplication::setOrganizationName( "Example" );
		QApplication::setAttribute( Qt::AA_ShareOpenGLContexts ); // For WebView needed
		QCoreApplication::setAttribute( Qt::AA_EnableHighDpiScaling );
		int          m_argc( 1 );
		char*        m_argv[1];
		m_argv[0] = "";
		QApplication app( m_argc, m_argv );

		QtWebEngine::initialize();

		QQmlApplicationEngine appEngine;
		appEngine.load( dirOfControls );
		//app.exec();
	}
}

DialogWebViewRaw.qml contains the following code

import QtQuick 2.11
import QtQuick.Window 2.2
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.11
import QtWebEngine 1.1

ApplicationWindow {
	id: window
	title: "Web View"

	ColumnLayout {

		WebEngineView {
			id: webView
			//url: 'https://www.google.com/'
			Layout.fillHeight: true
			Layout.fillWidth: true
		}
	}
}

Call stack of access violation

Qt5WebEngined.dll!QQuickWebEngineViewPrivate::initializeProfile() Line 181	C++
Qt5WebEngined.dll!QQuickWebEngineView::componentComplete() Line 2092	C++
Qt5Qmld.dll!QQmlObjectCreator::finalize(QQmlInstantiationInterrupt & interrupt) Line 1375	C++
Qt5Qmld.dll!QQmlComponentPrivate::complete(QQmlEnginePrivate * enginePriv, QQmlComponentPrivate::ConstructionState * state) Line 937	C++
Qt5Qmld.dll!QQmlComponentPrivate::completeCreate() Line 972	C++
Qt5Qmld.dll!QQmlComponent::completeCreate() Line 964	C++
Qt5Qmld.dll!QQmlComponent::create(QQmlContext * context) Line 798	C++
Qt5Qmld.dll!QQmlApplicationEnginePrivate::finishLoad(QQmlComponent * c) Line 136	C++
Qt5Qmld.dll!QQmlApplicationEnginePrivate::startLoad(const QUrl & url, const QByteArray & data, bool dataFlag) Line 121	C++
Qt5Qmld.dll!QQmlApplicationEngine::load(const QUrl & url) Line 266	C++
QuickTests.exe!QuickControlsLoadTest_DialogWebViewRaw_Test::TestBody() Line 98	C++

Why I get this access violation? Is the WebEngineProfile deleted after execution of part 1 of test case above?
I know the test doesn't makes much sense at all but I wonder why I get the error.

I appreciate any help.

[[qanda:topic_unsolved]] Saving Passwords?

$
0
0
So far what i've had to do is "runJavaScript" and populate fields that way. It works. Is there a more elegant built-in method?
Viewing all 13965 articles
Browse latest View live