Skip to content

Qt WebKit

Questions about Qt WebKit and related topics? Post here!
1.5k Topics 5.9k Posts
  • Problem trying to use python2.7 instead of python2.6

    2
    0 Votes
    2 Posts
    943 Views
    SGaistS
    Hi and welcome to devnet, As silly as it may sound, you would have to give cmake the path to find your python 2.7
  • QWebView does not refresh [SOLVED]

    5
    0 Votes
    5 Posts
    5k Views
    p3c0P
    Glad that its working. You're Welcome :) You might also want to look at "Qt Resource System":http://doc.qt.io/qt-5/resources.html.
  • JSON Parse

    3
    0 Votes
    3 Posts
    1k Views
    F
    Hey, Now I just figure it out. Thanks :) However I will show the code in case there is anyone with the same problem. Maybe there is another more elegant way to get to the "x", "y" values and read it but for the moment this one is working: @QJsonObject jsonObj = jsonResponse.object(); QJsonValue value=jsonObj.value("locations"); QJsonArray array=value.toArray(); foreach(const QJsonValue & v, array) { qDebug() << "Name:" << v.toObject().value("name").toString(); qDebug() << "Longitude:" <<v.toObject().value("feature").toObject().value("geometry").toObject().value("x").toDouble(); qDebug() << "Latitude:" <<v.toObject().value("feature").toObject().value("geometry").toObject().value("y").toDouble(); }@
  • Problem converting html to pdf on Windows

    2
    0 Votes
    2 Posts
    973 Views
    J
    I found this simple solution on StackOverflow @from PyQt4.QtGui import QTextDocument, QPrinter, QApplication import sys app = QApplication(sys.argv) doc = QTextDocument() doc.setHtml(''' <html> <body> <h1>Page 1</h1> </body> </html> ''') printer = QPrinter() printer.setOutputFileName("foo.pdf") printer.setOutputFormat(QPrinter.PdfFormat) doc.print_(printer)@
  • Qt5.4 webkit flash plugin not detected on Windows

    5
    0 Votes
    5 Posts
    3k Views
    C
    Hello, AFAIK my flash plugin is up to date. I ended up porting my app to Qt 4.8.6 on Windows (not a big deal, the code is a bit less clean but I can live with that). I've tried the new Qt Web Engine but it does not support flash yet. I'll keep an eye on the webengine project and will port my app when flash support is ready.
  • 0 Votes
    1 Posts
    875 Views
    No one has replied
  • QWebView not respecting html <thead>

    9
    0 Votes
    9 Posts
    3k Views
    S
    oh, sorry. I think webkit can't recognize the begin and end of page. And TBODY tag (as wrote ThatDude can't help in this case, it's usefull for block formatting)
  • Qt webkit browser getting crashed when opening any page

    18
    0 Votes
    18 Posts
    6k Views
    E
    Hey vattipalli, I'd be happy to share with you some of my build time materials for QtWebKit. It is important to note that my build environment is for OpenEmbedded based on the Yocto project, so I used the meta-qt5 bitbake recipes. The patches used for Qt5.4.0 are listed here: https://github.com/meta-qt5/meta-qt5/tree/master/recipes-qt/qt5/qtbase https://github.com/meta-qt5/meta-qt5/tree/master/recipes-qt/qt5/qtwebkit My qmake.conf is listed in qtbase-opensource-src-5.4.0/mkspecs/linux-oe-g++ . You can find the qtbase-opensource-src tarball here: http://download.qt.io/official_releases/qt/5.4/5.4.0/submodules/ This is what my qmake.conf looks like: @MAKEFILE_GENERATOR = UNIX CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib include(../common/linux.conf) QMAKE_<TOOL> (moc, uic, rcc) are gone, overwrite only ar and strip QMAKE_AR = $(OE_QMAKE_AR) cqs QMAKE_STRIP = $(OE_QMAKE_STRIP) QMAKE_WAYLAND_SCANNER = $(OE_QMAKE_WAYLAND_SCANNER) include(../common/gcc-base-unix.conf) *FLAGS from gcc-base.conf QMAKE_CFLAGS += $(OE_QMAKE_CFLAGS) QMAKE_CXXFLAGS += $(OE_QMAKE_CXXFLAGS) QMAKE_LFLAGS += $(OE_QMAKE_LDFLAGS) include(../common/g++-unix.conf) tc settings from g++-base.conf QMAKE_COMPILER = $(OE_QMAKE_COMPILER) QMAKE_CC = $(OE_QMAKE_CC) QMAKE_CXX = $(OE_QMAKE_CXX) QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $(OE_QMAKE_CFLAGS) QMAKE_LINK = $(OE_QMAKE_LINK) QMAKE_LINK_SHLIB = $(OE_QMAKE_LINK) QMAKE_LINK_C = $(OE_QMAKE_LINK) QMAKE_LINK_C_SHLIB = $(OE_QMAKE_LINK) for the SDK isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG = $(OE_QMAKE_QT_CONFIG) load(qt_config)@ Another point that is important to get QtWebKits compiled & installed is to make sure your configuration options are enabled/disabled correctly. For example, the ICU (international components for unicode) needs to be enabled when configuring Qt base, which passes on these configuration options to QtWebKits. Listed below are my configuration options that I set: @ ${S}/configure -v -opensource -confirm-license -sysroot ${STAGING_DIR_TARGET} -no-gcc-sysroot -prefix ${OE_QMAKE_PATH_PREFIX} -bindir ${OE_QMAKE_PATH_BINS} -libdir ${OE_QMAKE_PATH_LIBS} -datadir ${OE_QMAKE_PATH_DATA} -sysconfdir ${OE_QMAKE_PATH_SETTINGS} -docdir ${OE_QMAKE_PATH_DOCS} -headerdir ${OE_QMAKE_PATH_HEADERS} -archdatadir ${OE_QMAKE_PATH_ARCHDATA} -libexecdir ${OE_QMAKE_PATH_LIBEXECS} -plugindir ${OE_QMAKE_PATH_PLUGINS} -importdir ${OE_QMAKE_PATH_IMPORTS} -qmldir ${OE_QMAKE_PATH_QML} -translationdir ${OE_QMAKE_PATH_TRANSLATIONS} -testsdir ${OE_QMAKE_PATH_TESTS} -examplesdir ${OE_QMAKE_PATH_EXAMPLES} -hostbindir ${OE_QMAKE_PATH_HOST_BINS} -hostdatadir ${OE_QMAKE_PATH_HOST_DATA} -external-hostbindir ${OE_QMAKE_PATH_EXTERNAL_HOST_BINS} -platform ${OE_QMAKESPEC} -xplatform linux-oe-g++ -qpa eglfs -eglfs -no-kms -opengl es2 -shared \ -silent -no-pch -no-rpath -pkg-config -no-xcb -no-sql-db2 -no-mtdev \ -no-gtkstyle -nomake tests -system-libjpeg -openssl-linked \ -nomake examples -no-xfixes -no-sql-mysql -make tools -qt-pcre -no-iconv -no-xkb -no-xkbcommon -fontconfig -no-kms -no-sql-sqlite -system-libpng -tslib -icu -no-directfb -no-glib -freetype -no-sql-oci -no-xinerama -evdev -no-sql-sqlite2 -accessibility -widgets -no-xrandr -no-linuxfb -libudev -no-xcursor -no-sql-psql -make libs -no-nis -no-openvg -no-xvideo -no-xsync -no-sql-tds -no-xshape -dbus -system-zlib -pulseaudio -no-xrender -no-mitshm -no-sm -no-xinput -no-sql-ibase -no-xinput2 -no-alsa -no-sql-odbc -release \ @ Additionally, if you provide with me your error messages, I can help you further back trace your problem [= Hope this helps!
  • Qt5 + eglfs + webkit causes segmentation fault

    12
    0 Votes
    12 Posts
    9k Views
    E
    I'm working with Qt5.4.0(eglfs)-qtwebkits-example-example built in an OpenEmbedded environment, cross-compiled with arm-gnueabihf 4.7 (linaro) with TI am335x ARM processor and using TI SDK 5_01_01_01 for graphic drivers and library support. All Qt packages will compile, install, and build on my rootfs images. I can run native examples like 'Qt5_CinematicExperience' When I go to launch ./browser inside /usr/share/qt5/examples/webkitwidgets/browser directory, I automatically get a 'Segmentation Fault'. I read one forum that to run browser, you had to give the argument of './browser -display www.google.com' . Are there other arguments or commands you need to pass when trying to run this example*?* Additionally, I know that a few export run-time commands are required for Qt, like: export QT_QPA_EGLFS_PHYSICAL_WIDTH=197 export QT_QPA_EGLFS_PHYSICAL_HEIGHT=111 I am wondering if there are any other export commands I need to run by Qt for it to run these webkit examples. All qtwebkit examples are giving Segmentation fault. Any suggestions or comments would go a long way as this is my first time working with QtWebKit-Examples. [=
  • QtUiTools lib issue during cross compilation

    7
    0 Votes
    7 Posts
    3k Views
    K
    This post looks to be as similar as "QtUiTools":http://qt-project.org/forums/viewthread/51144/ (Updating this post, for the benefit of others, who refers this forum post)
  • Can I do this? Or is there a better way?

    1
    0 Votes
    1 Posts
    685 Views
    No one has replied
  • HTML5 Audio events with QWebView

    1
    0 Votes
    1 Posts
    873 Views
    No one has replied
  • Process QWebPage content in background thread

    9
    0 Votes
    9 Posts
    5k Views
    T
    @crayze My approach will work if you don't try to access javascript again and block in the other call. You have a choice to ether use window.onload event to start long calculations automatically like this: Attach a slot to the QWebFrame::javascriptWindowObjectCleared() signal. At this point, call QWebFrame::evaluateJavascript() to add code similar to the following: window.onload = function() { // page has fully loaded } or to do this on button click calling evaluateJavaScript("setTimeout( yourFn, 0 );") this is asynchronous call and will return immediately ..then you have to periodically check (on timer) your global variables in java-script if it has finished and grab the result when done ...and don't block main event loop for too long WebKit might need it too Not all code executed inside WebKit need synchronized access to main GUI thread but once in a while ..based on my experience if you block extensively GUI thread WebKit becomes extremely sluggish sometimes so long story short - WebKit executes in its own thread(s) but when it needs access to GUI thread that access must be synchronized access so if your long calculation is just that - calculation chances are WebKit won't talk to GUI thread that often but if your longCalc function changes HTML elements/Widgets a lot e.g. delete/move/create HTML elements then yes - that could be a problem but only if you block GUI thread for long periods - otherwise as long as your app is truly asynchronous you don't need to do anything - message pump i.e. main event loop started with app.exec(); is working behind the scenes and does its magic :-) The only problem if you don't block in another call to evaluateJavascript after the async one "setTimeout( yourFn, 0 );" is if you have heavy calculations in your main/GUI thread - do as Webkit, move it to a separate thread and only do/wait for synchronized access with main/GUI thread to exchange data Of course you can go the "addToJavaScriptWindowObject" route that requires a lot more work i.e. code but that will save only the onTimer checks when the result is ready (vs callback) and you still have to make sure you don't block in another call to evaluateJavascript or e.g. blocking main/GUI thread by heavy calculations in C++ that could block or slow down WebKit significantly HTH
  • 0 Votes
    2 Posts
    2k Views
    K
    Well I solved this problem after a few sleepless nights by my own. I still don't know why it doesn't need the connect method in the QWebview but in the Html5ApplicationViewer. Anyway, all what count is that it works now^^ I had to add in my JavaScriptController @JavaScriptController::JavaScriptController(QObject *parent, QWebFrame *_webFrame) : QObject(parent) { webFrame = _webFrame; QObject::connect(webFrame,SIGNAL(javaScriptWindowObjectCleared()), SLOT(addToJavaScript())); } void JavaScriptController::addToJavaScript() { webFrame->addToJavaScriptWindowObject("MyQtJavaScriptController", this); }@
  • 0 Votes
    7 Posts
    2k Views
    SGaistS
    No, you posted a link to the bug report system main page, not the specific bug entry that was already created
  • Building Qtwebkit from Qt5.3 tarball only configured to build webkit1

    2
    0 Votes
    2 Posts
    962 Views
    2
    Hi, where do you get your Qtwebkit source code? Maybe it's not the correct one?
  • QWebView don't interact correctly with AJAX

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • [QWebView] HTML5 video with Hardware Decoding

    11
    0 Votes
    11 Posts
    6k Views
    B
    Noted, thank you Guilherme~
  • [Qt 4.8.5] Jpeg/Gif Issue/problem

    6
    0 Votes
    6 Posts
    2k Views
    SGaistS
    git clone setup-patch ? There's no other tool to clone Qt's code. You already have webkit in Qt 4 sources.
  • Encrypted Media Extensions and Media Source Extensions support?

    5
    0 Votes
    5 Posts
    3k Views
    B
    Maybe this is initial implement (maybe requires manual compile/build).