FET Forum

FET Support (English) => Programming Help => Topic started by: conejame on July 07, 2008, 10:11:36 PM

Title: (Mixed) versions of QT
Post by: conejame on July 07, 2008, 10:11:36 PM
Hi Liviu,

I would like to change the way one of the screens works, and I think I need a Qt4 table widget, to do what I want.  What do you think to having a mixture of Qt3 and Qt4 screens, in different subdirectories in the source, as an interface?

(This is on a path to using fet as a user interface, to write a .fet file, and then computing my scheduling problem with a command-line program.)

Regards,
James.
Title: Re: (Mixed) versions of QT
Post by: Liviu Lalescu on July 08, 2008, 07:42:09 AM
You can do that, of course. The fact is that I have also used a mixture of .ui files for Qt 3 and 4 (fetmainform_template..ui and helpaboutform_template.ui and maybe a few others are in Qt 4 and the rest in Qt 3). They are in the same directory (does not matter).
Title: Re: (Mixed) versions of QT
Post by: conejame on July 10, 2008, 09:49:41 AM
I've worked out that you have to:
 - load and save the .ui file in Designer
 - move the .ui file from the FORMS3 list to the FORMS list
 - add setupUi() to the constructor
 - rewrite the setText methods

I'm currently stuck on:
 - the slots/signals for closing the form don't work
      - if I call accept() and reject() directly from the designer, the form closes
      - if I call them from the custom functions, the form stays put

 - when the application shuts down, the memory allocator dumps core in the ~~QtMutex~~

 - I haven't made the change I want (being able to go through all of the cells and change them, without using the mouse for every cell) work yet
     - if I make them tick boxes, <space> toggles them, but I don't know how to receive notice that they have toggled, in order to change the words

 - I have made the user inteface worse
     - the layout manager doesn't stretch the grid of tick boxes, etc, in order to use it's share of the form

So I am currently defeated by Qt.
Title: Re: (Mixed) versions of QT
Post by: Liviu Lalescu on July 10, 2008, 10:16:01 AM
QuoteI've worked out that you have to:
 - load and save the .ui file in Designer
 - move the .ui file from the FORMS3 list to the FORMS list
 - add setupUi() to the constructor
 - rewrite the setText methods

I'm currently stuck on:
 - the slots/signals for closing the form don't work
      - if I call accept() and reject() directly from the designer, the form closes
      - if I call them from the custom functions, the form stays put

 - when the application shuts down, the memory allocator dumps core in the ~~QtMutex~~

 - I haven't made the change I want (being able to go through all of the cells and change them, without using the mouse for every cell) work yet
     - if I make them tick boxes, <space> toggles them, but I don't know how to receive notice that they have toggled, in order to change the words

 - I have made the user inteface worse
     - the layout manager doesn't stretch the grid of tick boxes, etc, in order to use it's share of the form

So I am currently defeated by Qt.

You could also use Qt 3 for GNU/Linux, which is free software. Qt 3 for Windows is not free software, unfortunately.

The first 4 steps you describe are correct, I am not sure they are enough.

There are many Qt functions for knowing if it was toggled a check box. Please see Qt help for QCheckBox.

I have used direct connections from designer Qt 3. In Qt 4, you need to implement directly in the source the connections, using the connect function.

I am not very good at Qt, that is why the FET interface is bad.
Title: Re: (Mixed) versions of QT
Post by: Liviu Lalescu on July 10, 2008, 10:48:00 AM
Also, to align in a grid or horizontally or vertically some widgets, you can use the function "Lay Out" of Qt Designer.