簡體   English   中英

Qt工具欄sigsegv分割錯誤錯誤

[英]Qt Toolbar sigsegv segmentation fault error

調試錯誤: http//puu.sh/3p8zM.png

我的工具欄屬性: http : //puu.sh/3p8Qo.png我的程序運行良好,直到我執行了很多撤消操作,現在在調試:(時出現此sigsegv錯誤。

我的代碼:

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "login.h"
#include <QAction>
#include <QWidget>
#include <qaction.h>

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

mainwindow::~mainwindow()
{
    delete ui;
}
void mainwindow::rPopulate()
{
    button = new QPushButton();
    button->setText("Message");
    //button->setIconSize(QSize(30,28));
    ui->toolBar->addWidget(button);
}
void mainwindow::rNew()
{

}

void mainwindow::rView()
{

}
 //ui->_menubar->addMenu(tr("&File"));

我收到一個sigsegv分段錯誤錯誤,因為在ui-> setupUi(this);之前調用了rPopulate()。

真是令人討厭。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM