Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Given a snippet code in QWebpage section, what to put in the main cpp file ?
Forum Updated to NodeBB v4.3 + New Features

Given a snippet code in QWebpage section, what to put in the main cpp file ?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 891 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.
  • G Offline
    G Offline
    Ground
    wrote on last edited by
    #1

    I am reading QWebPage section in Qt docs.
    And I would like to test the snippet code done in this section.
    I wanted to try this code but i did not know how to make it completely works.

    • I know what to put in the header file : i've put the declaration of the class Thumbnailer.
      And i've add the needed classes :
      #include <QObject>

    #include <QtWebKitWidgets/QWebPage>

    #include <QWebFrame>

    #include <QPainter>

    • I've put the rest of the snippet code in a cpp file.

    • There is no problem at this step, but the problem* is what to put the main cpp file to make it visible ?*

    Here is the link of the QWebPage class reference where the snippet code is :
    http://qt-project.org/doc/qt-4.8/qwebpage.html

    Thanks in advance for any enligtenment or help about that :)

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      what do you want to achieve exactly?
      The Thumbnailer snippet code just renders a screenshot to an image.
      If you want to display this image set it on a QLabel and show the label.
      If you want to show the webpage in your application you have to use QWebView widget.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      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