Results 1 to 7 of 7

Thread: MainWindow

  1. #1

    Default MainWindow

    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
    Last edited by amagdy.ibrahim; 14th June 2008 at 02:13.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: MainWindow

    What exactly is the error? Please provide the first error message.

  3. #3

    Default Re: MainWindow

    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

  4. #4
    Join Date
    Dec 2007
    Posts
    129
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MainWindow

    Quote Originally Posted by amagdy.ibrahim View Post
    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..

  5. #5

    Default Re: MainWindow

    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
    Qt Code:
    1. #include <QApplication>
    2. #include <QMainWindow>
    3. #include"mainwindow.h"
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. /*QApplication app(argc, argv);
    8.  
    9.   Ui_MainWindow ui;
    10. QMainWindow *Widget = new QMainWindow;
    11.   ui.setupUi(Widget);
    12.   Widget->show();*/
    13. Q_INIT_RESOURCE(mdi);
    14. MainWindow mainWin;
    15. mainWin.show();
    16.  
    17.  
    18. // return app.exec();
    19. }
    To copy to clipboard, switch view to plain text mode 
    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
    Last edited by jpn; 19th June 2008 at 06:33. Reason: missing [code] tags

  6. #6

    Default Re: MainWindow

    hey,thanks all it is working now I just commented the Q_intrecources
    and it is working now
    thanks

  7. #7

    Default Re: MainWindow

    Hi

    I am modifyfing now in the program in documentation,I need to open child without text file
    this fucntion is create child
    Qt Code:
    1. void MainWindow::newFile()
    2. {
    3. MdiChild *child = createMdiChild();
    4. child->newFile();
    5. child->show();
    6. }
    7. MdiChild *MainWindow::createMdiChild()
    8. {
    9. MdiChild *child = new MdiChild;
    10. workspace->addWindow(child);
    11.  
    12. connect(child, SIGNAL(copyAvailable(bool)),
    13. cutAct, SLOT(setEnabled(bool)));
    14. connect(child, SIGNAL(copyAvailable(bool)),
    15. copyAct, SLOT(setEnabled(bool)));
    16.  
    17. return child;
    18. }
    To copy to clipboard, switch view to plain text mode 
    and this in mdichild
    Qt Code:
    1. MdiChild::MdiChild()
    2. {
    3. setAttribute(Qt::WA_DeleteOnClose);
    4. isUntitled = true;
    5. }
    To copy to clipboard, switch view to plain text mode 
    plz help me,again I need the cild window with text file document just the child window apear.thanks
    Last edited by wysota; 14th June 2008 at 15:19. Reason: missing [code] tags

Similar Threads

  1. Notifying Mainwindow of an event..
    By MrGarbage in forum Qt Programming
    Replies: 1
    Last Post: 9th November 2007, 22:29
  2. Replies: 1
    Last Post: 11th September 2007, 14:34
  3. How do I use a mainwindow .ui file?
    By thomaspu in forum Qt Tools
    Replies: 2
    Last Post: 23rd November 2006, 07:32
  4. Replies: 3
    Last Post: 23rd July 2006, 19:02
  5. mainwindow does not refresh
    By edb in forum Qt Programming
    Replies: 22
    Last Post: 25th January 2006, 17:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.