PDA

View Full Version : what`s means this Error Message?



blm
15th September 2008, 15:54
building is no problem,
but can`t run it:

Microsoft Visual C++ Runtime Library(title)
Runtime Error
...
This application has requested the Runtime to terminate it in an unsusal way.
Please contact the application`s support team for more information.

my develop environment is Eclipse+ MinGW+QT4.4.0(open edition)

what`s wrong??:confused:

thanks for your Help!!
Jin

blm
15th September 2008, 16:57
i think there are some problem by my thread class:

#include <QtGui>

#include "header/processthread.h"

ProcessThread::ProcessThread()
{
m_FilePath = ":/in1.txt";
start();
}

ProcessThread::~ProcessThread()
{

}

void ProcessThread::DataRead()
{

}

void ProcessThread::run()
{
QVector<QPointF> data[6];
//double factX = 0.013;//factX = 0.0013;
double factY[6] = { 0.0008, 0.1, 0.2, 0.2, 0.1, 0.8 };
double offsY[6] = { +500, -55, +309, +308, 0, 0 };
int pos[6] = { 3, 6, 7, 8, 9, 10 };
QFile file(m_FilePath);
double offsX = 0.0;
QPointF newpoint;

if (file.open(QIODevice::ReadOnly)) {
QTextStream in(&file);
while (!in.atEnd()) {
QString line = in.readLine();
QStringList coords = line.split(' ',
QString::SkipEmptyParts);
if (coords.count() >= 6) {
//double x = factX * coords[0].toDouble();
double x = coords[0].toDouble();
if (data[0].isEmpty())
offsX = x;
// for (int i = 0; i < 6; ++i) {
int i = 4;
double y = coords[pos[i]].toDouble();
data[i].append(QPointF(x - offsX,
factY[i] * (y - offsY[i])));
newpoint = QPointF(x - offsX,
factY[i] * (y - offsY[i]));
//--------------Emit signals
if (data[i].size() >= 1000) {
emit newscreen(true);
emit newDataCome(newpoint);
}
else
{
emit newscreen(false);
emit newDataCome(newpoint);
}

// }
}
}
}

}

void ProcessThread::setFilePath(const QString& FilePath)
{
m_FilePath = FilePath;
}

blm
15th September 2008, 16:58
than is the implement

#ifndef PROCESSTHREAD_H_
#define PROCESSTHREAD_H_

#include <QImage>
#include <QMutex>
#include <QVector>
#include <QQueue>
#include <QThread>
#include <QWaitCondition>

class ProcessThread : public QThread
{
Q_OBJECT

public:
ProcessThread();
~ProcessThread();
void DataRead();
void setFilePath(const QString& FilePath);

signals:
void newscreen(bool ns);
//bool newscreen();
void newDataCome(QPointF newPoint);
//void newCommandCome();



protected:
void run();

private:
QString m_FilePath;
//QVector<QPointF> data;
//QWaitCondition newDataReady;
//QMutex mutex;


};

//extern ProcessThread processthread;
#endif /*PROCESSTHREAD_H_*/