PDA

View Full Version : MainWindow



amagdy.ibrahim
14th June 2008, 01:01
I am applying the exmaple of MainWindow which in documentation,I have an error
maingw-make[1]:***[tmp/obj/release_shared/mainwindow.o]Error1
you can find the example in this link
http://doc.trolltech.com/4.2/mainwindows-mdi.html

Thanks

wysota
14th June 2008, 07:09
What exactly is the error? Please provide the first error message.

amagdy.ibrahim
14th June 2008, 10:55
I took the code of mainwindow.cpp,mainwindow.h,mdichild.cpp,mdi.h and main (copy+paste) ypu can see it on http://doc.trolltech.com/4.2/mainwindows-mdi.html

Then after running the code this errors or warnings appeared and I don't know the reasons:
Collect2:Id returned 1 exit status
mingw32-make[1]:***[release/Main3.exe]Error1
mingw32-make[1]:Leaving directory 'E:/QT/4.4/Main3'
mingw32-make:***[release] Error2

I hope you understood me now

triperzonak
14th June 2008, 11:14
Collect2:Id returned 1 exit status
mingw32-make[1]:***[release/Main3.exe]Error1
mingw32-make[1]:Leaving directory 'E:/QT/4.4/Main3'
mingw32-make:***[release] Error2
I hope you understood me now

amm the line before this please..;)

amagdy.ibrahim
14th June 2008, 11:48
tmp/obj/release_shared/main.o(.text +0*66):main.cpp:undifiened reference to qInit Rescources_mdi()

BTW:I indcluded the two header files
I wrote this code in the main

#include <QApplication>
#include <QMainWindow>
#include"mainwindow.h"

int main(int argc, char *argv[])
{
/*QApplication app(argc, argv);

Ui_MainWindow ui;
QMainWindow *Widget = new QMainWindow;
ui.setupUi(Widget);
Widget->show();*/
Q_INIT_RESOURCE(mdi);
MainWindow mainWin;
mainWin.show();


// return app.exec();
}
BTW:I know it isn't right to comment return but I commented it becuase there is an error is appeared:

min.cpp19:error 'app' undeclared (first use of this fucntion)
I hope you understood me now

amagdy.ibrahim
14th June 2008, 11:58
hey,thanks all it is working now I just commented the Q_intrecources
and it is working now
thanks

amagdy.ibrahim
14th June 2008, 14:12
Hi

I am modifyfing now in the program in documentation,I need to open child without text file
this fucntion is create child

void MainWindow::newFile()
{
MdiChild *child = createMdiChild();
child->newFile();
child->show();
}
MdiChild *MainWindow::createMdiChild()
{
MdiChild *child = new MdiChild;
workspace->addWindow(child);

connect(child, SIGNAL(copyAvailable(bool)),
cutAct, SLOT(setEnabled(bool)));
connect(child, SIGNAL(copyAvailable(bool)),
copyAct, SLOT(setEnabled(bool)));

return child;
}

and this in mdichild

MdiChild::MdiChild()
{
setAttribute(Qt::WA_DeleteOnClose);
isUntitled = true;
}
plz help me,again I need the cild window with text file document just the child window apear.thanks