C:\Users\wuyimin\map-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK____\debug\map.exe 启动中...
Error - RtlWerpReportException failed with status code :-1073741696. Will try to launch the process directly
Qt: Untested Windows version 6.2 detected!
程序异常终止。
代码
头文件:
#ifndef ADMIN_H
#define ADMIN_H
#include <QtGui/QApplication>
#include <QDialog>
#include <QList>
#include <QStringList>
//#include <QTextStream>
#include <QFile>
namespace Ui {
class admin;
}
class admin : public QDialog
{
Q_OBJECT
public:
explicit admin(QWidget *parent = 0);
~admin();
QList<QString>Bcityname;
QList<int>Bcitynum;
QList<int>CX;
QList<int>CY;
void buildcity();
private slots:
void on_pushButton_clicked();
void on_pushButton_6_clicked();
private:
Ui::admin *ui;
};
#endif // ADMIN_H
cpp:
#include "admin.h"
#include "ui_admin.h"
#include <QFile>
#include <QTextStream>
admin::admin(QWidget *parent) :
QDialog(parent),
ui(new Ui::admin)
{
ui->setupUi(this);
}
admin::~admin()
{
delete ui;
}
void admin::buildcity()
{
QString cityname = ui->lineEdit->text();
Bcityname.append(cityname);
int citynum = ui->lineEdit_2->text().toInt();
Bcitynum.append(citynum);
int cityX = ui->lineEdit_3->text().toInt();
CX.append(cityX);
int cityY = ui->lineEdit_4->text().toInt();
CY.append(cityY);
}
void admin::on_pushButton_clicked()
{
buildcity();
}
void admin::on_pushButton_6_clicked()
{
QFile file("city.txt");
//if(file.open(IO_WriteOnly))
// {
QTextStream stream(&file);
// for(QStringList::Iterator it = Bcitynum.begin();it!=Bcitynum.end();++it)
stream<<"oo"<<"\n";
file.close();
// }
}
------解决方案--------------------
如果启动时报错,那么你这些代码中只有构造函数有些用处,但是它看起来没什么问题。
你还是先自己调试程序,定位一下错误在那儿吧。
------解决方案--------------------
调试运行,看是哪里出的问题。