Dears,
How to abort loading a URL when timeout? For example, if a start load a URL with :
const char *szUrl = “http://www.google.com”;
QUrl qUrl = QUrl(szUrl);
m_pWebView->load(qUrl);
If there is no response and timeout ,how can I abort this request?
Thanks and Regards,
Juzzy
↧
How to abort loading a URL in QTWebkit
↧
Qt5 Webkit - linking errors for libwebkitgtk-1.0.so:WebCore::GraphicsContext3D
Hi Geeks,
I am a little new to Qt and was trying to cross-compile QtWebkitQt5 module and is running into below issue
./.libs/libwebkitgtk-1.0.so: undefined reference to `WebCore::GraphicsContext3D::stencilMask(unsigned int)’
./.libs/libwebkitgtk-1.0.so: undefined reference to `WebCore::GraphicsContext3D::scissor(int, int, int, int)’
:
:
Any help is highly appreciated.
WebKit is configured as below
Build configuration:
1.0 Enable debugging (slow) : no
2.0 Compile with debug symbols (slow) : no
3.0 Enable debug features (slow) : no
4.0 Enable GCC build optimization : yes
5.0 Code coverage support : no
6.0 Unicode backend : icu
7.0 Font backend : freetype
8.0 Optimized memory allocator : yes
9.0 Accelerated rendering backend : opengl, egl)
Features:
===
10.0 Accelerated Compositing : yes
11.0 CSS3 Conditional Rules support : no
12.0 CSS3 background support : no
13.0 Filters support : yes
14.0 Gamepad support : no
15.0 Geolocation support : no
16.0 HTML5 video element support : yes
17.0 JIT compilation : autodetect
18.0 Media stream support : no
19.0 Opcode stats : no
20.0 SVG fonts support : yes
21.0 SVG support : yes
22.0 Spellcheck support : no
23.0 Web Audio support : no
24.0 WebGL : no
25.0 XHR timeout support : yes
26.0 XSLT support : no
WebKit2 support:
27.0 WebKit2 support : no
28.0 WebKit2 plugin process : no
GTK+ configuration:
29.0 GTK+ version : 2.0
30.0 GDK target : x11
31.0 GStreamer version : 0.10
32.0 Introspection support : no
33.0 Generate documentation : no
+++++++++++++++++++++++++++++++++++++++++++++++++++++
And QtBase is configured as below
Build options:
1.0 Build parts ………… libs
2.0 Mode ………………. release
3.0 Using C++11 ………… yes
4.0 Using PCH ………….. yes
5.0 Target compiler supports:
6.0 iWMMXt/Neon ………. no/no
Qt modules and options:
7.0 Qt D-Bus …………… yes (loading dbus-1 at runtime)
8.0 Qt Concurrent ………. yes
9.0 Qt GUI …………….. yes
10.0 Qt Widgets …………. yes
11.0 JavaScriptCore JIT ….. yes (To be decided by JavaScriptCore)
12.0 QML debugging ………. yes
13.0 Use system proxies ….. no
Support enabled for:
14.0 Accessibility ………. yes
15.0 ALSA ………………. yes
16.0 CUPS ………………. no
17.0 FontConfig …………. yes
18.0 Iconv ……………… yes
19.0 ICU ……………….. yes
11 Image formats:
20.0 GIF ……………… yes (plugin, using system library)
21.0 JPEG …………….. yes (plugin, using system library)
22.0 PNG ……………… yes (in QtGui, using system library)
23.0 Glib ………………. yes
24.0 GStreamer ………….. yes
25.0 GTK theme ………….. yes
26.0 Large File …………. yes
27.0 libudev ……………. yes
11 Networking:
28.0 getaddrinfo ………. yes
29.0 getifaddrs ……….. yes
30.0 IPv6 ifname ………. yes
31.0 OpenSSL ………….. yes (loading libraries at run-time)
32.0 NIS ……………….. yes
33.0 OpenGL …………….. yes (OpenGL ES 2.x)
34.0 OpenVG …………….. no
35.0 PCRE ………………. yes (bundled copy)
36.0 pkg-config …………. yes
37.0 PulseAudio …………. yes
38.0 QPA backends:
39.0 DirectFB …………. no
40.0 EGLFS ……………. no
41.0 KMS ……………… yes
42.0 LinuxFB ………….. yes
43.0 XCB ……………… yes (bundled copy)
44.0 MIT-SHM ………… yes
45.0 Xcursor ………… yes (loaded at runtime)
46.0 Xfixes …………. yes (loaded at runtime)
47.0 Xi …………….. no
48.0 Xi2 ……………. yes
49.0 Xinerama ……….. yes (loaded at runtime)
50.0 Xrandr …………. yes (loaded at runtime)
51.0 Xrender ………… yes
52.0 XKB ……………. yes
53.0 XShape …………. yes
54.0 XSync ………….. yes
55.0 XVideo …………. yes
56.0 Session management ….. yes
11 SQL drivers:
57.0 DB2 ……………… no
58.0 InterBase ………… no
59.0 MySQL ……………. no
60.0 OCI ……………… no
61.0 ODBC …………….. no
62.0 PostgreSQL ……….. no
63.0 SQLite 2 …………. no
64.0 SQLite …………… yes (plugin, using bundled copy)
65.0 TDS ……………… no
66.0 udev ………………. yes
67.0 xkbcommon ………….. yes
68.0 zlib ………………. yes (system library)
↧
↧
Latest Flash Player for OS X not working with Qt 4.8.n applications.
After the latest Flash Player update, to version 11.8.800.94, Flash areas in QWebView and QGraphicsWebView objects stopped working in OS X. GUI is never shown, but sound can be heard.
This happens at least using x86 OS X compiled versions of Qt 4.8.2 and 4.8.5 together with both our cross platform application and the “fancybrowser” example included with Qt (with one additional statement to enable plugins).
Qt 5.1.0 work fine in OS X, Windows applications based on Qt 4.8.n work fine and if we downgrade the OS X Flash player to some earlier version, like 11.7.700.232 things work fine too.
None of the examples at this page work: http://www.adobe.com/devnet/flash/samples.html
Update!
When using the non working Flash plugin the invalidRect argument passed to NPN_InvalidateRect (in “npapi.cpp”) always have the dimension (0, 0, 2000, 2000). When using working Flash plugins the area varies depending on GUI updates and always have more sane values.
Has anyone else experienced this problem? Is there a solution?
Thanks in advance!
/Roger
↧
Qt 5.1 QWebView Mouse Clicks Work but not Touch Clicks, but both work in Qt 4.8 QWebView
Hi,
I made an Windows 7 application on a QWidget that has an embedded QWebView.
I originally made it for Qt 4.8, and ported it to Qt 5.1 recently.
In Qt 4.8, on a Windows 7 Touch device, mouse clicking and touching the screen both result as a mouse click.
However, on Qt 5.1, mouse clicking and touching the screen still have the same result in my Application except with the QWebView. In the QWebView, mouse clicks work fine, but touching only highlights the link but no click is done. Everywhere else in my Application, touching works the same as the mouse clicks.
Is there some setting I must set? Here is my code for setting up the QWebView embedded browser:
QWebView * embeddedBrowser = new QWebView(this);
embeddedBrowser->setGeometry(embeddedBrowserRect);
embeddedBrowser->setVisible(true);
embeddedBrowser->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
embeddedBrowser->setAttribute(Qt::WA_AcceptTouchEvents);
embeddedBrowser->setAttribute(Qt::WA_InputMethodEnabled);
embeddedBrowser->setAttribute(Qt::WA_TouchPadAcceptSingleTouchEvents);
connect(embeddedBrowser, SIGNAL(linkClicked(QUrl)), this, SLOT(browserLinkClicked(QUrl)));
connect(embeddedBrowser, SIGNAL(loadProgress(int)), this, SLOT(browserLoadProgress(int)));
connect(embeddedBrowser, SIGNAL(selectionChanged()), this, SLOT(browserSelectionChanged()));
embeddedBrowser->setEnabled(true);
What am I missing? And thank you very much for any help. I really appreciate it,
e_dunstan
↧
Link - middle button click
I am trying to write a simple tab browser and everything is working ok but I have problem in implementing opening link in tab by clicking on it with the middle mouse button. I don’t know in what way I should check if link was clicked by left button or middle button?
What I have already tried:
I have set
webView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
Then I used linkClicked signal
connect(webView->page(), SIGNAL(linkClicked(QUrl)), this, SLOT(linkClickedSlot(QUrl)));
but in this slot I don’t know how to check what button was clicked. So I thought to reimplement mousePressEvent in QWebView:
void WebView::mousePressEvent(QMouseEvent *event)
{
//checking what mouse button was clicked (left, middle, right)
if(event->button() == Qt::LeftButton)
{
lastClickedMouseButton = 0;//left 0
}else if(event->button() == Qt::MidButton)
{
lastClickedMouseButton = 1;//middle 1
}else if(event->button() == Qt::RightButton)
{
lastClickedMouseButton = 2;//right 2
}
}
and then check lastClickedMouseButton value in linkClickedSlot
void Tab::linkClickedSlot(QUrl url)
{
if(webView->lastClickedMouseButton == 0)//left button
{
qDebug("left button clicked");
webView->setUrl(url);//opening clicked link in this page
}else if(webView->lastClickedMouseButton == 1)//middle button
{
qDebug("middle button clicked");
//creating new tab with clicked link
//will be added later
}else if(webView->lastClickedMouseButton == 2)//right button
{
qDebug("right button clicked");
}else
{
qDebug("unknown button clicked");
}
}
And it is more-less working – when I click once it is not working but it is working when I click fast few times… How should I check if the left or middle button was clicked in the correct way?
↧
↧
QWebView - jquery script problem
Hi,
I’m developping a simple HTML5 interface for an embedded system and for containers, i’ve decided to use iscroll4 plugin ( http://cubiq.org/iscroll-4 ) to animate a bit the scrolling.
The problem is that this plugin/script is not working. Also, I’m not receiving any errors on console if i’m enabling developing extras setting.
Also, i’ve tried to load directly this link : http://cubiq.org/dropbox/iscroll4/examples/simple/ in a QWebView object, but doesn’t work too.
Has anyone encountered this problem and knows a solution?
Thanks a lot!
↧
How to inherit the QWebView
Hi everyone :
I am writing a simple browser by using QWebView.But the QWebView do not meet my needs. So I want create my own widget inherited from QWebView.
I create a “QT Custom Designer Widget” project.And wrote a widget inherited from QWebView. At last I copy the DLL file that in the project release path to $QT_HOME\Qt5.1.0\Tools\QtCreator\bin\plugins;And restart the QT Creator.
But it does not work……………..
So,How could I create my own widget inherited from QWebView and use it in my project? Thanks.
↧
QMimeData::setUrls() and setData() with custom data type works works incorrect(different) from JS-side.
Hello,
I have an issue with QMimeData.
It works well in Qt 4.7.4, but it works in another way in Qt 4.8, Qt 5.1 (Win7).
My application is custom QWebView that shows some WebPage.
I have added some code on DropEvent but the issue can be reproduced even using browser-project from example.
1. Open browser(5.1) / fancybrowser(4.8.4) / fancybrowser(4.7.4) from example folder
2. Open test-html page:
<html>
<body>
<input name="First" size="40" ondrop=droph(event) ondragover="return false;"/>
</body>
</html>
<scrip_t>
function droph(event)
{
alert(event.dataTransfer.getData('text/uri-list'));
alert(event.dataTransfer.getData('text/plain'));
//console.log('PoolName', event.dataTransfer.getData('PoolName'));
}
</scrip_t>
3. Drag’n‘Drop file(-s) on input area on webPage.
Result (alerts()):
4.7.4 libs will show you links to files that you droped (‘text/uri-list’)
4.8.4 & 5.1.0 will show some Chinese chars first(‘text/uri-list’) and after that correct paths(‘text/plain’).
Chinese chars is some kind of another(incorrect?) encoding of data.
The same behavior for custom Mime-data. If I use
byteArrPoolName.append("MyNameOfPool");
mimeData->setData("PoolName", byteArrPoolName);
and after that try to get it in JavaScript
event.dataTransfer.getData('PoolName');
It returns incorrect charachters the same as in Uri case.
Please, help me. Because It blocks my application in migration to newer version of Qt and WebKit.
Thanks in advance.
↧
QNetworkReply and 302 Found code
Hi all,
I am developing an application that uses the Qt Webkit. I have this code :
void SignalHandler::ddlogin()
{
Manager = new QNetworkAccessManager();
QObject::connect(Manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(finished_login(QNetworkReply *)));
QNetworkRequest request;
request.setUrl(QUrl("http://ddunlimited.net/ucp.php?mode=login"));
request.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/x-www-form-urlencoded"));
request.setRawHeader("User-Agent", "Firefox/3.0.10");
QUrl params;
params.addQueryItem("username", *(Config->get_user_forum()) );
params.addQueryItem("password", *(Config->get_pass_forum()));
params.addQueryItem("redirect","index.php");
params.addQueryItem("login", "Login");
params.encodedQuery();
QNetworkReply *test = Manager->post(request,params.encodedQuery());
}
void SignalHandler::finished_login(QNetworkReply *reply)
{
QObject::disconnect(Manager, SIGNAL(finished(QNetworkReply *)),this,SLOT(finished_login(QNetworkReply *)));
QByteArray *temp = new QByteArray(reply->readAll());
QFile file("temp.html");
file.open(QIODevice::WriteOnly);
file.write(*temp);
file.close();
}
This code should make the login in forums based on phpbb3. It works for several forums, but it doesn’t work for a forum. The problem is that the reply->readAll() return an empty QByteArray. The same code works for others forum, and it returns the html page after the login.
I tried to debug the problem with a network analyzer and I saw that the server responds with the http response status code 302. It seems a sort of redirect, but I’m not sure. How can I handle this ? Is there a workaround ? Sorry for my english and sorry for my lack of experience.
Kind regards,
Stefano.
↧
↧
WebKit fails
int main(...)
{
QApplication app(argc, argv);
QWebView web;
web.load(QUrl::fromUserInput("vk.com"));
web.show();
QTextEdit txt;
txt.show();
return app.exec();
}
this little program fails(without any messages and without output), when you try to change scroll position. if you comment txt.show();, it will work correctly. could you help, please
p.s. windows 7
↧
Video tag play RTSP protocols of streaming media, sometime not have video , only have audio?
Video tag play RTSP protocols of streaming media, sometime not have video , only have audio?
↧
Play RTSP protocols of streaming media, no video?
Video tag play RTSP protocols of streaming media, sometime not have video , only have audio .
html
<video id=“video1” controls=“controls” width=“1200” height=“700” >
<source src=“rtsp://10.10.114.136:8554/” />
</video>
Qt 5.0.2 Webkit
ldong03412@gmail.com
Thank your help.
↧
QWebView and Jquery Print Area
Hello,
Am using the Jquery Print Area plugin/Jqprint [github.com] on my site so that it can print a particular <div> and not the whole page. The jquery works by evoking a print dialog in a browser, but when I access the site through a QWebView application the jquery doesn’t seem to work, no print dialog is shown. How do I get it to work in QWebView
Thanks in advance
↧
↧
evaluateJavaScript was removed in QtWebKit 3.0 ?
Hi,
When I use “evaluateJavaScript” method of WebView in QML by importing QtWebKit 3.0
I got the error “TypeError: Object [object Object] has no method ‘evaluateJavaScript’ “
How can I use “evaluateJavaScript” method of WebView? Do I need to import QtWebKit.experimental 1.0? but QtWebKit.experimental 1.0 is not available.
↧
Qt application could be minimized only once in Mac
Overview:
The logic to minimize the application using ‘window()->setWindowState(Qt::WindowMinimized)’ is only working for the first time in Mac. Successive call to the same after maximizing the window does not have any action.
Steps to Reproduce:
A Qt application was created with a ‘minimizeScreen’ button which has the action to minimize the window using a call to “window()->setWindowState(Qt::WindowMinimized)” .
#include “mainwindow.h”
#include “ui_mainwindow.h”
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect(ui->minButton, SIGNAL), this, SLOT));
}
void MainWindow :: minimizeWindow()
{
window()->setWindowState(Qt::WindowMinimized);
}
[\code]
Actual Results:
The window minimizes for the first time. Successive call to minimize does not have any action.
Expected Results:
The window must be minimized every time when the user presses the ‘minimizeScreen’ button.
Build Date & Platform:
Tried with QT 5.0.2 and QT 5.0.1 . OS : MAC OSX 10.8.3
↧
QT5.0.2 vs QT5.1.0
tag audio was disabled in version 5.1.0 QT?
↧
Flash, PDF and plugins
I realized now that in fact the contents of the plugin gets X and Y equal to 0 (zero)
Instead of using the X and Y position as webview.
See the picture:
example of the problem with AdobeReader and FoxitReader:
Maybe a bug in QT.
Example (bin and source):
http://www.mediafire.com/download/ukr17cjw8yrgr6w/webviewexample2.zip
Note:
Windows 7 32bit, 46bit
Windows 8 32bit
Adobe Reader 11
Adobe Flash 11
qt5.0.1, qt5.0.2, qt5.1.0
mingw4.8
↧
↧
Getting a higher quality image from QWebPage
I’m creating an image capture utility to allow uses to download snapshots of the charts and graphs that our web application generates. I’ve used the Framecapture [qt-project.org] example application as a starting point.
It works well, but the image quality is too low for our needs. I need to be able to created higher resolution images.
My understanding from reading the QWebPage documentation [qt-project.org] is that I need to increase the pixel density ratio in the Viewports Attributes.
Unfortunately, I cannot figure out how to do that. Seems like I might need to do something with the X11 server that QWebPage talks to to get the Viewports Attributes, but I’m not a real expert in any of this stuff, so am having a hard time figuring it out.
Could somebody please give me some pointers?
The code that I’m using is basically like this:
QWebPage m_page;
m_page.mainFrame()->load(url);
m_page.mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
m_page.mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
m_page.setViewportSize(1200,800);
QImage image(m_page.mainFrame()->contentsSize(), QImage::Format_ARGB32_Premultiplied);
image.fill(Qt::transparent);
QPainter painter(&image);
painter.setRenderHint(QPainter::Antialiasing, true);
painter.setRenderHint(QPainter::TextAntialiasing, true);
painter.setRenderHint(QPainter::SmoothPixmapTransform, true);
m_page.mainFrame()->documentElement().render(&painter);
painter.end();
image.save(fileName);
↧
QtWebKit for Wordpress theme development
Hello,
I want to know can I use the Qt’s qml to construct the wordpress themes, which can be published onto the Wordpress theme store.
I know that they are of the type *.php, but still the outer structure of the features, can be they be designed using the Qt WebKit.
↧
Add lib
What folder should I put hunspell (Windows)?
LIBS += -lhunspell
I tried adding the main folder of the project, tried to add the folder “src”, but both cause the following error:
error: cannot find -lhunspell
I tried doing this:
LIBS += -LC:/Users/cr/Desktop/QT/qtwebkit-plugins-master/src/hunspell
but this error occurs:
C:\Users\cr\Desktop\QT\qtwebkit-plugins-master\src\spellcheck\speller.cpp:57: error: undefined reference to Hunspell::Hunspell(char const*, char const*, char const*)
see all errors that occur in the following image:
↧