Results 1 to 19 of 19

Thread: Understanding Projects with ancient Qt Designer (3.1)

  1. #1
    Join Date
    Sep 2014
    Posts
    8
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Understanding Projects with ancient Qt Designer (3.1)

    Hi Guys,

    First let me say that I've been programming for more years than I care to remember, however I'm brand new to Qt.
    I’m having to support some old software that runs on HP-UX and was produced using Qt Designer 3.1 (Qt 3.1.2) (looks to be about 2003 vintage). (Please note that for various reasons, a decision has been made to stick with this version, so please don’t tell me to use the latest version).

    I know I'll have lots of questions, but my first one is to do with the relationship between Projects and other components (specifically 'Main Window' and 'Dialog').

    I sort of expected that I could create a Project with all of my GUI files within it, (like in Visual Studio). So what I did was…
    New -> ‘C++ Project’
    I called it Adhoc
    Then I wanted to create the main window, so…
    New -> ‘Main Window’
    I called it ‘Adhoc Main’
    When I close Qt Designer and reopen the ‘Adhoc’ project I expected that it would also open ‘Adhoc Main’, but no, it shows the Adhoc project in a little box on the toolbar, but the ‘Adhoc Main’ form doesn’t open.
    There’s a menu option under ‘Project’ called ‘Add File’. I’ve tried adding ‘Adhoc Main’ to the project using this option, but the ‘Adhoc Main’ form still doesn’t get opened when I open the project.

    Any ideas?

    Many thanks

    Gary


    Added after 42 minutes:


    OK, so I've got it listing my forms when I open the project, however I had to move the files around and manually edit Adhoc.pro to get it working...
    Directory layout (new names)...
    Adhoc/Adhoc.pro
    Adhoc/frmAdhocMain.ui
    Adhoc/frmAddAdhocItem.ui

    Adhoc.pro contents…
    unix {
    UI_DIR = .ui
    MOC_DIR = .moc
    OBJECTS_DIR = .obj
    }
    FORMS = frmAdhocMain.ui \
    frmAddAdhocItem.ui
    TEMPLATE =app
    CONFIG += qt warn_on release
    LANGUAGE = C++

    The question that I’ve got now is can I get Designer to open Adhoc.pro by default when it starts up?

    Many thanks,

    Gary


    Added after 4 minutes:


    Also, on the New/Open dialogue, the 'Recently Opened' tab now shows links to stuff that no longer exists (has been moved/renamed). Is there a file somewhere that I can edit to update the 'Recently Opened' list?

    Thanks again,

    Gary
    Last edited by cooperman; 24th September 2014 at 11:30.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Understanding Projects with ancient Qt Designer (3.1)

    There seems to be a misunderstanding somewhere.

    Qt Designer is an editor for .ui Files, a visual layouting tool. It is not an IDE.

    If you are using QtCreator, you'll have to be careful not to edit the .ui files with the built-in designer, since that is of a newer version.

    Cheers,
    _

  3. #3
    Join Date
    Sep 2014
    Posts
    8
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Understanding Projects with ancient Qt Designer (3.1)

    Hi Anda,

    I'm not using QtCreator at all. It's a very old version of Qt Designer (3.1), which I am indeed using for form design.

    Any help with my 2 queries for Qt Designer (3.1) would be much appreciated.

    Many thanks,

    Gary

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Understanding Projects with ancient Qt Designer (3.1)

    Which IDE are you using then, if you are using one?

    If you are using just an editor, then manually edit the .pro and run qmake when you've changed it.

    Nothing really related to Designer, if it changes any of the .ui files, the Makefile generated by qmake will take care of applying the uic rules again on the next make invocation.

    Cheers,
    _

  5. #5
    Join Date
    Sep 2014
    Posts
    8
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Understanding Projects with ancient Qt Designer (3.1)

    Hi Anda,

    At the moment, I'm not using an IDE. I'm developing the functional specification and using Qt Designer to 'mock-up' the various forms.
    I've got Eclipse on my machine, so I don't know if I can use that when I get round to doing the coding.

    BTW, I've tried running qmake and it says...
    QMAKESPEC has not been set, so configuration cannot be deduced.
    Error processing file .../Adhoc.pro

    Any ideas?

    Thanks,

    Gary


    Added after 8 minutes:


    Incidentally, I got Qt Designer to open my project when it starts by starting it from a script and giving the project path as an argument...

    #!/bin/sh
    LD_LIBRARY_PATH=//home/coopega1/tools/Qt/qt-3.1.2/lib/i86_linux /home/coopega1/tools/Qt/qt-3.1.2/bin/i86_linux/designer /home/coopega1/Projects/AdhocTrend/QtFiles/Adhoc/Adhoc.pro

    Best regards,

    Gary
    Last edited by cooperman; 25th September 2014 at 11:32.

  6. #6
    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: Understanding Projects with ancient Qt Designer (3.1)

    As far as I remember there is an "Open Project" entry in the Designer 3.1 menu somewhere which will open a pro file for you. Then you need to open particular .ui files if you need them and work from there. But in general don't expect any IDE-like support in Designer, it can only do syntax highlighting for you and will open ui.h files for you when you double click buttons you placed on forms. If you never had experience with Qt3 Designer, I suggest you don't use it but rather use QtCreator as IDE and only edit ui files in Designer (and pay attention not to open ui files with Creator). I'm also not sure if you will be able to build your projects from within Creator or will you have to use the command-line interface.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Sep 2014
    Posts
    8
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Understanding Projects with ancient Qt Designer (3.1)

    Hi Wysota,

    We have other apps in our disribution built with this version Qt Designer and Qt3 and for various reasons we're keen to stick with these development tools.
    What benefits exactly would Qt Creator give me if I can't use it to edit my ui files and can't use it to build the application?
    Is there a version of Qt Creator that I can download that will work with Qt3?

    Many thanks,

    Gary

  8. #8
    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: Understanding Projects with ancient Qt Designer (3.1)

    Qt Creator offers automating the building process, offers code highlighting, code completion and other more or less sophisticated editing tools Qt3 Designer doesn't have. It is not something you can't live without, though.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Sep 2014
    Posts
    8
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Understanding Projects with ancient Qt Designer (3.1)

    Is ther a version of Qt Creator that I can use for Qt/Qt Designer 3?

    Many thanks,

    Gary

  10. #10
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Understanding Projects with ancient Qt Designer (3.1)

    Quote Originally Posted by cooperman View Post
    We have other apps in our disribution built with this version Qt Designer and Qt3 and for various reasons we're keen to stick with these development tools.
    Wysota was not suggesting to change that

    Quote Originally Posted by cooperman View Post
    What benefits exactly would Qt Creator give me if I can't use it to edit my ui files and can't use it to build the application?
    QtCreator is a really nice C++ IDE, with special "understanding" of Qt, e.g. completion in SIGNAL/SLOT connections.
    But you can use Eclipse as well.

    Quote Originally Posted by cooperman View Post
    Is there a version of Qt Creator that I can download that will work with Qt3?
    Any version of QtCreator should do, i.e. it does not need to be built with the same version of Qt that the projects are using.
    You can configure toolchains, called "kits" in QtCreator, including which Qt version to use.

    Cheers,
    _

  11. #11
    Join Date
    Sep 2014
    Posts
    8
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Understanding Projects with ancient Qt Designer (3.1)

    Hi Anda,

    I found the bit to add kits and it seemed to me like I needed to also create a new Qt Version (as only 4.8.5 was listed). Anyhow, I've added a new verion and pointed it to where my qmake executable is (/home/coopega1/tools/Qt/qt-3.1.2/bin/i86_linux), but it says:

    Could not determine the path to the binaries of the Qt installation, maybe the qmake path is wrong?
    Any ideas?

    Many thanks,

    Gary

  12. #12
    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: Understanding Projects with ancient Qt Designer (3.1)

    Quote Originally Posted by cooperman View Post
    Hi Anda,

    I found the bit to add kits and it seemed to me like I needed to also create a new Qt Version (as only 4.8.5 was listed). Anyhow, I've added a new verion and pointed it to where my qmake executable is (/home/coopega1/tools/Qt/qt-3.1.2/bin/i86_linux), but it says:

    Could not determine the path to the binaries of the Qt installation, maybe the qmake path is wrong?
    Any ideas?

    Many thanks,

    Gary
    Yeah, I think Qt Creator cannot work out of the box with qmake versions for Qt3 as the output it expects to receive is not generated by Qt3. However with little tweaking you should probably be able to make it work. That's not what you should be focussing on right now, though, as you can perform the build process manually just like you did until now.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  13. #13
    Join Date
    Sep 2014
    Posts
    8
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Understanding Projects with ancient Qt Designer (3.1)

    Hi Wysota,

    Really appreciate your help (and Anda's).

    Yeah, the reason that I started looking at that was because I'd been going through a video tutorial on the web and it has been talking about signals and slots and I was trying to make a button on my Main Window, open another form (Dialogue) that I'd created. Unfortunately, the only form listed was frmMain and not any of my sub-forms. Anyhow, I thought that if I could make Qt Creator a 'wrapper' around the work I'd done so far, then I might be able to make my other forms 'receivers'.

    BTW, any clues about the tweaking that you mention?

    Cheers,

    Gary

  14. #14
    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: Understanding Projects with ancient Qt Designer (3.1)

    Quote Originally Posted by cooperman View Post
    Yeah, the reason that I started looking at that was because I'd been going through a video tutorial on the web and it has been talking about signals and slots and I was trying to make a button on my Main Window, open another form (Dialogue) that I'd created. Unfortunately, the only form listed was frmMain and not any of my sub-forms. Anyhow, I thought that if I could make Qt Creator a 'wrapper' around the work I'd done so far, then I might be able to make my other forms 'receivers'.
    Creator is just an advanced code editor, it will not turn your non-working solutions into working solutions.

    BTW, any clues about the tweaking that you mention?
    You'd have to provide a script or some other qmake stand-in to provide output Creator expects to receive when querying your qmake. You have to trick Creator to think it deals with Qt4 qmake.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  15. #15
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Understanding Projects with ancient Qt Designer (3.1)

    Quote Originally Posted by cooperman View Post
    Yeah, the reason that I started looking at that was because I'd been going through a video tutorial on the web and it has been talking about signals and slots and I was trying to make a button on my Main Window, open another form (Dialogue) that I'd created. Unfortunately, the only form listed was frmMain and not any of my sub-forms.
    Ah.
    In this case you don't need designer at all for the moment.

    For each form UIC will have generate a class.
    What you do additionally is having another class each that inherits from the generated on.

    In the class that inherits from your main window form class, you add a slot and connect that to the button.
    In the slot you create an instance of the class inheriting from the second form class and show it.

    Alternatively you can create the instance of the second class earlier and connect the button's clicked() signal to the second window's show() slot.

    Cheers,
    _

  16. #16
    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: Understanding Projects with ancient Qt Designer (3.1)

    Quote Originally Posted by anda_skoa View Post
    For each form UIC will have generate a class.
    What you do additionally is having another class each that inherits from the generated on.
    As far as I remember in Qt3 "by default" the class generated is used directly and not inherited. The Designer lets one edit a xxx.ui.h file which gets included by uic generated code. So if OP maintains some code written earlier, it is likely ui.h is already used and inheriting without refactoring existing code.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  17. #17
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Understanding Projects with ancient Qt Designer (3.1)

    Quote Originally Posted by wysota View Post
    As far as I remember in Qt3 "by default" the class generated is used directly and not inherited. The Designer lets one edit a xxx.ui.h file which gets included by uic generated code. So if OP maintains some code written earlier, it is likely ui.h is already used and inheriting without refactoring existing code.
    That was possible but really not recommended.

    The difference between Qt4 and Qt4 in this context is that Qt4's UIC does not generate a QWidget derived class, so there are now additional options other than inheritance, e.g. the ui pointer member.

    Cheers,
    _

  18. #18
    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: Understanding Projects with ancient Qt Designer (3.1)

    Quote Originally Posted by anda_skoa View Post
    That was possible but really not recommended.
    I know but it was the default behaviour of Qt Designer. So it is likely that legacy code makes use of this approach.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  19. #19
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Understanding Projects with ancient Qt Designer (3.1)

    Quote Originally Posted by wysota View Post
    I know but it was the default behaviour of Qt Designer.
    I don't think Designer ever created additional files by default.
    When you create a form, it only saves that into a single .ui file.

    Quote Originally Posted by wysota View Post
    So it is likely that legacy code makes use of this approach.
    Maybe. In 14 years of developing Qt application in various contexts I've never come across any non-trivial project using that approach due to it being way to limited for a sustainable development workflow.

    Inexperienced people with tiny pet projects maybe, but anyone else I've encountered preferred a programmer's editor or IDE for writing C++ code.

    Cheers,
    _

Similar Threads

  1. Understanding QSizePolicy
    By JaV0 in forum Qt Programming
    Replies: 2
    Last Post: 18th September 2012, 19:07
  2. QUdpSocket understanding
    By ale301168 in forum Qt Programming
    Replies: 4
    Last Post: 7th July 2011, 07:33
  3. Replies: 2
    Last Post: 7th September 2010, 21:19
  4. Understanding RGB888
    By scarleton in forum Qt Programming
    Replies: 6
    Last Post: 29th August 2010, 20:03
  5. I need help understanding QGraphicsView
    By aarelovich in forum Qt Programming
    Replies: 13
    Last Post: 22nd July 2009, 20:02

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.