You are not logged in.

scooter

Beginner

  • "scooter" is male
  • "scooter" started this thread

Posts: 24

Location: Germany

Occupation: computer scientist / software engineer

  • Send private message

1

Monday, January 26th 2004, 1:56pm

Bad features (or bugs?) in Qt Designer

(Newbie using Qt 3.2 under Linux)

- A file with the extensions '.cqt', or '.hqt' resp., added to a project list will be not shown in this list. You are forced to use '.c'/'.cpp', or '.h'/'.hpp' resp., to get it visible. X(

- Quite often the layout of my widgets is shifted and/or have other sizes, although I didn't touch it. It costs a lot of time to reorder the layout. The provided layout manager is no help. X(

- By the way, the layout manager: You will get shortened dialog boxes when you compile your codes with the red lines of the layout manager not removed from your dialogs - the lower half of all widgets at the dialog bottom is missing. There is no hint in the manual. I found a solution by chance. X(

- Very often I'm not able to use the Ctrl-T accelerator to display a dialog preview. I have to use the menu item instead. X(

- I found no way to add a whatsThis text to the main form, although there is a property for it.

- I found no way to assign the menu item 'Help' the F1 key as the accelerator, although I'm able to type this key as a property valueby pressing it on the keyboard.

- I found no dialog property to force the dialog to be displayed monitor-centered (or other) when shown. The mainform dialog jumps widely over the screen at each program launch, depending on the other task's dialogs positions. MS Windows does better here...

- I found no way to fix a widget's size to a certain value with no chance of the layout manager to change it...

- The 'frameShape' and 'frameShadow' properties of some widgets offer items which have no changing effect on the widget: The previous frame style remains. Changing to another style and changing back to the first style (i.e., not this style is the current frame property item) has no effect to the widget: it keeps the style it had before the last change.

- QTable: I have a spreadsheet with two columns, both with strings written into them. The first is a QString containing digits. Contrary to documentation, this QString is not aligned to the left but to the right as if it was an integer. X( The other string, a const char[], is aligned correctly. Who can help?

- Diabling a menu item (which has sub-items) while designing greys this item and its sub-items. When checking the preview, only the sub-items are greyed.

Well, that's it for now... :))
[Qt 4.4.x]
so much to do, so little what is meaningful...

2

Monday, January 26th 2004, 3:57pm

RE: Bad features (or bugs?) in Qt Designer

Quoted

Originally posted by scooter
(Newbie using Qt 3.2 under Linux)

- A file with the extensions '.cqt', or '.hqt' resp., added to a project list will be not shown in this list. You are forced to use '.c'/'.cpp', or '.h'/'.hpp' resp., to get it visible. X(


In general its better if you use .cpp/.hpp , it gives make a hint as to what compiler to use (gcc or g++). if its '.cqt' - what is it supposed to use? While you are still a newbie, respect these sorts of standards. It will be easier for you.

Quoted


- Quite often the layout of my widgets is shifted and/or have other sizes, although I didn't touch it. It costs a lot of time to reorder the layout. The provided layout manager is no help. X(


The widgets are supposed to resize when the entire dialog/window resizes. Thats the whole point. Unlike VB6 where the widgets stay exactly where they are put, but you then have to write the code to resize all the widgets correctly.

You can make them static, by not using any layouts at all. You can set the size policies to Fixed, and set the sizes in designer.

Quoted


- By the way, the layout manager: You will get shortened dialog boxes when you compile your codes with the red lines of the layout manager not removed from your dialogs - the lower half of all widgets at the dialog bottom is missing. There is no hint in the manual. I found a solution by chance. X(


And, it looks like the rest of us will have to also find the solution by chance - unless you tell us what it is ! X( whats the point of complaining about some random "bug" if you dont even tell us the whole story.

Quoted


- Very often I'm not able to use the Ctrl-T accelerator to display a dialog preview. I have to use the menu item instead. X(


If your other menu items work (like ctrl-q for quit), then its likely to be your Window Manager's fault that ctrl-T doesn't work. In that case, QT has absolutely NOTHING to do with this problem, and should not have been blamed.

Quoted


- I found no dialog property to force the dialog to be displayed monitor-centered (or other) when shown. The mainform dialog jumps widely over the screen at each program launch, depending on the other task's dialogs positions. MS Windows does better here...


Again, you anger me by jumping to the conclusion that "Since I can't do it, therefore it can't be done, therefore MS Windows is better". That does reflect how much of a newbie you are and how much you have to learn. Don't mistake your ignorance for a bug.

Try looking at the QSplashScreen code, that puts the dialog in the middle of the screen every time.

Quoted


- I found no way to fix a widget's size to a certain value with no chance of the layout manager to change it...


Try setting the size-policies to Fixed

Quoted


- The 'frameShape' and 'frameShadow' properties of some widgets offer items which have no changing effect on the widget: The previous frame style remains. Changing to another style and changing back to the first style (i.e., not this style is the current frame property item) has no effect to the widget: it keeps the style it had before the last change.


Not sure here, but I would guess that some widgets don't use the frame-shape/shadow property. Maybe their frames are hidden? I dunno.

Quoted


- QTable: I have a spreadsheet with two columns, both with strings written into them. The first is a QString containing digits. Contrary to documentation, this QString is not aligned to the left but to the right as if it was an integer. X( The other string, a const char[], is aligned correctly. Who can help?


Does the other string also contain integers? You might find that (like spreadsheets like lotus-123, excel and probably OO calc), ANY string that is a number is aligned to the right. Its well known that numbers are better aligned to the right in such situations like accounting (where spreadsheets are used the most).

If you want to change that, then you need to specify the alignment. I dunno how, but there is a way, even if you have to reimplement ::paintEvent()

Quoted


- Diabling a menu item (which has sub-items) while designing greys this item and its sub-items. When checking the preview, only the sub-items are greyed.


Did you check the compiled result? Sometimes the designer doesn't reflect what truely happens, and sometimes the preview doesn't reflect what happens. Its only the resulting code that is important. Whatever the code does, is supposed to happen. Everything else is an approximation.

Quoted


Well, that's it for now... :))


I'm glad. Try not to make judgements until you know all the facts, it only displays your ignorance of your ignorance. Having said that, I hope I haven't displayed mine.

Debboy.

Posts: 2,162

Location: Graz, Austria

Occupation: Student

  • Send private message

3

Monday, January 26th 2004, 6:30pm

RE: Bad features (or bugs?) in Qt Designer

Quoted

Originally posted by scooter
- Quite often the layout of my widgets is shifted and/or have other sizes, although I didn't touch it. It costs a lot of time to reorder the layout. The provided layout manager is no help. X(

Hmm, never happend to me, but I most recent version is 3.1.2

Quoted


- By the way, the layout manager: You will get shortened dialog boxes when you compile your codes with the red lines of the layout manager not removed from your dialogs - the lower half of all widgets at the dialog bottom is missing. There is no hint in the manual. I found a solution by chance. X(

Do you have a closed hierachy of layouts?
Sometimes one can forget the top-most layout, the one of the dialog itself.
Then the dialog can be resized beyond the inner layouts restrictions.

Quoted


- Very often I'm not able to use the Ctrl-T accelerator to display a dialog preview. I have to use the menu item instead. X(

Strange, either the 3.2 designer is buggy or something else is taking the accelerator.

Quoted


- I found no way to add a whatsThis text to the main form, although there is a property for it.

In 3.1 Designer you can add the text right into the property.
Clicking the "..." button opens, as expected, an editor dialog.

Are you sure it doesn't work any more?

Quoted


- I found no way to assign the menu item 'Help' the F1 key as the accelerator, although I'm able to type this key as a property valueby pressing it on the keyboard.

Hmm, good question, I think you can just enter "F1" into the action's accelerator property.

Quoted


- I found no dialog property to force the dialog to be displayed monitor-centered (or other) when shown. The mainform dialog jumps widely over the screen at each program launch, depending on the other task's dialogs positions. MS Windows does better here...

A window with parent usually opens centered on its parent.
A window without a parent will be placed by the window manager unless it requests a position.
Not sure about this MS Windows remark, are you referring to a different experience with Qt/Win in contrast to Qt/X11?

Quoted


- I found no way to fix a widget's size to a certain value with no chance of the layout manager to change it...

Easy: MinimumSize and MaximumSize to the same value.

Cheers,
_
Qt/KDE Developer
Debian User

scooter

Beginner

  • "scooter" is male
  • "scooter" started this thread

Posts: 24

Location: Germany

Occupation: computer scientist / software engineer

  • Send private message

4

Tuesday, January 27th 2004, 11:31am

RE: Bad features (or bugs?) in Qt Designer

Thanks anda_skoa,

you see, debboy, there is a way to talk to a Qt newbie without getting angry. We all started as a baby on this world ;-) I didn't intend to get punched down by calling me a 'newbie' on Qt (with me not a newbie on coding, though)...

- Files missing in the project list:
Since Qt allows to open and save a number of file types I see no point in using standardized file extensions whenever I want to use other extensions for certain reasons. So not displaying them in the project list *is* a bad feature of Qt. ('.cqt' indicates a C file created with Qt by me, in order to distinguish it from other C files by just a glance at the file list.)

- Layout shifts:
As I stated, I did *NOT* touch the dialog, nor changed any of the widgets in any way. The described 'feature' occasionally happens when I just write some code dealing with the results of the dialogs, sometimes even when I relaunch Qt the other day with not doing anything else. This indeed *is* a bug.

- Red lines of the layout manager cut widgets:
Yes, anda_skoa, I had a closed hierarchy of layouts, but the problems continues. Before compiling I had to remove the red lines and then everything was displayed properly. Now I don't use the layout manager any more: I do much better with placing the widgets by myself than having done it by the layout manager which squeezes or expands the widgets by some inscrutable scheme and destroys my layout work. Yes, I confess this might be 'VB' style, but it saves me from getting grey hair to early...

- Preview accelerator:
I work under Linux 2.4.20 with KDE 3.1.1 with default settings. There is no other application taking the accelerator. When coding I always use the same programs which are all launched. So why is it that sometimes I can't use Ctrl-T for previewing?

- WhatsThis for mainform:
Yes, anda_skoa, I know how to add a value to a property. Indeed I can type a text to this property, however, it won't be displayed in the compilation. Other widget's whatsThis property works fine, though.

- F1 key as Help accelerator:
It's irrelevant whether I type 'F1' as value or press the 'F1' key: In both cases 'F1' is displayed as value but when compiled, this key can't be accessed for the Help. Checking the property shows that the value was removed by Qt.

- 'One should be able to display mainforms centered':
I'm not the only one (read other postings in this Forum) who is annoyed about Qt's practice with mainforms (note I don't mean windows with parents -- I know how they are displayed). Sorry for mentioning MS Windows; VB was meant. And I wonder why VB (which is slighted by some coders wrongly) is able to do something what Qt refuses to do, since QSplashScreen is able to do it -- so why not making this feature available to other classes? Where's the problem, folks?

- Fix a widget's size:
Thanks, will give it a try.

- 'frameShadow' and 'frameShape':
Sorry, there was an orthographical mistake which might lead to misunderstandings. What I meant was: Suppose you want to change the widget's frame to style 1. Now try the look of another one, style 2. After a third try you change back to style 1, but style 3 remains displayed. Either you create the widget again to get style 1 back, or you loose some time selecting arbitrarily styles to get style 1 displayed again.

- Strings in a spreadsheet:
I know how other applications, such as Excel, work with strings consisting of digits. But when Qt writes in its manual that QStrings are displayed to the left of a cell, I think I can expect this feature to work correctly; otherwise, it *is* a bug. By the way, both strings mentioned consist of numbers, the second with some points in it. And contrary to debboy, I know how to change this behavior: by subclassing QTable, as mentioned in the manual. But I don't want to subclass when I actually don't need to according to Qt's manual...

- Disabling menu items:
Qt Designer is a graphical help to code Qt. What use is it to have such a designer if I can't rely on what I see but have to wait for the compilation result? Such 'features' make any designer redundant. (See also red lines of layout manager discussed above.)

- 'That's all for now':
Well, debboy, 'try not to make judgements until you know all the facts.' For those who don't know Qt inside out it is not advisable to condescend others... (see my note on subclassing) No offence meant!

And there's another thing:
The undo icon can't be used, though there are actions which could be undone, unless you once clicked on the undo menu item first; only then the undo icon is available. Another 'bad feature?'

All of these problems could be reproduced by the staff of my company. They do have the same 'features' to manage with...
[Qt 4.4.x]
so much to do, so little what is meaningful...

axeljaeger

Professional

  • "axeljaeger" is male

Posts: 730

Location: Frankfurt Germany

Occupation: Student

  • Send private message

5

Tuesday, January 27th 2004, 12:18pm

The problem with the centered windows:
If you use KDE, there is a setting in the controllcenter which controls how new widgets should be placed( Econimic, Stacked, minimzed, whatever). QSplashScreen bypasses the Windowmanager. Thats the reason why you cant move it around. If you ask the windowmanager to handle your form, it's not any more your problem to manage the position of the form. Windows doesn't have such features in it "windowmanager" so don't come and cry. I know VB, there are some things that are or at least look nice, but it has so many strange "features" that I would not recommend it to anybody who want to do some serous coding.
It's nice to be important but it's more important to be nice

Posts: 2,162

Location: Graz, Austria

Occupation: Student

  • Send private message

6

Tuesday, January 27th 2004, 4:10pm

RE: Bad features (or bugs?) in Qt Designer

Quoted

Originally posted by scooter
- Red lines of the layout manager cut widgets:
Yes, anda_skoa, I had a closed hierarchy of layouts, but the problems continues. Before compiling I had to remove the red lines and then everything was displayed properly. Now I don't use the layout manager any more: I do much better with placing the widgets by myself than having done it by the layout manager which squeezes or expands the widgets by some inscrutable scheme and destroys my layout work. Yes, I confess this might be 'VB' style, but it saves me from getting grey hair to early...

Hmm, I have really large dialogs with tens of layouts and never had any problem.

Not using layouts is usually not option, it would requite too much work on resize code when the strings change due to internationalization or different widget style.

Try a simple widget without cascaded layouts, just some subwidgets and the invisible master layout for the main widget.

If that works, try break the master layout, put the widgets into a separate layout and recreate the master layout.

Should still work.

If it doesn't, could you send an example .ui file?
I'd like to test it with my designer.

Quoted


- Preview accelerator:
I work under Linux 2.4.20 with KDE 3.1.1 with default settings. There is no other application taking the accelerator. When coding I always use the same programs which are all launched. So why is it that sometimes I can't use Ctrl-T for previewing?

Strange.
Anyone else using a 3.2 designer?

Quoted


- WhatsThis for mainform:
Yes, anda_skoa, I know how to add a value to a property. Indeed I can type a text to this property, however, it won't be displayed in the compilation. Other widget's whatsThis property works fine, though.

- F1 key as Help accelerator:
It's irrelevant whether I type 'F1' as value or press the 'F1' key: In both cases 'F1' is displayed as value but when compiled, this key can't be accessed for the Help. Checking the property shows that the value was removed by Qt.


Will check that with my 3.1 designer, never set WhatsThis before :)

Quoted


- 'One should be able to display mainforms centered':
I'm not the only one (read other postings in this Forum) who is annoyed about Qt's practice with mainforms (note I don't mean windows with parents -- I know how they are displayed). Sorry for mentioning MS Windows; VB was meant. And I wonder why VB (which is slighted by some coders wrongly) is able to do something what Qt refuses to do, since QSplashScreen is able to do it -- so why not making this feature available to other classes? Where's the problem, folks?

Did you specifically request the center position?
If not, I already wrote above (and axel_jaeger as well) that positioning of windows that do not mvoe themselves to certain coordinates at show(), are placed by the window manager.
That might be centered or in a corner or where the WM thinks its best.

Quoted


- Strings in a spreadsheet:
I know how other applications, such as Excel, work with strings consisting of digits. But when Qt writes in its manual that QStrings are displayed to the left of a cell, I think I can expect this feature to work correctly; otherwise, it *is* a bug. By the way, both strings mentioned consist of numbers, the second with some points in it. And contrary to debboy, I know how to change this behavior: by subclassing QTable, as mentioned in the manual. But I don't want to subclass when I actually don't need to according to Qt's manual...


I haven't worked with QTable.
Does it have two add methods, oe for numbers and one for strings, or is it always strings, just with numbers as content.
In the latter case QTable or QTableItem might check the String content to see if it is a number. (most likely calling QString::toInt())

Cheers,
_
Qt/KDE Developer
Debian User

scooter

Beginner

  • "scooter" is male
  • "scooter" started this thread

Posts: 24

Location: Germany

Occupation: computer scientist / software engineer

  • Send private message

7

Wednesday, January 28th 2004, 8:30am

RE: Bad features (or bugs?) in Qt Designer

Quoted

Red lines of the layout manager cut widgets:

I will try your proposal within the next days.

Quoted

Mainform centered:

Yes, I do very well know that Qt usually uses the window manager and QSplashScreen bypasses it. And I know that if I need to change some widget settings before it is shown I could use showEvent(). Or bypass the WM entirely by the WX11BypassWM flag - but this would result in several problems of widget handling. *And* I know that it might be difficult for different operating systems with their WM's to handle my needs. But what I'm asking it: why is this feature provided with QSplashScreen only? Possible problems resulting in making it available to other classes should be whitewashed by Qt, since Qt is a GUI toolkit with the intention and purpose to make coding as easy and conveniently as possible.

Quoted

Strings in a spreadsheet:

I use 'void QTable::setText ( int row, int col, const QString & text )' for both strings. There is no overloaded method to it.

To axeljaeger:
Yes, VB has some strange features -- but serious coding is said not to be possible with VB? There still is a number of reputable companies in this world who estimate VB for its ability to make coding easy for small projects, and I really don't catch those who minify VB just for the fact it's not C. It's irrelevant indeed which programming language one uses as long as he is able to accomplish his object. I only mentioned VB in order to have an example of a programming language.
[Qt 4.4.x]
so much to do, so little what is meaningful...

axeljaeger

Professional

  • "axeljaeger" is male

Posts: 730

Location: Frankfurt Germany

Occupation: Student

  • Send private message

8

Wednesday, January 28th 2004, 8:44am

RE: Bad features (or bugs?) in Qt Designer

Quoted


Yes, I do very well know that Qt usually uses the window manager and QSplashScreen bypasses it. And I know that if I need to change some widget settings before it is shown I could use showEvent(). Or bypass the WM entirely by the WX11BypassWM flag - but this would result in several problems of widget handling. *And* I know that it might be difficult for different operating systems with their WM's to handle my needs. But what I'm asking it: why is this feature provided with QSplashScreen only? Possible problems resulting in making it available to other classes should be whitewashed by Qt, since Qt is a GUI toolkit with the intention and purpose to make coding as easy and conveniently as possible.

What feature? You can make every widget shown centered like QSplashScreen by bypassing the wm. This is not restricted to QSplashScreen. But centering is restricted to widgets that bypasses the wm.

Quoted


Yes, VB has some strange features -- but serious coding is said not to be possible with VB? There still is a number of reputable companies in this world who estimate VB for its ability to make coding easy for small projects, and I really don't catch those who minify VB just for the fact it's not C. It's irrelevant indeed which programming language one uses as long as he is able to accomplish his object. I only mentioned VB in order to have an example of a programming language.

I personaly used VB for the first programming language. Than I switched over to Java which was realy hard because Java is a real oo-language and I think VB is not. I never used VB 7 which has some changes I heard but I'm not interested in this language anymore. It might be good for very small projects where C++ is overkill but I was never satisfied with the minimal functions of VB. You have to use difficult WinAPI-Calls for everything that does a bit more than just showing some controlls. I'd prefer Python for small projects and for learning and C++ for bigger projects. At the moment I do some coding in Java writing JavaServlets.

I know that there are several people who do thier daily coding in VB because it's simple and these people are not coders but have some other jobs and use it to make their daily computer stuff more easily. But these people came to me and ask silly questions how to do this or something else with VB because they think I can do everything that I can do with Qt & C++ with their VB just because I used it for some years. This is definitely not possible. Using for example an OpenGL-Context in VB is not compareable to QGLWidget. The FormEditor of VB 6 was a joke compared to Designer. I heard that VB 7 has some very limmited options to anchor a widget to one border of the form. That's also a joke compared to layout managers. I think VB is pushed a bit to much. You can do something usefull with it but you can learn some better languages with only a bit more efford. So why use a Golf if you get a Ferrari for free?
It's nice to be important but it's more important to be nice

Posts: 2,162

Location: Graz, Austria

Occupation: Student

  • Send private message

9

Wednesday, January 28th 2004, 9:15am

RE: Bad features (or bugs?) in Qt Designer

Quoted

Originally posted by scooter
But what I'm asking it: why is this feature provided with QSplashScreen only? Possible problems resulting in making it available to other classes should be whitewashed by Qt, since Qt is a GUI toolkit with the intention and purpose to make coding as easy and conveniently as possible.


I think a normal window should not bypass the WM, because it will then be unmanaged, you would have to do anything related to window manager (moving, reszing) tasks yourself. Does not sound very comfortable to me.

I think Qt implements the most resonable behaviour:
- dialogs with parent appear over their parent center.
- windows without parents appear where the window manager puts them, because this is what the user expects, because this is what he/she configured.

You can easily (well you have to take care of multiple screen setups then) set a top level window to screen center yourself, if you thinkg that it is important for your application to act differently the other programs on the platform, for example if you want to have same behaviour across platforms.

In the windows constructor, calculate the position (see QDesktopWidget) and call QWidget::move()
I use this a lot a work, because our customer wants window positions and size persistant across sessions.


Quoted

I use 'void QTable::setText ( int row, int col, const QString & text )' for both strings. There is no overloaded method to it.

Ok, then I guess setText internally tries to see if the given string is actually a number.

I guess you have to subclass QTableItem for your "looks like a number but isn't one" items.

Cheers,
_
Qt/KDE Developer
Debian User

scooter

Beginner

  • "scooter" is male
  • "scooter" started this thread

Posts: 24

Location: Germany

Occupation: computer scientist / software engineer

  • Send private message

10

Wednesday, January 28th 2004, 1:21pm

RE: Bad features (or bugs?) in Qt Designer

To axeljeager:

Quoted

What feature? You can make every widget shown centered like QSplashScreen by bypassing the wm. This is not restricted to QSplashScreen. But centering is restricted to widgets that bypasses the wm.


Maybe we are talking cross purposes, but how shall I do that without getting several problems, such as a frameless widget (according to Qt's manual)? It'd be good if you provide some code for me if it's different to the method described by anda_skoa.

To anda_skoa:

Quoted

I guess you have to subclass QtTableItem for your "looks like a number but isn't one" items.


Yes, that's what I fear. Qt is promising a feature which it is neglecting and the user has to use a workaround. (Not meant that negative as it might be understood.) Any idea for a working code?
[Qt 4.4.x]
so much to do, so little what is meaningful...

axeljaeger

Professional

  • "axeljaeger" is male

Posts: 730

Location: Frankfurt Germany

Occupation: Student

  • Send private message

11

Wednesday, January 28th 2004, 1:31pm

RE: Bad features (or bugs?) in Qt Designer

Quoted

Originally posted by scooter
Maybe we are talking cross purposes, but how shall I do that without getting several problems, such as a frameless widget (according to Qt's manual)? It'd be good if you provide some code for me if it's different to the method described by anda_skoa.

You want a window that IS managed by the windowmanager but want it centered on the screen? There is no clean way to do so. You can try to show your window, in this moment it gets it's position from the windowmanager, and move it afterwards to the center of the screen. But I think you'll notice your window apperaing somewhere else on the screen and immediately later on your suggested position. So this is not clean but it's maybe good enough.
It's nice to be important but it's more important to be nice

Posts: 2,162

Location: Graz, Austria

Occupation: Student

  • Send private message

12

Wednesday, January 28th 2004, 1:33pm

RE: Bad features (or bugs?) in Qt Designer

Quoted

Originally posted by scooter
To anda_skoa:

Quoted

I guess you have to subclass QtTableItem for your "looks like a number but isn't one" items.


Yes, that's what I fear. Qt is promising a feature which it is neglecting and the user has to use a workaround. (Not meant that negative as it might be understood.) Any idea for a working code?


IMHO it is doing more than advertised.
It checks the content of a string, so you can use number without subclassing QTableItem.
Perhaps that is more widely used.

As for the code: I think overwriting alignment() should be sufficient

Source code

1
2
3
4
5
class AlwaysStringTableItem : public QTableItem
{
public:
    int alignment() const { return Qt::AlignLeft | Qt::AlignHCenter; }
};


cheers,
_
Qt/KDE Developer
Debian User