Quantcast
Channel: Qt DevNet forums: Qt WebKit
Viewing all 542 articles
Browse latest View live

media query for pixel density not working in QtWebView

$
0
0
I am trying this, but it doesn’t seem to be working in the web view. @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and ( min—moz-device-pixel-ratio: 2), only screen and ( -o-min-device-pixel-ratio: 2/1), only screen and ( min-device-pixel-ratio: 2), only screen and ( min-resolution: 192dpi), only screen and ( min-resolution: 2dppx) { #logo { background: url(../img/logo@2x.png); } } Opening the html file in safari works fine. I am using Qt5.1. Is this a bug? Thanks

WebKit build fail in 64bit Windows 7 and Qt 5.1.1 with mingw48_32

$
0
0
Hi… I am trying to build webkit in 64bit Windows 7 and Qt 5.1.1 with mingw48_32 but getting below errors from Qt Creator. I followed the instructions from here http://trac.webkit.org/wiki/BuildingQtOnWindows I am not getting the exact cause as I don’t have much idea about configure the projects. It would be great if you could help me out. E:\Nirab\Qt\Workspace\WebKit-r156305\WebKit.pro:21: error: ‘use?’ is not a recognized test function. E:\Nirab\Qt\Workspace\WebKit-r156305\WebKit.pro:31: error: ‘build?’ is not a recognized test function. E:\Nirab\Qt\Workspace\WebKit-r156305\Source\JavaScriptCore\JavaScriptCore.pro:19: error: ‘addStrictSubdirOrderBetween’ is not a recognized test function. E:\Nirab\Qt\Workspace\WebKit-r156305\Source\JavaScriptCore\JavaScriptCore.pro:20: error: ‘addStrictSubdirOrderBetween’ is not a recognized test function. E:\Nirab\Qt\Workspace\WebKit-r156305\Source\WebCore\DerivedSources.pri:12: error: ‘toSanitizedPath’ is not a recognized replace function. ………. ……… ……… E:\Nirab\Qt\Workspace\WebKit-r156305\Source\api.pri:30: error: ‘use?’ is not a recognized test function. E:\Nirab\Qt\Workspace\WebKit-r156305\Source\api.pri:47: error: Cannot find feature webkit_modules :-1: error: Module does not define version. Thanks, -Nirab

CMake and QT WebKit Compile

$
0
0
When I include QT += webkit in a project file and use qmake, a QWebView example works great and as expected. When attempting to add “set(QT_USE_QTWEBKIT TRUE)” to my CMakeList.txt, I get the issue: “Qt QTXMLPATTERNS library not found.” I have tried adding set(QT_USE_QTXMLPATTERNS TRUE) to address this, but no change. A post on another site suggested there is an un-neccessary dependency for WebKit to have on XmlPatterns. Since the qmake version works and the cmake version does not, the module must be available to be loaded. Any hint on the solution or troubleshooting steps to fix this? A CMake example?

QtWebkit 4.8.4 not load Javascript

$
0
0
Hello, I have this enviorement: Qt 4.8.4 arm-v4t-linux-gnueabi-gcc V 4.7.2 I’m trying to run a program that load html webpage that contains javascript scripts into a webview conrol. The HTML code is loaded well but the javascript code is no loaded. Neither if I put only and alert javascript code. I’m running this code: i->myBrowser->page()->mainFrame()->evaluateJavaScript(“function abc(){alert(‘This page has finished loading!’);return ‘he’} abc();”); qDebug() << “NAME: “ << name.toString(); And the output of debug is: …. -1.45215999014158e-58” NAME: “-1.45215999014169e-58” NAME: …. Could be this a Bug ? Thank you

anomalous WebView editing behavior

$
0
0
In building an application using QWebView with content editable I’ve run some weird behavior. After some work I’ve pared down my code to illustrate some of this behavior. The test HTML I’m using is in a file called undotest.html and is as follows: <!DOCTYPE html> <html> <head> <title>undo_redo test</title> <body> <!-- undo_redo test --> <p>start undo_redo test</p> <iframe width="420" height="315" src="http://www.youtube.com/embed/fwbH8dgASRc?rel=0" frameborder="0" allowfullscreen></iframe> <p>end undo_redo test</p> </body> </html> The test program that displays the HTML is simply a webView with three push buttons. An undo button, a redo button, and a cut button. The mainwindow.cpp where all the action takes place is: #include "mainwindow.h" #include "ui_mainwindow.h" #include <QUrl> #include <QDebug> MainWindow::MainWindow(QWidget *parent) :     QMainWindow(parent),     ui(new Ui::MainWindow) {     ui->setupUi(this);     QUrl url("path to undotest.html");     ui->webView->showMaximized();     ui->webView->settings()->setAttribute(QWebSettings::PluginsEnabled,true);     ui->webView->settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows,true);     ui->webView->settings()->setAttribute(QWebSettings::JavascriptCanCloseWindows,true);     ui->webView->settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard,true);     ui->webView->settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls,true);     ui->webView->page()->setContentEditable(true);     ui->webView->load(url); } MainWindow::~MainWindow() {     delete ui; } void MainWindow::on_undoButton_clicked() {     ui->webView->page()->action(QWebPage::Undo)->activate(QAction::Trigger); }// end on_undoButton_clicked void MainWindow::on_redoButton_clicked() {     ui->webView->page()->action(QWebPage::Redo)->activate(QAction::Trigger); }// end on_redoButton_clicked void MainWindow::on_cutButton_clicked() {     ui->webView->page()->action(QWebPage::Cut)->activate(QAction::Trigger); }// end on_cutButton_clicked As simple as this code is it produces the following anomalous results: If you select the iframe (i.e., the youtube video) and press cut the video is successfully cut. You can then press undo to restore the video but after that the redo button no longer works (but you can still press cut and it will work). If you first select some text from start “undo_redo test” and cut it then cut the video you should be able to press undo twice to restore the original content but it doesn’t happen. Pressing the undo button once restores the video but pressing it again has no effect. After some further investigation I found that the first undo causes webview to emit a loadStarted() signal which appears to clear the undo stack. Note: if the order of operations is reversed everything works okay. If I use the <object> HTML from YouTube to display the video then the QWebView code works correctly so as a temporary measure I’m using the old YouTube HTML rather than their recommended HTML but eventually one would have to be able to switch to the recommended HTML. Does anyone have any suggestions for an actual work around for this problem?

Project in QT 5.1.1 compiled with Ming not showing Facebook Like Box all the time

$
0
0
Hi, We have a strange issue in our software (free one), it is about Facebook Likebox not showing all the time. We call this test page in our software (webkit) : http://www.konkours.com/__new.php (it includes a FB Like Box). With Webkit 534.34 (QT 4.8.5), it works fine on all plateforms (Linux, Windows, Mac). But with Webkit 537.21 (QT5.1.1), it works only with Linux and Mac, not Windows (compiled with Ming 4.8 32 bits). If we compile with MSVC 2010 32 bits, it works (Windows). If we create an empty project just showing the page, it works also with Ming (so strange). We listened what happen with Wireshark in both cases (Ming vs MSVC) and it seems that Facebook don’t want to send us information we need to show the Like Box only when compiled with Ming (works fine with MSVC). Here is the Wireshark for MSVC : http://snag.gy/QtFiR.jpg, here is the one for Ming : http://snag.gy/GAfnL.jpg We discovered a more stange thing, Like box on this website is working in our project (http://www.tipux.com/top/117/) but not the normal like button on the same page. This is so strange, Pierre

[Solved] General questions about QWebView and QWebElement

$
0
0
So, I have a QWebView and I load a web page inside it. Then, I get the document: QWebElement document = webView->page()->mainFrame()->documentElement(); Question 1: When I edit the ‘document’ does it update automatically inside my QWebView ? This is how I edit my document (simplified code, it misses crash checks etc): QWebElementCollection collection = document.findAll(search_for); QWebElement cur_element=collection.at(0); cur_element.setAttribute(attribute, value); cur_element.setFocus(); Question 2: When an element has focus (which in my case, it will be an element tagged “input”), how can I simulate an Return (Enter) key event into my QWebView so as not to search for the submit button and generalize more the submit process? (e.g. I don’t want to do this: http://paste.ubuntu.com/6258346/) Question 3: When a form is submitted (hopefully by simulating a key enter press event (or if a QWebElement tagged “button” is clicked) does my QWebView loads again? Because I want to know whether the loadFinished() signal is emitted again.

Problem with adding (QWebSettings::PluginsEnabled, true)

$
0
0
Hello! If I add to my code: QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true); and after compile my app “The program ended unexpectedly” and “Error – RtlWerpReportException failed with status code :-1073741823. Will try to launch the process directly” How i can run flash player in QWebView ? Pls, help.

Solaris qtwebkit (unknown older version) crash on JS garbage collection (using QT 4.8.4)

$
0
0
I’ve got an old version of qtwebkit (exact version currently hard to determine – all I have is the built library, dragged into the build process on the build SPARC machine). A QWewView is used to display some relatively simple html files. Displaying one such html page is fine. Switching to another html file (which again is fine if it’s the first one viewed) causes a crash a few seconds later. On the solaris build (but not the Win or Linux, where everything works fine), it seems that whenever the javascript undergoes garbage collection, it crashes. The crash was in the function _JSGlobalData::recompileAllJSFunctions() _ (which doesn’t exist anymore, so this is clearly quite an old build), at the bottom of what looked like a timed JS garbage collection. The javascript on the page really isn’t necessary, so I turned off javascript right after the QWebView is created     ui->setupUi(this);     ui->itemHelpWebView->settings()->setAttribute(QWebSettings::JavascriptEnabled , false); but that seemed to only move the crash from where it was happening, to a different function JSGlobalObject::copyGlobalsFrom , deep in some JS handling functions. I don’t know a thing about webkit or qtwebkit. It seems to me that this particular solaris build suffers from shoddy JS handling (presumably turning off the JS doesn’t actually stop JS handling/parsing etc, just stops it being expressed on screen or some such). So then I went into the html and ripped out all mention of the JS, and now everything is fine (or rather, there’s no JS but at least it doesn’t crash anymore). I don’t know how it works, but I’m guessing that any mention of JS in the html file causes the JS to be loaded/parsed/compiled/whatever, and then when I switch to a different html page, after a few seconds the JS GC decides to tidy up the JS from the last page, and it all goes wrong. I’m trying to track down where this build of qtwebkit comes from, and also trying to track down what the last version of qtwebkit that can be built on Solaris 10 is (and if I can get it building, I’ll switch to that, of course), but while I’m doing that, does anyone happen to know off the top of their head about this sort of thing? Is there, or was there, some issue with JS GC on old (solaris) qtwebkit builds? Any suggestions beyond the obvious “get a more recent qtwebkit built”?

Parse error does not set XMLListModel.status as XmlListModel.Error

$
0
0
I am loading a bad XML into a XMLListModel and although I get an error displayed at the console (“Error FODC0002 in tag:trolltech.com,2007:QtXmlPatterns:QIODeviceVariable:src, at line 12, column 22: Opening and ending tag mismatch.”), the status property reads “XmlListModel.Ready”, with a count of zero elements in the model. Is this standard behaviour? I expected to find the status as “XmlListModel.Error”, and the error message available throught the errorString method. Is there any way to know at run time that the loaded XML does not parse?

HTML5 Stroke VERY Slow in Qt 5.x

$
0
0
It appears that the HTML5 stroke() operation in Qt5 is very slow. I downloaded a number of the canned Qt’s, such as qt-windows-opensource-5.1.1-msvc2010_opengl-x86-offline, and then ran the following test script,     function drawLine(num_pts) {         var c = document.getElementById("my_canvas");         var ctx = c.getContext("2d");           var h = c.height;         var w = c.width;         var dx = w / num_pts;         for (var idx=0; idx<num_pts; ++idx) {             var x = idx * dx;             var y = h * Math.random();             if (idx === 0) {                 ctx.moveTo(x,y);             } else {                 ctx.lineTo(x,y);             }         }         ctx.lineTo(w, h / 2);         ctx.stroke();     }       drawLine(10000); In Chrome this takes about 7 milliseconds. In Qt, using the FancyBrowser example, it takes about 30,000ms. Even worse, if I repeatedly run the example its runtime degrades with each attempt, tacking on 20,000ms per attempt or so. I’m able to reproduce this w/ the download bundle for Qt 5.0, 5.1.1, and 5.2, with or without OpenGL support, whether Release or Debug build (albeit, Debug is yet slower). Does anybody know what’s going on? Oddly, it runs at a much more reasonable speed (though still an order of magnitude worse than Chrome) using the Qt 4.84 and 4.8.5 bundles. (I originally ran into this issue in a binary built against 4.8.4, and was hopeful 5 would fix it, so was troubled to see the problem in 5. I’m not yet sure why I’m seeing it in my Qt 4.8.4 binary but not the 4.8.4 bundled examples.)

WebView doesn't render

$
0
0
This bugreport [bugreports.qt-project.org] fully describes the problem. There is written that it closed in 5.0.2 version, but it appears in 5.1.1 version for me.

Disable touch-centric mouse handling in WebView?

$
0
0
Hi all, I’m playing around with WebView for the first time, hoping to integrate a JavaScript application into my Qt-based project. I noticed that mouse handling is more geared touch-based devices. In particular, Click+Drag scrolls the viewport (like a Flickable) instead of highlighting text, even in text input fields. Fancy apps like Google Maps don’t work well because WebView intercepts the mouse drag event. Is there a way to override the drag handler, to propagate the event down to the web page?

Plugin for video playback

$
0
0
Hi, The idea is to play a custom encoded network video in QtWebview. The video would be network streamed, decoded and then published in a “div” or some other tag. I would like to have any suggestion for following: 1) should i make a new thread for receiving encoded video and decoding it? 2) can we extend video tag to play our custom video playback implementation? 3) a suggestion for over all architecture, if you could suggest :-) The play should not be overlay, so that html can be rendered over the surface. I would also be making it work on raspberry pi using their hardware h264 decoder. All technical, link and code would be big help. regards,

