QWebView - Qwidget: deve costruire una Qapplication prima di un errore QPaintDevice

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

  •  30-10-2019
  •  | 
  •  

Domanda

Ogni volta che provo a creare un nuovo QWebView, l'errore post-build è

QWidget: Must construct a QApplication before a QPaintDevice

perché sta succedendo?

Sì, ho aggiunto QT += webkit al file pro, e dice qui

In qwtconfig.pri

Config += qwtdll questa riga deve essere ->

#Config += qwtdll

dov'è qtwconfig.pri?

FWI Sono su una build statica

Ecco 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();

}

Nessuna soluzione corretta

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top