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. QWebPage and non-GUI app

QWebPage and non-GUI app

Scheduled Pinned Locked Moved Qt WebKit
7 Posts 5 Posters 7.7k Views
  • 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.
  • O Offline
    O Offline
    olric86
    wrote on last edited by
    #1

    Hi to all!!

    This is my first post in this forum. I'm learning Qt and I'm trying to manipulate some web pages from a console qt app.

    I started this little program because in the QWebPage documentation there is the following statement, that maybe, I'm not getting correctly (Qt 4.6.3):

    "This class is not part of the Qt GUI Framework Edition.

    Inherits QObject.

    This class was introduced in Qt 4.4."

    I understood that this class can be used even in a "widget-less" application, am I wrong?

    If this is not the case what does the "This class is not part of the Qt GUI Framework Edition" statement mean?

    However, if I try to instantiate a QWebPage in a simple object's constructor the program crashes prompting this:

    QWidget: Cannot create a QWidget when no GUI is being used.

    Is there a way to use QtWebkit capabilities in a console app ??

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Franzk
      wrote on last edited by
      #2

      If an object does not inherit QWidget, you can usually use it in a non-gui application. However, this one seems particularly geared towards providing something for a GUI (menu's and stuff). However, they state in the documentation that you should be able to use it in a widget-less environment.

      [quote]QWebPage holds a main frame responsible for web content, settings, the history of navigated links and actions. This class can be used, together with QWebFrame, to provide functionality like QWebView in a widget-less environment.[/quote]

      I've tested it and it seems to want to create a QPushButton.

      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • O Offline
        O Offline
        olric86
        wrote on last edited by
        #3

        That's what I thought too! So either the documentation is wrong or there is something wrong with the implementation....

        But still I'll be very glad if someone knows how to use a QWebElement from a non-gui app.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          benjamin.poulain
          wrote on last edited by
          #4

          I understood that this class can be used even in a “widget-less” application, am I wrong?

          Widget less in the sense no QWidget. You can render on any windows surface (graphics view for example, like the new QGraphicsWebView).

          This class is not part of the Qt GUI Framework Edition.

          This just says QtWebKit is not a part of Qt GUI.

          Is there a way to use QtWebkit capabilities in a console app ??

          You do a console app with QtWebKit, but you still need the dependency on QtGui and a connection to the graphic server (if only in order to get the fonts...). There are plenty of such tool, look at http://code.google.com/p/wkhtmltopdf/ for example.

          1 Reply Last reply
          0
          • O Offline
            O Offline
            ogoffart
            wrote on last edited by
            #5

            The "Qt GUI Framework Edition" is one of the editions of the comertial licenses.

            http://doc.trolltech.com/4.6/commercialeditions.html

            1 Reply Last reply
            0
            • Q Offline
              Q Offline
              QBall
              wrote on last edited by
              #6

              Does anyone have any ideas which versions of Qt have this problem and which versions don't? I tried it on 4.6.3 and it has the problem and was wondering if anyone could recommend a version which doesn't (maybe the prerelease versions of 4.7?).

              I need to compile the versions and don't really want to compile another version only to find that it also doesn't work (It takes me 4-5 hours to compile).

              1 Reply Last reply
              0
              • B Offline
                B Offline
                benjamin.poulain
                wrote on last edited by
                #7

                [quote author="QBall" date="1284512003"]Does anyone have any ideas which versions of Qt have this problem and which versions don't?[/quote]

                Which problem? Have you read the replies of the original post?

                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