Выполняется сборка проекта Project...Настройки не изменились, этап QMake пропускается.Запускается: C:/MinGW/bin/mingw32-make.exe -w mingw32-make: Entering directory `C:/Project'c:\Qt\4.4.3\bin\qmake.exe -spec ..\Qt\4.4.3\mkspecs\win32-g++ -win32 -o Makefile Project.promingw32-make: Leaving directory `C:/Project'mingw32-make: Entering directory `C:/Project'C:/MinGW/bin/mingw32-make -f Makefile.Debugmingw32-make[1]: Entering directory `C:/Project'g++ -static -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\Project.exe object_script.Project.Debug -L"c:\Qt\4.4.3\lib" -lmingw32 -lqtmaind -lQtGuid -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lmsimg32 -lQtCored -lkernel32 -luser32 -lshell32 -luuid -lole32 -ladvapi32 -lws2_32mingw32-make[1]: Leaving directory `C:/Project'mingw32-make: Leaving directory `C:/Project'C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot find -lQtGuidcollect2: ld returned 1 exit statusmingw32-make[1]: *** [debug\Project.exe] Error 1mingw32-make: *** [debug] Error 2Завершено с кодом возврата 2.Ошибка во время сборки проекта ProjectВо время выполнения сборки на этапе 'Make'
Отредактируйте <QTDIR>\mkspecs\win32-g++\qmake.conf: таким образом:1. Замените QMAKE_LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-relocна (add -static) QMAKE_LFLAGS = -static -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
#include <QApplication>#include <QtPlugin>#include "proga1.h"int main(int argc, char *argv[]){ QApplication app(argc, argv); MainWindow w; w.show(); return app.exec();}
#include <QtCore>#include <QTextCodec>#include <QtGui>#include "proga1.h"#include "proga1_about.h"#include "proga1_author.h"#include "proga1_help.h"#define tr QObject::trvoid MainWindow::rasschet(){int iS, oS, notH, notM; //Объявление переменныхfloat oH, oM; //Объявление переменныхconst int SiH=3600, SiM=60;QString inSec, outHr, outMin, outSec;textEdit->clear();inSec = spinBox->text(); //ВводqDebug() << inSec;iS = inSec.toInt();qDebug() << iS;//ВычислениеoH = (iS / SiH); //Количество часовnotH = iS - (oH * SiH); //Убираем количество часовoM = (notH / SiM); //Количество минутnotM = notH - (oM * SiM); //Убираем количество минутoS = notM; //Оставшееся число равно количеству секундQTextCodec::setCodecForTr(QTextCodec::codecForName("Windows-1251"));textEdit->setText(tr("Введенное количество секунд ")+QString::number(iS) + tr(" соответствует ") + QString::number(oH) + tr(" часам, " ) + QString::number(oM) + tr(" минутам, ") + QString::number(oS) + tr(" секундам"));}void MainWindow::about(){QTextCodec::setCodecForTr(QTextCodec::codecForName("Windows-1251"));qDebug() << "MainWindow::about";qDebug() << this->isModal();// Главное окно - модальное// Сделаем его немодальным, т.е. разблокируем дочерние виджеты для вводаthis->setWindowModality(Qt::NonModal);MyAbout *myabout = new MyAbout;myabout->show();}void MainWindow::help(){QTextCodec::setCodecForTr(QTextCodec::codecForName("Windows-1251"));qDebug() << "MainWindow::help";qDebug() << this->isModal();// Главное окно - модальное// Сделаем его немодальным, т.е. разблокируем дочерние виджеты для вводаthis->setWindowModality(Qt::NonModal);MyHelp *myhelp = new MyHelp;myhelp->show();}void MainWindow::author(){QTextCodec::setCodecForTr(QTextCodec::codecForName("Windows-1251"));qDebug() << "MainWindow::author";qDebug() << this->isModal();// Главное окно - модальное// Сделаем его немодальным, т.е. разблокируем дочерние виджеты для вводаthis->setWindowModality(Qt::NonModal);MyAuthor *myauthor = new MyAuthor;myauthor->show();}
#include <QtGui>#include "proga1_about.h"MyAbout::MyAbout(QWidget *parent) : QWidget(parent){ setupUi(this); connect(pushButton, SIGNAL(pressed()), this, SLOT(close()));}
#include <QtGui>#include "proga1_author.h"MyAuthor::MyAuthor(QWidget *parent) : QWidget(parent){ setupUi(this); connect(pushButton, SIGNAL(pressed()), this, SLOT(close()));}
#include <QtGui>#include "proga1_help.h"MyHelp::MyHelp(QWidget *parent) : QWidget(parent){ setupUi(this); connect(pushButton, SIGNAL(clicked()), this, SLOT(close()));}
#ifndef PROGA1_H#define PROGA1_H#include <QMainWindow>#include <QObject>#include "ui_proga1.h"class MainWindow : public QMainWindow, Ui::MainWindow // <--------Наследуемся{ Q_OBJECTpublic: MainWindow(QMainWindow* p = 0) : QMainWindow(p) { 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_author, SIGNAL(triggered()), this, SLOT(author())); //подключаем кнопку об авторе }public slots: void rasschet(); // создаем слот рассчет void about(); // создаем слот о программе void help(); // создаем слот помощь void author(); // создаем слот об авторе};#endif
#ifndef PROGA1ABOUT_H#define PROGA1ABOUT_H#include <QWidget>#include "ui_proga1_about.h"class MyAbout : public QWidget, public Ui::About{ Q_OBJECTpublic: MyAbout(QWidget *parent = 0);};#endif
#ifndef PROGA1AUTHOR_H#define PROGA1AUTHOR_H#include <QWidget>#include "ui_proga1_author.h"class MyAuthor : public QWidget, public Ui::Author{ Q_OBJECTpublic: MyAuthor(QWidget *parent = 0);};#endif // PROGA1_AUTHOR_H
#ifndef PROGA1HELP_H#define PROGA1HELP_H#include <QWidget>#include "ui_proga1_help.h"class MyHelp : public QWidget, public Ui::Help{ Q_OBJECTpublic: MyHelp(QWidget *parent = 0);};#endif // PROGA1_HELP_H
<?xml version="1.0" encoding="UTF-8" ?> - <ui version="4.0"> <class>MainWindow</class> - <widget class="QMainWindow" name="MainWindow">- <property name="windowModality"> <enum>Qt::ApplicationModal</enum> </property>- <property name="enabled"> <bool>true</bool> </property>- <property name="geometry">- <rect> <x>0</x> <y>0</y> <width>385</width> <height>294</height> </rect> </property>- <property name="minimumSize">- <size> <width>385</width> <height>294</height> </size> </property>- <property name="maximumSize">- <size> <width>385</width> <height>294</height> </size> </property>- <property name="windowTitle"> <string>Программа №1 :)</string> </property>- <widget class="QWidget" name="centralwidget">- <widget class="QSpinBox" name="spinBox">- <property name="geometry">- <rect> <x>50</x> <y>40</y> <width>161</width> <height>22</height> </rect> </property>- <property name="font">- <font> <family>Segoe Script</family> <pointsize>10</pointsize> </font> </property>- <property name="mouseTracking"> <bool>false</bool> </property>- <property name="acceptDrops"> <bool>false</bool> </property>- <property name="whatsThis"> <string extracomment="Введите число" /> </property>- <property name="maximum"> <number>999999999</number> </property> </widget>- <widget class="QTextEdit" name="textEdit">- <property name="geometry">- <rect> <x>50</x> <y>110</y> <width>301</width> <height>71</height> </rect> </property>- <property name="readOnly"> <bool>true</bool> </property> </widget>- <widget class="QPushButton" name="pushButton">- <property name="geometry">- <rect> <x>250</x> <y>40</y> <width>101</width> <height>21</height> </rect> </property>- <property name="text"> <string>Рассчитать</string> </property> </widget>- <widget class="QPushButton" name="pushButton_2">- <property name="geometry">- <rect> <x>160</x> <y>210</y> <width>75</width> <height>23</height> </rect> </property>- <property name="text"> <string>Выход</string> </property> </widget>- <widget class="QLabel" name="label">- <property name="geometry">- <rect> <x>50</x> <y>20</y> <width>151</width> <height>16</height> </rect> </property>- <property name="text"> <string>Введите количество секунд</string> </property> </widget>- <widget class="QLabel" name="label_2">- <property name="geometry">- <rect> <x>50</x> <y>90</y> <width>151</width> <height>16</height> </rect> </property>- <property name="text"> <string>Результат работы программы</string> </property> </widget> </widget> <widget class="QStatusBar" name="statusbar" /> - <widget class="QMenuBar" name="menubar">- <property name="geometry">- <rect> <x>0</x> <y>0</y> <width>385</width> <height>21</height> </rect> </property>- <widget class="QMenu" name="menu">- <property name="title"> <string>Файл</string> </property> <addaction name="kn_about" /> <addaction name="kn_author" /> <addaction name="kn_exit" /> </widget>- <widget class="QMenu" name="menu_2">- <property name="title"> <string>Язык</string> </property> <addaction name="kn_rus" /> <addaction name="kn_eng" /> </widget>- <widget class="QMenu" name="menu_3">- <property name="title"> <string>Справка</string> </property> <addaction name="kn_help" /> <addaction name="kn_log" /> </widget> <addaction name="menu" /> <addaction name="menu_2" /> <addaction name="menu_3" /> </widget>- <action name="kn_rus">- <property name="checkable"> <bool>true</bool> </property>- <property name="checked"> <bool>true</bool> </property>- <property name="text"> <string>Русский</string> </property> </action>- <action name="kn_eng">- <property name="checkable"> <bool>true</bool> </property>- <property name="text"> <string>Английский</string> </property> </action>- <action name="kn_about">- <property name="text"> <string>О программе</string> </property> </action>- <action name="kn_author">- <property name="text"> <string>Об авторе</string> </property> </action>- <action name="kn_exit">- <property name="text"> <string>Выход</string> </property> </action>- <action name="kn_help">- <property name="text"> <string>Помощь</string> </property> </action>- <action name="kn_log">- <property name="text"> <string>Открыть log-файл</string> </property> </action> </widget>- <tabstops> <tabstop>spinBox</tabstop> <tabstop>pushButton</tabstop> <tabstop>textEdit</tabstop> <tabstop>pushButton_2</tabstop> </tabstops> <resources /> - <connections>- <connection> <sender>pushButton_2</sender> <signal>clicked()</signal> <receiver>MainWindow</receiver> <slot>close()</slot> - <hints>- <hint type="sourcelabel"> <x>197</x> <y>243</y> </hint>- <hint type="destinationlabel"> <x>192</x> <y>146</y> </hint> </hints> </connection>- <connection> <sender>kn_exit</sender> <signal>triggered()</signal> <receiver>MainWindow</receiver> <slot>close()</slot> - <hints>- <hint type="sourcelabel"> <x>-1</x> <y>-1</y> </hint>- <hint type="destinationlabel"> <x>192</x> <y>146</y> </hint> </hints> </connection> </connections> </ui>
<?xml version="1.0" encoding="UTF-8" ?> - <ui version="4.0"> <class>About</class> - <widget class="QWidget" name="About">- <property name="geometry">- <rect> <x>0</x> <y>0</y> <width>290</width> <height>90</height> </rect> </property>- <property name="minimumSize">- <size> <width>290</width> <height>90</height> </size> </property>- <property name="maximumSize">- <size> <width>290</width> <height>90</height> </size> </property>- <property name="windowTitle"> <string>О программе</string> </property>- <property name="styleSheet"> <string notr="true" /> </property>- <widget class="QPushButton" name="pushButton">- <property name="geometry">- <rect> <x>110</x> <y>60</y> <width>75</width> <height>23</height> </rect> </property>- <property name="text"> <string>Закрыть</string> </property> </widget>- <widget class="QLabel" name="label">- <property name="geometry">- <rect> <x>20</x> <y>10</y> <width>251</width> <height>16</height> </rect> </property>- <property name="text"> <string>Программа переводит заданные с клавиатуры</string> </property> </widget>- <widget class="QLabel" name="label_2">- <property name="geometry">- <rect> <x>20</x> <y>30</y> <width>231</width> <height>16</height> </rect> </property>- <property name="text"> <string>секунды в вид ЧЧ:ММ:СС</string> </property> </widget> </widget> <resources /> - <connections>- <connection> <sender>pushButton</sender> <signal>pressed()</signal> <receiver>About</receiver> <slot>close()</slot> - <hints>- <hint type="sourcelabel"> <x>147</x> <y>71</y> </hint>- <hint type="destinationlabel"> <x>145</x> <y>45</y> </hint> </hints> </connection> </connections> </ui>
<?xml version="1.0" encoding="UTF-8" ?> - <ui version="4.0"> <class>Author</class> - <widget class="QWidget" name="Author">- <property name="enabled"> <bool>true</bool> </property>- <property name="geometry">- <rect> <x>0</x> <y>0</y> <width>300</width> <height>220</height> </rect> </property>- <property name="minimumSize">- <size> <width>300</width> <height>200</height> </size> </property>- <property name="maximumSize">- <size> <width>300</width> <height>220</height> </size> </property>- <property name="sizeIncrement">- <size> <width>0</width> <height>0</height> </size> </property>- <property name="windowTitle"> <string>Об авторе</string> </property>- <property name="styleSheet"> <string notr="true" /> </property>- <widget class="QPushButton" name="pushButton">- <property name="geometry">- <rect> <x>110</x> <y>180</y> <width>75</width> <height>23</height> </rect> </property>- <property name="text"> <string>Закрыть</string> </property> </widget>- <widget class="QLabel" name="label">- <property name="geometry">- <rect> <x>170</x> <y>0</y> <width>101</width> <height>16</height> </rect> </property>- <property name="text"> <string>Автор программы:</string> </property> </widget>- <widget class="QLabel" name="label_2">- <property name="geometry">- <rect> <x>150</x> <y>30</y> <width>131</width> <height>16</height> </rect> </property>- <property name="text"> <string>Мухин Денис Михайлович</string> </property> </widget>- <widget class="QLabel" name="label_3">- <property name="geometry">- <rect> <x>150</x> <y>50</y> <width>121</width> <height>16</height> </rect> </property>- <property name="text"> <string>студент группы ВМ-21</string> </property> </widget>- <widget class="QLabel" name="label_4">- <property name="geometry">- <rect> <x>190</x> <y>140</y> <width>46</width> <height>14</height> </rect> </property>- <property name="text"> <string>2009 год</string> </property> </widget>- <widget class="QGraphicsView" name="graphicsView">- <property name="geometry">- <rect> <x>0</x> <y>0</y> <width>141</width> <height>161</height> </rect> </property>- <property name="autoFillBackground"> <bool>false</bool> </property>- <property name="styleSheet"> <string notr="true">background-image: url(:/photo/000000.jpeg);</string> </property> </widget> </widget>- <resources> <include location="res.qrc" /> </resources>- <connections>- <connection> <sender>pushButton</sender> <signal>pressed()</signal> <receiver>Author</receiver> <slot>close()</slot> - <hints>- <hint type="sourcelabel"> <x>137</x> <y>191</y> </hint>- <hint type="destinationlabel"> <x>142</x> <y>105</y> </hint> </hints> </connection> </connections> </ui>
<?xml version="1.0" encoding="UTF-8" ?> - <ui version="4.0"> <class>Help</class> - <widget class="QWidget" name="Help">- <property name="geometry">- <rect> <x>0</x> <y>0</y> <width>321</width> <height>294</height> </rect> </property>- <property name="windowTitle"> <string>Помощь</string> </property>- <widget class="QPushButton" name="pushButton">- <property name="geometry">- <rect> <x>120</x> <y>260</y> <width>75</width> <height>23</height> </rect> </property>- <property name="text"> <string>Закрыть</string> </property> </widget>- <widget class="QTextEdit" name="textEdit">- <property name="geometry">- <rect> <x>20</x> <y>10</y> <width>281</width> <height>241</height> </rect> </property>- <property name="readOnly"> <bool>true</bool> </property> </widget> </widget> <resources /> - <connections>- <connection> <sender>pushButton</sender> <signal>clicked()</signal> <receiver>Help</receiver> <slot>close()</slot> - <hints>- <hint type="sourcelabel"> <x>167</x> <y>281</y> </hint>- <hint type="destinationlabel"> <x>160</x> <y>146</y> </hint> </hints> </connection> </connections> </ui>
- <ui version="4.0">