Results 1 to 20 of 21

Thread: "mainwindows" Example

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2006
    Posts
    25
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: "mainwindows" Example

    Marcel,

    Iteresting, I just ran "qmake" instead of "make" and didnt get any errors or gibberish.

    However, in the DEBUG file there is no .exe file to launch the program. The DEBUG file is empty.

    How do we launch a program? Shouldnt there be a .exe file somewhere?

    No where in the "mainwindows" folder was a file generated called "qmake_output.txt"

    Attached is a qmake file, dont know if you can use it for debugging

    Thanks in advance

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: "mainwindows" Example

    Were you using make? Not good...qmake projects are not compatible with normal makefiles.
    Check the Release folder for the executable...

  3. #3
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: "mainwindows" Example

    The release folder in every folder in the mainwindows example...

    regards

  4. #4
    Join Date
    Jul 2006
    Posts
    25
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: "mainwindows" Example

    The RELEASE folder is empty as well.

    Why cant I use "make"? I used it for the "hello" program and such.

  5. #5
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: "mainwindows" Example

    If you want debugging information. add CONFIG += qt debug.
    to use the plain, old make, you'll have to qmake -o Makefile mainwindows.pro ( sorry about before, -o is not for log ).
    After this you can use make. As I said, a .pro file is not the same with a makefile( different syntax for start ).


  6. #6
    Join Date
    Jul 2006
    Posts
    25
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: "mainwindows" Example

    Marcel, I am so new to programming.

    What is [HTML]add CONFIG += qt debug[/HTML] and where do I add that?

    Also, what is [HTML] -o [/HTML] and where do I add that?

    Also, why arent I seeing an executable anywhere?

    When I ran "qmake" on the command line it didnt give me errors so I should have seen an executable somewhere, correct?

  7. #7
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: "mainwindows" Example

    No, you have to use the platform make to build the project after you generate a makefile with qmake.

    Use nmake if you have Visual Studio or make if you have gcc.

    regards

  8. #8
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: "mainwindows" Example

    STEPS:

    1. qmake -project in mainwindows
    2. qmake -project in the subfolders (if you deleted the makefiles and .pro files )
    3. qmake in mainwindows
    4. qmake in subfolders
    5 make or nmake in mainwindows

    Should work fine and generate all executables in the Release folders.

  9. #9
    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: "mainwindows" Example

    Hold on!

    Calling "qmake -project" destroys a perfectly good project file. You musn't call it. Please bring it back from the original archive and then run qmake and make (without qmake -project).

    "-o" option for qmake tells it how to name the Makefile and not where to redirect the messages.

  10. The following user says thank you to wysota for this useful post:

    Seth (15th April 2007)

  11. #10
    Join Date
    Jul 2006
    Posts
    25
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: "mainwindows" Example

    Wysota,

    [HTML]Please bring it back from the original archive and then run qmake and make (without qmake -project).[/HTML]

    since I ran qmake -project from its original folder I may have destroyed the original.

    1) Is there another copy somewhere else?

    I cant seem to find this mainwindows example on the Trolltech website. The example comes standard with Qt 4.2.3 (C:\Qt\4.2.3\examples\mainwindows).

    2) Should Trolltech have this mainwindows example somewhere on their website?

    Thanks in advance!!!

  12. #11
    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: "mainwindows" Example

    Quote Originally Posted by Seth View Post
    since I ran qmake -project from its original folder I may have destroyed the original.

    1) Is there another copy somewhere else?
    Yes, in a source archive available from for example www.trolltech.com Download the zip and replace the example files.

    The top level project file looks as follows:

    text Code:
    1. TEMPLATE = subdirs
    2. SUBDIRS = application \
    3. dockwidgets \
    4. mdi \
    5. menus \
    6. recentfiles \
    7. sdi
    8.  
    9. # install
    10. target.path = $$[QT_INSTALL_EXAMPLES]/mainwindows
    11. sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS mainwindows.pro README
    12. sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows
    13. INSTALLS += target sources
    To copy to clipboard, switch view to plain text mode 

    If you didn't ruin project files in subdirectories, this is all you need.

  13. The following user says thank you to wysota for this useful post:

    Seth (15th April 2007)

  14. #12
    Join Date
    Jul 2006
    Posts
    25
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: "mainwindows" Example

    Wysota

    Good progress (I think)!! I went into archive and got a new "mainwindows" example file and ran qmake and make only and it looks like everything ran smoothly. Thanks for that help!

    But where is the executable? There is no DEBUG or RELEASE folder under the mainwindows folder.

    There is a RELEASE folder in every subfolder (application, dockwidgets, mdi, menus, etc...) that has an executable but I those dont seem seem to work when ran.

    I am wonding if only running qmake and make in the mainwindows folder is all I have to do?

    Or do I need to go into every subfolder and run qmake and make?

  15. #13
    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: "mainwindows" Example

    "mainwindows" contains a set of examples in subdirectories. You need Qt libraries to be accessible to run them. Either place Qt libs in a path where your system looks for dlls (like C:\WINDOWS\System) or copy them to the same directory where each executable resides. Then you'll be able to run them.

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.