我就是来存代码的。。。
main:
#include "tablewidget.h"
#include <QtWidgets/QApplication>
#include <QHBoxLayout>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
TableWidget w;
w.showMaximized();
return a.exec();
}
tablewidget:.h :
#ifndef TABLEWIDGET_H
#define TABLEWIDGET_H
#include <QTableWidget>
#include "ui_tablewidget.h"
class TableWidget : public QTableWidget
{
public:
TableWidget();
//bool readFile(const QString &fileName);
private:
QTableWidget *table;
};
#endif // TABLEWIDGET_H
tablewidget.cpp
#include "tablewidget.h"
#include <QtWidgets>
#include <QFile>
#include <vector>
#include<iostream>
#include <fstream>
int x=1;
int y=20;
int location = (x-1)*355+y;
double imageData[85425][33];
void readData() //读入一张图的数据
{
std::ifstream fin;
fin.open("Imagedata.txt");
if (fin.fail())
{
std::cout << "File open error!";
int m;
std::cin >> m;
}
else{
for (int i =