Re: Platform independent GUI
One final question - do you use layouts in your applications?
Re: Platform independent GUI
Ahh... no one wins from this man..
Re: Platform independent GUI
Quote:
Originally Posted by
wysota
One final question - do you use layouts in your applications?
I do.
(10 characters long)
Re: Platform independent GUI
Quote:
Originally Posted by
bnilsson
I am sure this question must have been handled may times, but I have not found any answer in the forum.
What is the best way to get a platform independent GUI regarding font size, if you have a lack of real estate?
If I design by Windows Designer the Mac GUI will show label and button fonts too big to suit my layout, and vice versa if I design on Mac they will be too small if I view the resulting GUI on Windows.
Also, i.e. Arial 12 does not have the same size, on Windows it is really big, on Mac it is small.
Is there any font that will have a platform independent size?
Any hints for a strategy?
Except having completely different ui files for Mac and Windows, which will be a mess to maintain.
BN
Why not using images or pixmaps with text?, or font metrics, I didn't use it but maybe it could help you.
Re: Platform independent GUI
Quote:
Originally Posted by
bunjee
I do.
Why?
Quote:
(10 characters long)
Ditto.
Re: Platform independent GUI
Re: Platform independent GUI
Isn't it more convenient not to use it? Simply position widgets on the form and voilla?
Re: Platform independent GUI
It's simpler to do :
Code:
layout->addWidget(myWidget);
than
Code:
myWidget->move(posX, posY);
Re: Platform independent GUI
It's simpler to run Designer and setup everything there.
Re: Platform independent GUI
There is another thing you're not going to like : I never use Qt Designer.
:-).
Re: Platform independent GUI
Which is strange considering everything you said earlier. Another question in that case - do you allow your users to resize windows of your applications and why?
Re: Platform independent GUI
Regarding the font size I also notice that size is different in KDE from Gnome, also the lineedit boxes are very smaller in KDE, than in Gnome. I also had problems whit translation. Some setences can become bigger in different languages so in portuguese, my labels where "cutting" the words. I had to enlarge the size of the labels in the Qtdesigner. I'll have to check if there's a way to get the size of the text ant set the label size based on that
Re: Platform independent GUI
I'd be lost without layouts. I can't be bothered to find out the exact pixel co-ordinates to set all the widgets to, it's far easier to throw in some layout components and let Qt do all the work for me.
Re: Platform independent GUI
Quote:
Originally Posted by
john_god
I'll have to check if there's a way to get the size of the text ant set the label size based on that
QFontMetrics ?
Re: Platform independent GUI
Thanks I'll check that.
Also I use a lot layouts, they are very usefull.
Re: Platform independent GUI
Quote:
Originally Posted by
john_god
Some setences can become bigger in different languages so in portuguese, my labels where "cutting" the words. I had to enlarge the size of the labels in the Qtdesigner.
The only explanation for this is that you didn't use layouts properly or you encountered a known bug (or misfeature) in QLabel related to word wrapping. But if you have word wrapping disabled, you're certainly using layouts incorrectly.
Re: Platform independent GUI
Quote:
Originally Posted by
wysota
Which is strange considering everything you said earlier. Another question in that case - do you allow your users to resize windows of your applications and why?
I tend to limit window resizing to when it's needed. If an application doesn't need to be resized, just don't make that option available.
Again, if resizing a window gives the user a way to screw up the interface, it's not good.
Re: Platform independent GUI
Quote:
Originally Posted by
wysota
The only explanation for this is that you didn't use layouts properly or you encountered a known bug (or misfeature) in QLabel related to word wrapping. But if you have word wrapping disabled, you're certainly using layouts incorrectly.
There's another explanation, it was late, I was tired and sleppy when I wrote the post, because I have layouts in the main window but not in that particulary dialog :p ... I need vacations...........
Re: Platform independent GUI
So you were not using layouts properly :)
Re: Platform independent GUI
Nop......
But last night after posting I start reading again chapter 1 and 2 of "C++ GUI Programming with Qt4".
AH...... What a great book :cool: (thinking out loud: it will never stop amazing me with my ignorance) :p