QWebView - QWidget: debe construir una aplicación antes de un error QPaintdevice

StackOverflow https://stackoverflow.com/questions/8936489

  •  30-10-2019
  •  | 
  •  

Pregunta

Cada vez que intento crear una nueva visión QWebView, el error posterior a la construcción es

QWidget: Must construct a QApplication before a QPaintDevice

¿Por qué está pasando esto?

Si, agregué QT += webkit al archivo profesional, y dice aquí

En qwtconfig.pri

Config += qwtdll Esta línea debe ser ->

#Config += qwtdll

¿Dónde está qtwconfig.pri?

FWI estoy en una construcción estática

Aquí está Main ()

#include "MyWidget.h"
#include <QPlastiqueStyle>
#include <QtPlugin>
#include <QtWebKit/QWebView>
Q_IMPORT_PLUGIN(qico)


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

QApplication app(argc, argv);

app.setStyle(new QPlastiqueStyle);
app.setFont(QFont("Calibri"));
MyWidget widget;
widget.show();

QWebView w;
    w.show();

return app.exec();

}

No hay solución correcta

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top