Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8953695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:09:23+00:00 2026-06-15T14:09:23+00:00

Just trying to make a simple web viewer app so I can view a

  • 0

Just trying to make a simple web viewer app so I can view a webpage in a widget and I am getting the error:

QWidget: Must construct a QApplication before a QPaintDevice

I feel like this is a problem with the webkit? I am statically linking this project.

mainwindow.cpp

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QtGui>
#include <QWebPage>
#include <QtWebKit>
#include "Windows.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QWebView *view = new QWebView(parent);
         view->load(QUrl("http://google.com/"));
         view->show();

}

MainWindow::~MainWindow()
{
    delete ui;
}

main.cpp

#include "mainwindow.h"
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    MainWindow w;
    w.show();

    return a.exec();
}

.pro file

QT       += core gui webkit network

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = webkittest
TEMPLATE = app


SOURCES += main.cpp\
        mainwindow.cpp

HEADERS  += mainwindow.h

FORMS    += mainwindow.ui

header file

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QWebView>
#include <QUrl>
#include <QtPlugin>
#include <QGridLayout>
#include <QSystemTrayIcon>
#include <QMenu>
#include <QMessageBox>
#include <QDialog>
#include <QtWebKit>

class QAction;
 class QCheckBox;
 class QComboBox;
 class QGroupBox;
 class QLabel;
 class QLineEdit;
 class QMenu;
 class QPushButton;
 class QSpinBox;
 class QTextEdit;


namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

protected:
     //void closeEvent(QCloseEvent *event);
     //void keyPressEvent(QKeyEvent *);

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

signals:


private slots:
        //void onSslErrors(QNetworkReply* reply, const QList<QSslError> &errors);

private:
    Ui::MainWindow *ui;
    QWebView* m_pWebView;

#endif // MAINWINDOW_H

Any ideas what could be causing that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:09:24+00:00Added an answer on June 15, 2026 at 2:09 pm

    Fixed this by installing the latest version of Qt framework and dynamically linking webkit as they have disable static linking.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to make a simple web app. I have a User table
i'm trying to make a very simple YACC parser on Pascal language which just
I just went through trying to make an alarm clock app with local notifications
I'm trying to make it working for quite some time,but just can't seem to
How can I disable tinyMCE? I'm not trying to make tinyMCE not exist, just
No, I'm not trying to make an annoying popup. I have a simple webpage
I am trying to migrate a simple WinForms app to a ASP.Net web app.
I have been trying to make a simple web service and have been following
I'm trying to make an app that can work on multiple devices. Desktop, Mobile
I'm trying to make a simple C# web server that, at this stage, you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.