Webpage rendered source accessible via qt console application

$
0
0
I need to do something like this: www(url) —> [ qtweb ] —> rendered source —> Perl/C++ processing I was advised to do something like this: QWebElement tmp = ui->browser->page()->mainFrame()->findFirstElement(“span#somehting”); qDebug() << tmp.toPlainText(); Problem is that I never need to see the rendered webpage. A console app would be best. I only need to have access to the rendered webpage source to extract the information I need. When I expanded the DOM Traversal Example to examine the rendered source the process ran at a snails pace.

Windows 7 theme causes problem in my view .. (video)

$
0
0
Hello to all I view a website and rendering dispute is whether I have the theme of windows 7 or windows 2000 theme .. See the video RadioButton on video http://videobam.com/wJKOI Can you help me with that? : (

Visual Studio debugger cannot step into QtWebkit.dll code

$
0
0
I’m trying to debug an issue I’m having with launching windows from Javascript in a web view. However, I cannot step into any QtWebkit.dll code from the Visual Studio debugger using Qt 4.8.5. E.g. a simple app: #include <QApplication> #include <QWebView>   int main(int argc, char** argv) {     QApplication app(argc, argv);       QWebView webView;     webView.load(QUrl("http://google.com"));     webView.show();       return app.exec(); } I can step into QApplication’s, QUrl’s, and QString’s constructors. I cannot, however, step into QWebview::load or any other QtWebkit.dll code. I’ve tried with both the pre-built binaries from qt-project.org as well as my own libraries built from source. Any suggestions?

Qt Webkit crashes with a specific website

$
0
0
Hi! Using Qt 5.1.1 I created a simple application with a QWebView (a MainWindow, layoutmanager and a QWebView). After loading a specified website AND using the arrows of the banner if I use the vertical scrollbar I get a segmentation fault. Debugging the code I get this message: ASSERTION FAILED: m_outlineBox == renderer()->outlineBoundsForRepaint(renderer()->containerForRepaint(), geometryMap) rendering\RenderLayer.cpp(554) : void WebCore::RenderLayer::updateLayerPositionsAfterScroll(WebCore::RenderGeometryMap*, WebCore::RenderLayer::UpdateLayerPositionsAfterScrollFlags) I am not sure if I might post the website, because I don’t want to advertise it, but you can reproduce the problem knowing it. http://rtister.com I checked it with firefox and it is working fine. I am trying to solve it with disabling the javascript only the main page… Do you have any other idea? Many thanks

QtWebKitWidgets error

$
0
0
Hello, I am new to using C++ with the Qt GUI framework and I’m writing a web browser. The only issue is using the QWebView. I write this line in the .pro file: QT += webkitwidgets And these errors come up: :-1: error: cannot find -lsqlite3 :-1: error: collect2: error: ld returned 1 exit status It’s really frustrating me…any help would be appreciated. Thnx in advance!

JPEG Stream

$
0
0
I’ve been trying to display a jpeg stream in QWebView. The html file shown in the QWebView is simple; uses img tag to set the source of the image to “http://localhost:9091” . Yet the QWebView shows nothing and I don’t see any errors either. Chrome or Safari have no problem displaying the stream. The content type in the header is correctly shown as image/jpeg . QWebView works just fine with static images … Is there a better way to display a jpeg stream? Appreciate help. Update It seems the culprit might still be Content-Type: multipart/x-mixed-replace …
Viewing all 542 articles
Browse latest View live