crossplatform.ru

Здравствуйте, гость ( Вход | Регистрация )

> Ошибка в коде, Ошибка в коде
cer80
  опции профиля:
сообщение 2.6.2013, 18:35
Сообщение #1


Новичок


Группа: Новичок
Сообщений: 4
Регистрация: 2.6.2013
Пользователь №: 3846

Спасибо сказали: 0 раз(а)




Репутация:   0  


Подскажите пожалуйста что не так с кодом.
В общем программа написана на языке с++ с добавлением библиотеки QT 4.8.4 в Visual Studio 2010 Ultimate 10
Cам код программы :

Файл TTMSMainWindow.h
 
#ifndef TTMSMAINWINDOW_H
#define TTMSMAINWINDOW_H
#include <QMainWindow>
#include <managerwindow.h>
#include <ticketmanagerwindow.h>
#include <QFile>
#include <QTextStream>
namespace Ui {
class TTMSMainWindow;
}
class TTMSMainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit TTMSMainWindow(QWidget *parent = 0);
~TTMSMainWindow();
ManagerWindow manager;
TicketManagerWindow ticket;
private:
Ui::TTMSMainWindow *ui;
private slots:
void on_commandLinkButton_clicked();
};
#endif // TTMSMAINWINDOW_H

Файл TTMSMainWindow.cpp
#include "ttmsmainwindow.h"
#include "ui_ttmsmainwindow.h"
TTMSMainWindow::TTMSMainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::TTMSMainWindow)
{
ui->setupUi(this);
}
TTMSMainWindow::~TTMSMainWindow()
{
delete ui;
}
void TTMSMainWindow::on_commandLinkButton_clicked()
{
QString userLoginInput = ui->loginLineEdit->text();
QString userPassInput = ui->passLineEdit->text();
QFile crewManager("C:\\Users\\Oleksiy\\Documents\\managers.txt");
if( crewManager.open(QIODevice::ReadOnly) )
{
QTextStream stream(&crewManager);
QString str;
while( !stream.atEnd() )
{
str = stream.readLine();
if( userLoginInput == str )
{
if( (str = stream.readLine()) == userPassInput )
{
this->hide();
this->manager.show();
return;
}
}
}
}
crewManager.close();
QFile crewSeller("C:\\Users\\Oleksiy\\Documents\\sellers.txt");
if( crewSeller.open(QIODevice::ReadOnly) )
{
QTextStream stream(&crewSeller);
QString str;
while( !stream.atEnd() )
{
str = stream.readLine();
if( userLoginInput == str )
{
if( (str = stream.readLine()) == userPassInput )
{
this->hide();
this->ticket.show();
return;
}
}
}
}
crewSeller.close();
}
Файл Main.cpp
#include <QtGui/QApplication>
#include "ttmsmainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
TTMSMainWindow w;
w.show();
return a.exec();
}

