Raspberry Pi 2 Qt 应用程序崩溃

Raspberry Pi 2 Qt app crash

我的应用程序随机崩溃。我已经使用 web view 加载了一些 URL,但总是有警告。

qnetworkreplyimplprivate :: error: internal problem, this method must only called ones stack

#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    setAcceptDrops(true);
    web->load(QString("http:my url"));
//    QThread *webThread = new QThread;
//    web.moveToThread(webThread);
    web->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); //Handle link clicks by yourself

    connect(web, SIGNAL(linkClicked(QUrl)),this,SLOT(urlCliked(QUrl)));
    web->showMaximized();
}

web 指针悬空。它应该初始化为指向某物。你可能需要这样的东西:

web = new QWebView(this);

在访问 web 之前在构造函数中,如 web->load(QString("http:my url"));

您还需要包含相应的 header:

#include <QWebView>

我在 raspberry pi 2 上使用 Qt 5.3 版,我发现我在 Qt 中使用了不正确的 gcc 版本。 所以确保使用相同的 Qt 版本和正确的 gcc 版本。