Полный текст ошибки:
Запускается C:\Qt\Projects\build-Calculator-Desktop_Qt_5_3_MinGW_32bit-Debug\debug\Calculator.exe...
ASSERT: "d" in file ..\..\include/QtCore/../../src/corelib/tools/qscopedpointer.h, line 120
C:\Qt\Projects\build-Calculator-Desktop_Qt_5_3_MinGW_32bit-Debug\debug\Calculator.exe завершился с кодом 3
В проекте 3 файла, сам проект в стадии разработки и уже на начальных этапах такая ерунда.
1. MyWind.h
#ifndef MYWIND_H
#define MYWIND_H
#include <QDialog>
#include <QWidget>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QHBoxLayout> //горизонт
#include <QVBoxLayout> //вертикаль
class MyWind : public QDialog
{
Q_OBJECT //макрос
public:
MyWind(QWidget *parent=0); //конструктор
private:
QLabel *lbl;
QLineEdit *line;
QPushButton *one;
QPushButton *two;
QPushButton *three;
QPushButton *four;
QPushButton *five;
QPushButton *six;
QPushButton *seven;
QPushButton *eight;
QPushButton *nine;
QPushButton *zero;
QPushButton *point;
QPushButton *reset;
QPushButton *plus;
QPushButton *minus;
QPushButton *div;
QPushButton *mult;
};
#endif // MYWIND_H
2. Mywind.cpp
#include "MyWind.h"
MyWind::MyWind(QWidget *parent) : QDialog(parent)
{
lbl = new QLabel("0");
line = new QLineEdit("0");
one = new QPushButton("1");
two = new QPushButton("2");
three = new QPushButton("3");
four = new QPushButton("4");
five = new QPushButton("5");
six = new QPushButton("6");
seven = new QPushButton("7");
eight = new QPushButton("8");
nine = new QPushButton("9");
zero = new QPushButton("0");
reset = new QPushButton("c");
plus = new QPushButton("+");
minus = new QPushButton("-");
div = new QPushButton("/");
mult = new QPushButton("*");
QHBoxLayout *lay1 = new QHBoxLayout;
lay1->addWidget(lbl);
lay1->addWidget(line);
QVBoxLayout *lay2 = new QVBoxLayout;
lay2->addWidget(one);
lay2->addWidget(four);
lay2->addWidget(seven);
lay2->addWidget(zero);
QVBoxLayout *lay3 = new QVBoxLayout;
lay3->addWidget(two);
lay3->addWidget(five);
lay3->addWidget(eight);
lay3->addWidget(point);
QVBoxLayout *lay4 = new QVBoxLayout;
lay4->addWidget(three);
lay4->addWidget(six);
lay4->addWidget(nine);
lay4->addWidget(reset);
QHBoxLayout *lay5 = new QHBoxLayout;
lay5->addWidget(plus);
lay5->addWidget(minus);
QHBoxLayout *lay6 = new QHBoxLayout;
lay6->addWidget(div);
lay6->addWidget(mult);
QVBoxLayout *lay8 = new QVBoxLayout;
lay8->addLayout(lay5);
lay8->addLayout(lay6);
QHBoxLayout *lay7 = new QHBoxLayout;
lay7->addLayout(lay2);
lay7->addLayout(lay3);
lay7->addLayout(lay4);
lay7->addLayout(lay8);
QVBoxLayout *main = new QVBoxLayout;
main->addLayout(lay1);
main->addLayout(lay7);
setLayout(main);
setWindowTitle("Калькулятор");
}
3. main.cpp
#include <QApplication>
#include "MyWind.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MyWind *wind = new MyWind();
wind->show();
return a.exec();
}