Results 1 to 20 of 21

Thread: "mainwindows" Example

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 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.

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

    Seth (15th April 2007)

  4. #3
    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!!!

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 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.

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

    Seth (15th April 2007)

  7. #5
    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?

  8. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 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.

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

    Default Re: "mainwindows" Example

    Wysota, okay went into C:\Qt\4.2.3\lib and opended up the README file.

    The README file says "If this directory is empty, you probably forgot to compile the Qt library." My README directory (file) is empty. Is this a cause of my problems? If so, how do I compile the Qt Libraries?

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
  •  
Qt is a trademark of The Qt Company.