Page 1 of 2 12 LastLast
Results 1 to 20 of 25

Thread: KDevelop and Qt4

  1. #1
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default KDevelop and Qt4

    I have the following problem:
    When I just istalled the new SUSE10 (ftp install), I saw it installed Qt4 and Qt3 in parallel, and my KDevelop could create a Qt4 projects, with the righ includes (i.e <QtCore/QApplication>) and compiled and linked ok.
    But for various reasons I had to undinstall Qt4.

    Then I reinstalled Qt4.
    Since then I can't get KDevelop to generate Qt4 projects (the option is just no there).
    I searched the Internet, and from what I could find out, ony KDevelop3.4 (unstable) supports Qt4.
    But as I said, at least once I had SUSE's KDevelop (which is defenitively not more then 3.3) created Qt4 projects...

    Can any one share with me if and how they work (installed) with KDevelop and Qt4 (prefferably under SUSE10)?

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Scandinavia
    Posts
    62
    Thanks
    5
    Thanked 2 Times in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: KDevelop and Qt4

    I'm running Qt3 and Qt4 and using both with KDevelop.
    setenv QTDIR /usr/lib/qt4 (and vice versa for QT3) before I start KDevelop from command line.

    I have not used KDevelop to create QT4 projects. But I use KDevelop to import an existing QT4 project, and to compile the code there without any problems.

    Also to make code completion work you need the source for QT4. Then just include the source as you would normally do when including an external library (Projects->Project Options->C++ Specific->Code Completion->Add->KDevelop Custom Directory PCS Importer).

    I'm not sure this was exactly what you needed, but I hope it helps.
    Last edited by KjellKod; 27th January 2006 at 09:41.

  3. #3
    Join Date
    Jan 2006
    Location
    DC
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: KDevelop and Qt4

    I believe KDevelop uses the environment variables - if QTDIR and your PATH are set to QT4, then it should use QT4's qmake, etc.

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: KDevelop and Qt4

    I believe KDevelop uses the environment variables - if QTDIR and your PATH are set to QT4, then it should use QT4's qmake, etc.
    But if you add a new class, it will add the wrong includes, and you wont be able to create new projects.
    You will be able to use it as KjellKod wrote.
    But since I already had KDevelop that generated Qt4 projects, I'd like to have it again.
    Very strange that whole thing...

  5. #5
    Join Date
    Jan 2006
    Posts
    24
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: KDevelop and Qt4

    Hi,

    you need set QTDIR and PATH...

    I make a patch for solve any problems with Qt4 support:

    http://bugs.kde.org/show_bug.cgi?id=101084
    http://bugs.kde.org/show_bug.cgi?id=120802

  6. #6
    Join Date
    Jan 2006
    Location
    Victoria BC
    Posts
    6
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: KDevelop and Qt4

    I am interested in all the discussion on this topic since I have been wanting to move up to Qt4. However, I am running Fedora4 and I believe this is based on Qt3.3, KDE3.5 and KDevelop3.3 and I have been concerned that KDE3.5 would not work if I changed to Qt4. Is everything backwards compatible or should I wait until KDE issues its next version which will hopefully be based on Qt4???

    OldJohnB

  7. #7
    Join Date
    Jan 2006
    Posts
    46
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: KDevelop and Qt4

    Quote Originally Posted by OldJohnB
    Is everything backwards compatible or should I wait until KDE issues its next version which will hopefully be based on Qt4???
    No it's not, it is possible to develop Qt3 compatible applications with Qt4, anyways, you don't need to replace one for another, you can have both installed, just need to set up your environment for one or the other when you need.
    I recommend you compile Qt4 for development and install it in a custom location e.g. /usr/local/Qt4 and set QTDIR and PATH to point that location when you're developing with Qt4.

    Hope it helps.

    Cheers.
    Kandalf
    There's no place like ~

  8. #8
    Join Date
    Jan 2006
    Location
    Innsbruck, Austria
    Posts
    62
    Thanks
    10
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: KDevelop and Qt4

    I'm running SUSE 10 with KDevelop 3.3 and I'm developing a project with QT4. I don't find much problems. When I create a new class and check "Generate a child class of QWidget", it creates the proper includes (i.e. #include <QWidget>). Just go to Project - Project options, then C++ specific, tab "Qt", and set the proper version of QT. In "Path to QT root" I have "/usr/lib". The only thing that is not working properly for me is the inclusion of images in the project. When I include some icons to use with QAction and run qmake, the Makefile has uic3 instead of uic (which is in fact uic from QT4):

    qmake_image_collection.cpp: 16_connect_creating.png 16_exit.png
    /usr/bin/uic3 -embed ../bin/siouk 16_connect_creating.png 16_exit.png -o qmake_image_collection.cpp

    So it gives a compiling. I don't know why this happens but it seems related to QT itself, not to KDevelop.

  9. #9
    Join Date
    Jan 2006
    Location
    Lincoln, NE USA
    Posts
    177
    Thanks
    3
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: KDevelop and Qt4

    Quote Originally Posted by OldJohnB
    I am interested in all the discussion on this topic since I have been wanting to move up to Qt4. However, I am running Fedora4 and I believe this is based on Qt3.3, KDE3.5 and KDevelop3.3 and I have been concerned that KDE3.5 would not work if I changed to Qt4. Is everything backwards compatible or should I wait until KDE issues its next version which will hopefully be based on Qt4???

    OldJohnB
    I am running SimplyMEPIS 3.4.3-rc2 upgraded to KDE 3.5 and I have no trouble developing QT4 apps under it. I use Kate and the console terminal that Kate supplies. I execute this command in the terminal:
    QTDIR=/usr/share/qt4;export QTDIR
    to set the proper QTDIR definition. Then I issue qmake commands with
    $QTDIR/bin/qmake
    The make command depends on the Makefile settings, which were created with the qmake command above, so I don't need to condition its execution.

    The editing and compiling work great. I issue the "designer-qt4" command from that terminal to get a properly running QT4 designer.

    And, I have no problem running KDE 3.5 or its applications. In fact, KDE 3.5 has given me the best KDE installation I've ever run.

  10. #10
    Join Date
    Jan 2006
    Location
    Victoria BC
    Posts
    6
    Qt products
    Qt3
    Platforms
    Unix/X11

    Smile Re: KDevelop and Qt4

    Thanks for all the suggestions. I now have lots to try.

    Cheers

  11. #11
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: KDevelop and Qt4

    Quote Originally Posted by vfernandez
    I'm running SUSE 10 with KDevelop 3.3 and I'm developing a project with QT4. I don't find much problems. When I create a new class and check "Generate a child class of QWidget", it creates the proper includes (i.e. #include <QWidget>). Just go to Project - Project options, then C++ specific, tab "Qt", and set the proper version of QT. In "Path to QT root" I have "/usr/lib". The only thing that is not working properly for me is the inclusion of images in the project. When I include some icons to use with QAction and run qmake, the Makefile has uic3 instead of uic (which is in fact uic from QT4):

    qmake_image_collection.cpp: 16_connect_creating.png 16_exit.png
    /usr/bin/uic3 -embed ../bin/siouk 16_connect_creating.png 16_exit.png -o qmake_image_collection.cpp

    So it gives a compiling. I don't know why this happens but it seems related to QT itself, not to KDevelop.
    You are describing the state I had my self, which I am trying to have again, but can't fegure out how to.
    Do mean you have an extra tab named Qt? (in project options)
    And in that tab you can set Qt4?

  12. #12
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    99
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: KDevelop and Qt4

    Do mean you have an extra tab named Qt? (in project options)
    And in that tab you can set Qt4?
    Maybe you are using different versions of kdevelop. My kdevelop version 3.2.0 doesn't have that tab either.

    from www.kdevelop.org :
    KDevelop 3.3 release Announcement

    The main focus of this release was the improvement of the integrated debugger and the new QT4 support.

    You can read more details at :
    http://www.kdevelop.org/index.html?f...velop-3.3.html

  13. #13
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: KDevelop and Qt4

    Thanks I'll look it up.

  14. #14
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: KDevelop and Qt4

    Ok, I installed KDevelop 3.3.0.
    But my KDevelop does not have a QT4 option in the project options...
    If I manualy create a Qt4 project, and start KDevelop it with PATH pointing at QT4, it will compile, but I have no Qt4 option to set nowhere...
    I can't understand how other poeple have that option...
    Ofcourse, the project generator generates Qt3 project...
    Hmm...

    Any idea what I could be doing wrong?

    EDIT:
    Ahhh, found it.!
    Its not under the current project option under the the make manager, but under the general project option accessable form the Project menu.
    Last edited by high_flyer; 2nd February 2006 at 22:07.

  15. #15
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: KDevelop and Qt4

    qmake_image_collection.cpp: 16_connect_creating.png 16_exit.png

    /usr/bin/uic3 -embed ../bin/siouk 16_connect_creating.png 16_exit.png -o qmake_image_collection.cpp

    So it gives a compiling. I don't know why this happens but it seems related to QT itself, not to KDevelop.
    The compilation error is generated because in order to embed an image the Qt3 uic is used (I don't know why), but I guess that through the Qt config files Qt4 knows to add the right code for Qt4.
    This means however, that you need to add the Qt3 supprt in Qt4.
    Add :
    QT += qt3support
    to your pro file, qmake it, and run make.
    It should compile.

  16. #16
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: KDevelop and Qt4

    The compilation error is generated because in order to embed an image the Qt3 uic is used (I don't know why)
    Ok, I know now why.
    Qt4 has resource system.
    From the docs:
    The Qt resource system is a platform-independent mechanism for storing binary files in the application's executable. This is useful if your application always needs a certain set of files (icons, translation files, etc.) and you don't want to run the risk of losing the files.
    The resource system is based on tight cooperation between qmake, rcc (Qt's resource compiler), and QFile. It obsoletes Qt 3's qembed tool and the image collection mechanism.

  17. #17
    Join Date
    Mar 2006
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: KDevelop and Qt4

    Hello,

    I am using Suse 10 with KDevelop 3.3.1 and Qt 4. I can compile my app and run it fine but unfortunately I lost the ability to debug it with breakpoints since I integrated Qt :-( I found a post on the web with the exact same problem and description (see below), but unfortunately no answer... I use CONFIG += qt debug thread warn_on and in the generated Makefile I set -g and -O0.

    http://linux.derkeiler.com/Newsgroup...5-05/0253.html

    Any ideas ?


    best regards,


    Christobal

  18. #18
    Join Date
    Jul 2006
    Location
    Belgium
    Posts
    6
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: KDevelop and Qt4

    Quote Originally Posted by high_flyer
    This means however, that you need to add the Qt3 supprt in Qt4.
    Add :
    QT += qt3support
    to your pro file, qmake it, and run make.
    It should compile.
    Once you edit the .pro file manually, you can not use the qmake manager anymore. It overwrites the contents of the .pro file.

    How can you add the qt3support via the Kdevelop qmake manager ? Or is this not possible ?

    Cedric.

  19. #19
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: KDevelop and Qt4

    Quote Originally Posted by glocker50
    How can you add the qt3support via the Kdevelop qmake manager ? Or is this not possible ?
    I have KDevelop 3.3.4 and QT variable is listed in custom variables tab (or whatever it's called in English version). It's the last tab in project configuration dialog (the one from qmake manager).

  20. #20
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: KDevelop and Qt4

    Another option is just to add -lQt3Support to the external libraries in your project.

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.