Results 1 to 20 of 31

Thread: the simplest custom slot

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: the simplest custom slot

    Quote Originally Posted by mchara View Post
    What macros?
    DO you mean those defines at the beginning
    Qt Code:
    1. -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
    To copy to clipboard, switch view to plain text mode 
    , i've copied them from first makefile found in qt's exapmles & worked fine.
    This is not a good thing to do. The macros change depending on how you configure your project - in this situation you only enable core and gui libraries. What if you want to use other Qt modules like network, xml or any of the others? Your static compilation rule will fail. If you install newer Qt release that has more switches, your compilation will fail. If you want to switch between debug and release, it won't be possible, etc.

  2. #2
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    7
    Thanked 11 Times in 8 Posts

    Default Re: the simplest custom slot

    I know it's not good solution, but the only one working i have for now...
    I promise to let you know, when i'll find what's wrong with that "FORCE" qmake's error & figure out how to use dev-cpp's makefile to generate & build second one from qmake.
    P.S.
    If i'm adding some module i have to add include, lib & define by hand, i have to add each file i'm adding to project to makefile also, so it's lots of unnecessary work...
    Only positive side of this solution is the fact that application compiles itself from dev-cpp environtment.

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

    Default Re: the simplest custom slot

    Isn't it possible to do the compilation just by making qmake && make your build sequence in the IDE?

  4. #4
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    7
    Thanked 11 Times in 8 Posts

    Default Re: the simplest custom slot

    It should be possible, i've used only use custom makefile option. As i said i got an error on makefiles generated by qmake & i don't know the reason jet so i was using own makefiles.
    it would be nice to have qmake & make integrated with IDE but first qmake must work. When i'll force qmake to work properly, i'll start searching how to integrate it with dev-cpp in best way.

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

    Default Re: the simplest custom slot

    What kind of make do you have? What does make -v return?

  6. #6
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    7
    Thanked 11 Times in 8 Posts

    Default Re: the simplest custom slot

    GNU Make 3.80
    Copyright (C) 2002 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.
    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
    PARTICULAR PURPOSE.

    i think it can be caused by missing tab after FORCE:
    but i can't test it now - i'm using vs2005 with integration in work while dev-cpp with open-source edition of qt at home, i'm working now and unluckily have no network at home so i'll come up at monday with more details about qmake on mingw.

    on the margin: those qmake supports doxygen or some other source documentation tools?

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: the simplest custom slot

    I don't have anything missing in my qmake+gmake makefiles... What is the exact error message you get? And what are the exact conditions of getting it?

  8. #8
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    7
    Thanked 11 Times in 8 Posts

    Default Re: the simplest custom slot

    Sorry, my error was caused by delphi installed on my system. I've forgot about it(long time not used) & didn't checked paths order in environtment and qmake tried to use borland's make...
    stupid mistake...

    anyhow, dev-cpp allows to use custom makefile or *.mak make addons.
    I don't know what are those addons, but setting custom makefile to one generated by qmake shall be enough to work with single projects(makefile generated from qmake has a rule to regenerate itself from *.pro file, so it should guarantee makefile to be up to date).

    personally i prefer to keep using makefiles written by hand - it's not so hard & allows me to have multiple projects in one environment(a bit like solution in vs)by using separate makefiles for projects & dev-cpp set to makefile that builds application and calls makes to build a number of dlls recursively. There will be source documentation generated from those makefiles in future and help file compilation.To do this with qmake i would have to provide pro files, makefiles for them and additional makefile that calls them, it's more things to maintain without bigger benefits for me, but as i said - for single projects qmake's makefile should do the work.

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: the simplest custom slot

    Quote Originally Posted by mchara View Post
    makefile generated from qmake has a rule to regenerate itself from *.pro file, so it should guarantee makefile to be up to date
    Only if the .pro file changes. But if you only change one of the files that require the makefile to be recreated (like when adding a Q_OBJECT macro to an existing class), you need to rerun qmake manually. Furthermore, if you add a new file to the project, you'll have to modify the .pro file manually as well.

    personally i prefer to keep using makefiles written by hand - it's not so hard & allows me to have multiple projects in one environment(a bit like solution in vs)by using separate makefiles for projects & dev-cpp set to makefile that builds application and calls makes to build a number of dlls recursively.
    qmake supports that as well. Just take a look at the SUBDIRS template for qmake. You can also make qmake generate make rules for things you mention - like building help and documentation. Some features that are poorly documented (or even not documented at all) might be explained better in our wiki.

  10. #10
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    7
    Thanked 11 Times in 8 Posts

    Default Re: the simplest custom slot

    It's really good article, it seems that qmake can do all that stuff that make can!
    hmm... i don't know, there's no features that would be MUCH easier with qmake than with make. I'm familiar with make enough to feel comfortable with maintaining makefiles as well as qmake projects. In addition dev-cpp's dump debugger fails to trace errors in files that are build in sub makefile, it traces only files mentioned in main makefile so i'm compiling only release version without additional subdirs for output(everything builds into target structure of directories). qmake makes some mess for me with generating lots of unwanted files.

    I really don't know, it's hard choice... i think qmake is powerful tool that can do some work for me, but it also does some unwanted tasks...

    maybe i just like to have full control over my source and qmake (as every automation tool) takes over some control to make things easier... makefile have just view lines more than *.pro and keep lower number of files to maintain.

  11. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: the simplest custom slot

    Quote Originally Posted by mchara View Post
    It's really good article, it seems that qmake can do all that stuff that make can!
    qmake doesn't substitute make! It uses it to obtain its goal instead. You can't use qmake without make, be aware of that. qmake is just a tool for maintaining the project - something make can't do on its own. If you like writing makefiiles, you might not use qmake at all or try to mimic its behaviour using pure make rules. Just remember that qmake guarantees that Qt applications will build properly. Without it you have to guarantee that yourself by adding or removing appropriate defines or other statements to the makefile.

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

    mchara (12th November 2007)

Similar Threads

  1. How to create Custom Slot upon widgets
    By ashukla in forum Qt Programming
    Replies: 6
    Last Post: 8th September 2007, 14:07
  2. Connect Button to a custom slot
    By Majestade in forum Qt Programming
    Replies: 2
    Last Post: 28th March 2007, 17:17
  3. Replies: 1
    Last Post: 26th January 2007, 07:10
  4. custom slot + Designer
    By bashamehboob in forum Qt Tools
    Replies: 1
    Last Post: 28th April 2006, 15:17
  5. How to create custom slot in Qt Designer 4.1?
    By jamadagni in forum Qt Tools
    Replies: 31
    Last Post: 18th January 2006, 20:46

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.