collect2: ld returned 1 exit statusmingw32-make[1]: *** [debug\gdbmacros.dll] Error 1mingw32-make[1]: Leaving directory `C:/Qt/4.6.0/qtc-debugging-helper'mingw32-make: *** [debug-all] Error 2
#ifndef PROGA1_H#define PROGA1_H#include <QMainWindow>#include <QTranslator>#include <QFile>#include <QObject>#include "ui_proga1.h"class MainWindow : public QMainWindow, Ui::MainWindow // <--------Наследуемся{ Q_OBJECTpublic: int iS, oS, oM, oH; QTranslator* translator; QFile* file; MainWindow(QMainWindow* p = 0) : QMainWindow(p) { translator = new QTranslator(this); file = new QFile(this); setupUi(this); connect(pushButton, SIGNAL(clicked()), this, SLOT(rasschet())); //подключаем кнопку рассчет connect(kn_about, SIGNAL(triggered()), this, SLOT(about())); // подключаем кнопку о программе// connect(kn_help, SIGNAL(triggered()), this, SLOT(help())); //подключаем кнопку помощь connect(kn_help, SIGNAL(triggered()), this, SLOT(helpBrowser())); connect(kn_author, SIGNAL(triggered()), this, SLOT(author())); //подключаем кнопку об авторе connect(kn_rus, SIGNAL(triggered()), this, SLOT(triggeredRussian())); // выбираем русский connect(kn_eng, SIGNAL(triggered()), this, SLOT(triggeredEnglish())); // выбираем английский connect(kn_log, SIGNAL(triggered()), this, SLOT(logFile())); }public slots: void rasschet(); // создаем слот рассчет void about(); // создаем слот о программе void author(); // создаем слот об авторе void triggeredRussian(); void triggeredEnglish(); void helpBrowser(); void logFile();};#endif
#include <QtCore>#include <QTextCodec>#include <QtGui>#include <QTranslator>#include "proga1.h"#include "proga1_about.h"#include "proga1_author.h"#include "proga1_helpbrowser.h"void MainWindow::rasschet(){ int notH, notM; //Объявление переменных const int SiH=3600, SiM=60; QString inSec, outHr, outMin, outSec; textEdit->clear(); inSec = spinBox->text(); //Ввод iS = inSec.toInt(); //Вычисление oH = (iS / SiH); //Количество часов notH = iS - (oH * SiH); //Убираем количество часов oM = (notH / SiM); //Количество минут notM = notH - (oM * SiM); //Убираем количество минут oS = notM; //Оставшееся число равно количеству секунд textEdit->setText(tr("The entered number of seconds %1 corresponds %2 hours, %3 minutes, %4 seconds").arg(iS).arg(oH).arg(oM).arg(oS));}void MainWindow::about(){ QTextCodec::setCodecForTr(QTextCodec::codecForName("Windows-1251")); this->setWindowModality(Qt::NonModal); MyAbout *myabout = new MyAbout; myabout->show();}void MainWindow::helpBrowser(){ this->setWindowModality(Qt::NonModal); HelpBrowser* helpbrowser = new HelpBrowser("doc", "./help/index.html"); helpbrowser->setWindowTitle(tr("Help")); helpbrowser->resize(500, 400); helpbrowser->setMaximumSize(500, 400); helpbrowser->setMinimumSize(500, 400); helpbrowser->show();}void MainWindow::author(){ QTextCodec::setCodecForTr(QTextCodec::codecForName("Windows-1251")); this->setWindowModality(Qt::NonModal); MyAuthor *myauthor = new MyAuthor; myauthor->show();}void MainWindow::triggeredRussian(){ qApp->removeTranslator(translator); translator->load("eng.qm","C:\\Pr1"); qApp->installTranslator(translator); retranslateUi(this); kn_rus->setChecked(true); kn_eng->setChecked(false);}void MainWindow::triggeredEnglish(){ QCoreApplication::removeTranslator(translator); retranslateUi(this); kn_eng->setChecked(true); kn_rus->setChecked(false);}void MainWindow::logFile(){ file = new QFile("C:\\Pr1\\log.txt"); file->open(QIODevice::ReadOnly | QIODevice::WriteOnly); QByteArray a = file->readAll(); qDebug() << a; file->close();}
... kn_rus->setChecked(false); QFont font; font.setFamily(QString::fromUtf8("Segoe Script")); kn_rus->setFont(font); kn_rus->setSoftKeyRole(QAction::NoSoftKey); kn_eng = new QAction(MainWindow); kn_eng->setObjectName(QString::fromUtf8("kn_eng")); kn_eng->setCheckable(true); kn_eng->setChecked(true); ...