Файл ManagerWindow.h
#ifndef MANAGERWINDOW_H
#define MANAGERWINDOW_H
#include <QMainWindow>
#include <QFile>
#include <QTextStream>
#include <QTableWidgetItem>
namespace Ui {
class ManagerWindow;
}
class ManagerWindow : public QMainWindow
{
Q_OBJECT
public:
explicit ManagerWindow(QWidget *parent = 0);
~ManagerWindow();
private:
Ui::ManagerWindow *ui;
int currMatchIndex;
QString tourName;
QString tourCity;
QString tourClub;
QString tourDateStart;
QString tourDateEnd;
QString tourHotel;
QString tourFund;
QString tourType;
int tourNumOfPlayers;
QVector<QString> playersVector;
private slots:
void on_finPlPushButton_clicked();
void on_finJdgPushButton_clicked();
void on_cancelJudgePushButton_2_clicked();
void on_acceptJudgePushButton_2_clicked();
void on_cancelPropPushButton_clicked();
void on_acceptPropPushButton_clicked();
void on_createTourBtn_clicked();
void on_generatePushButton_clicked();
void on_finishPushButton_clicked();
void on_sendPushButton_clicked();
//void on_pushButton_2_clicked();
void on_addMatchPushButton_clicked();
};
#endif // MANAGERWINDOW_H
Файл ManagerWindow.cpp
#include "managerwindow.h"
#include "ui_managerwindow.h"
ManagerWindow::ManagerWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::ManagerWindow)
{
ui->setupUi(this);
currMatchIndex = 0;
QFile players("C:\\Users\\Oleksiy\\Documents\\players.txt");
if( players.open(QIODevice::ReadOnly) )
{
ui->playersTableWidget->setRowCount(200);
QString playerName;
QTextStream stream(&players);
int playerNum = 0;
while( !stream.atEnd() )
{
playerName = stream.readLine();
ui->playersTableWidget->setItem(playerNum, 0, new QTableWidgetItem(playerName));
++playerNum;
}
}
players.close();
QFile judges("C:\\Users\\Oleksiy\\Documents\\judges.txt");
if( judges.open(QIODevice::ReadOnly) ){
ui->judgesTableWidget->setRowCount(20);
QString judgeName;
QString judgeAge;
QString judgePhone;
QTextStream stream(&judges);
int judgeNum = 0;
while( !stream.atEnd() )
{
judgeName = stream.readLine();
ui->judgesTableWidget->setItem(judgeNum, 0, new QTableWidgetItem(judgeName));
judgeAge = stream.readLine();
ui->judgesTableWidget->setItem(judgeNum, 1, new QTableWidgetItem(judgeAge));
judgePhone = stream.readLine();
ui->judgesTableWidget->setItem(judgeNum, 2, new QTableWidgetItem(judgePhone));
++judgeNum;
}
}
judges.close();
QFile tours("C:\\Users\\Oleksiy\\Documents\\tours.txt");
if( tours.open(QIODevice::ReadOnly) ){
QTextStream stream(&tours);
tourName = stream.readLine();
ui->tourNameInfo->setText(tourName);
tourCity = stream.readLine();
ui->cityNameInfo->setText(tourCity);
tourClub = stream.readLine();
ui->clubNameInfo->setText(tourClub);
tourDateStart = stream.readLine();
ui->dateStart->setText(tourDateStart);
tourDateEnd = stream.readLine();
ui->dateEnd->setText(tourDateEnd);
tourHotel = stream.readLine();
ui->hotelNameInfo->setText(tourHotel);
tourFund = stream.readLine();
ui->fundAmountInfo->setText(tourFund);
tourType = stream.readLine();
ui->drawType->setText(tourType);
}
tours.close();
}
ManagerWindow::~ManagerWindow(){
delete ui;
}
void ManagerWindow::on_addMatchPushButton_clicked(){
ui->matchesTableWidget->setItem(currMatchIndex, 0, new QTableWidgetItem(ui->pl1ComboBox->currentText()));
ui->matchesTableWidget->setItem(currMatchIndex, 1, new QTableWidgetItem(ui->pl2ComboBox->currentText()));
ui->matchesTableWidget->setItem(currMatchIndex, 2, new QTableWidgetItem(ui->matchDateLineEdit->text()));
ui->matchesTableWidget->setItem(currMatchIndex, 3, new QTableWidgetItem(ui->matchCourtComboBox->currentText()));
ui->matchesTableWidget->setItem(currMatchIndex, 4, new QTableWidgetItem(ui->jdgComboBox->currentText()));
++currMatchIndex;
}
void ManagerWindow::on_createTourBtn_clicked(){
QFile tours("C:\\Users\\Oleksiy\\Documents\\tours.txt");
if( tours.open(QIODevice::ReadWrite) ){
QTextStream stream(&tours);
ui->tourNameInfo->setText(ui->tourNameEdit->text());
stream << ui->tourNameEdit->text() << '\n';
ui->cityNameInfo->setText(ui->cityNameEdit->text());
stream << ui->cityNameEdit->text() << '\n';
ui->clubNameInfo->setText( ui->clubComboBox->currentText() );
stream << ui->clubComboBox->currentText() << '\n';
ui->dateStart->setText(ui->dateStartEdit->text());
stream << ui->dateStartEdit->text() << '\n';
ui->dateEnd->setText(ui->dateEndEdit->text());
stream << ui->dateEndEdit->text() << '\n';
ui->hotelNameInfo->setText(ui->hotelComboBox->currentText());
stream << ui->hotelComboBox->currentText() << '\n';
ui->fundAmountInfo->setText(ui->fundEdit->text());
stream << ui->fundEdit->text() << '\n';
ui->drawType->setText(ui->drawTypeComboBox->currentText());
stream << ui->drawTypeComboBox->currentText() << '\n';
}
tours.close();
}
void ManagerWindow::on_acceptPropPushButton_clicked(){
QFile pltour("C:\\Users\\Oleksiy\\Documents\\tourpl.txt");
if( pltour.open(QIODevice::Append) ){
QTextStream pl(&pltour);
pl << ui->playersTableWidget->item(0, 0)->text() << '\n';
ui->playersTableWidget->removeRow(0);
}
pltour.close();
}
void ManagerWindow::on_cancelPropPushButton_clicked(){
ui->playersTableWidget->removeRow(0);
}
void ManagerWindow::on_acceptJudgePushButton_2_clicked(){
QFile jdgtour("C:\\Users\\Oleksiy\\Documents\\tourjdg.txt");
if( jdgtour.open(QIODevice::Append) ){
QTextStream jdg(&jdgtour);
jdg << ui->judgesTableWidget->item(0, 0)->text() << '\n';
ui->judgesTableWidget->removeRow(0);
}
jdgtour.close();
}
void ManagerWindow::on_cancelJudgePushButton_2_clicked(){
ui->judgesTableWidget->removeRow(0);
}
void ManagerWindow::on_finJdgPushButton_clicked(){
QFile jdgfile("C:\\Users\\Oleksiy\\Documents\\tourjdg.txt");
if( jdgfile.open(QIODevice::ReadOnly) ){
QTextStream jdg(&jdgfile);
while(!jdg.atEnd()){
ui->jdgComboBox->addItem(jdg.readLine());
}
}
jdgfile.close();
}
void ManagerWindow::on_finPlPushButton_clicked(){
QFile plfile("C:\\Users\\Oleksiy\\Documents\\tourpl.txt");
if( plfile.open(QIODevice::ReadOnly) ){
QTextStream pl(&plfile);
while(!pl.atEnd()){
QString str = pl.readLine();
ui->pl1ComboBox->addItem(str);
ui->pl2ComboBox->addItem(str);
}
}
plfile.close();
}
Файл TicketManagerWindow.h
#ifndef TICKETMANAGERWINDOW_H
#define TICKETMANAGERWINDOW_H
#include <QMainWindow>
namespace Ui {
class TicketManagerWindow;
}
class TicketManagerWindow : public QMainWindow {
Q_OBJECT
public:
explicit TicketManagerWindow(QWidget *parent = 0);
~TicketManagerWindow();
private:
Ui::TicketManagerWindow *ui;
int selectedCellRow;
bool cellIsSelected;
private slots:
void on_pushButton_clicked();
};
#endif // TICKETMANAGERWINDOW_H

Файл TicketManagerWindow.cpp
#include "ticketmanagerwindow.h"
#include "ui_ticketmanagerwindow.h"
TicketManagerWindow::TicketManagerWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::TicketManagerWindow){
ui->setupUi(this);
cellIsSelected = false;
}
TicketManagerWindow::~TicketManagerWindow(){
delete ui;
}
void TicketManagerWindow::on_pushButton_clicked(){
ui->tableWidget->removeRow( 0 );
}

Ошибка :
1>d:\kurse\2013\2013\ticketmanagerwindow.h(4): fatal error C1083: Не удается открыть файл включение: ui_ticketmanagerwindow.h: No such file or directory
1> ManagerWindow.cpp
1>ManagerWindow.cpp(2): fatal error C1083: Не удается открыть файл включение: ui_ManagerWindow.h: No such file or directory
1> TTMSMainWindow.cpp
1>d:\kurse\2013\2013\ticketmanagerwindow.h(4): fatal error C1083: Не удается открыть файл включение: ui_ticketmanagerwindow.h: No such file or directory
Скрин :
Перейти в начало страницы
 
Быстрая цитата+Цитировать сообщение

Сообщений в этой теме


Быстрый ответОтветить в данную темуНачать новую тему
Теги
Нет тегов для показа


3 чел. читают эту тему (гостей: 3, скрытых пользователей: 0)
Пользователей: 0




RSS Текстовая версия Сейчас: 29.11.2024, 14:47