Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. Strange behavior: QWebView with QCoreApplication and QApplication
Forum Updated to NodeBB v4.3 + New Features

Strange behavior: QWebView with QCoreApplication and QApplication

Scheduled Pinned Locked Moved Qt WebKit
1 Posts 1 Posters 675 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    eugen_1102
    wrote on last edited by
    #1

    Hallo,

    i am new to QT and don't understand the following behavior:

    When i use the following code to display a HTML-GUI the "Browser-App" is not able to display images:
    @
    #include <QtGui>
    #include <QWebView>
    #include <QGraphicsWebView>
    #include <iostream>

    int main(int argc, char **argv)
    {
    QApplication app(argc, argv);

    QStringList args = app.arguments();
    if (args.count() != 2)
    {
    std::cerr << "pass the URL please\n" << endl;
    return 1;
    }

    QWebView view;
    view.load(QUrl(args[1]));
    view.setWindowFlags(Qt::FramelessWindowHint);
    view.showMaximized();
    view.show();
    return app.exec();
    }
    @

    Then i changed the Code and add this 3 Lines direct after "QApplication app(argc, argv);"

    @
    QCoreApplication::setOrganizationName(QLatin1String("Qt"));
    QCoreApplication::setApplicationName(QLatin1String("demobrowser"));
    QCoreApplication::setApplicationVersion(QLatin1String("0.1"));
    @

    And the images are displayed !
    What is the reason for that?
    Also it is strange, that i have to leave the values as they are.
    Changing "0.1" or "demobrowser" to something else results in not displaying the images!

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved