[Interest] Qt5 and "global" configuration

Thiago Macieira thiago.macieira at intel.com
Thu Nov 13 01:12:42 CET 2014


On Wednesday 12 November 2014 23:10:49 René J.V. Bertin wrote:
> On Wednesday November 12 2014 12:46:02 Thiago Macieira wrote:
> > 1) application self-containing: we don't want to open files we shouldn't,
> > especially on more locked-down platforms like OS X
> 
> ?? Why would Qt (apps) not be able to open Qt configuration files? Thank
> goodness OS X hasn't yet become like iOS where indeed it would be
> complicated to have shared, global configuration settings.

OS X itself is not the problem. The "Mac Store" is. One of the issues people 
had in sending Qt4-based applications to the Mac Store was the fact that it 
read from and wrote to a global Trolltech.conf file.

So that is gone.

> I'm a bit surprised to see disk access among the arguments, in a time where
> the first reaction to complaints about that are met with "get an SSD" ...
> We're talking about configuration parameters that are read exactly once
> when the application is starting up; that storage access must be completely
> drowned in the rest of the activity going on at that time.

The time it takes to open a file and parse it, however small, is higher than 
the time it takes to do nothing. The problem is not one specific task that is 
done, it's the fact that we have a lot of those tasks and they add up.

Besides, unless you're running Linux, your FS is slow. We can't tell people to 
only run Linux with Intel SSDs. Some people are trying to launch applications 
from eMMC or other slow storage, like an microSD card. 

And there's a lot of people trying to launch several Qt applications at the 
same time, on system boot.

> > Maybe you should not use an OS that you don't like?
> 
> That's off the point and not accurate. I cannot yet speak for 10.10, but
> earlier versions are fine with me (which is not to say they couldn't be
> better). It's Qt's Mac-native theme that gives a look that's somehow off to
> applications. You own Qt Creator definitely does not have the look and feel
> of a Mac application IMHO. Partly because applications typically do not use
> Lucida Grande 13 or 14 as their default font.

I don't now if the Creator team intended to be different or not. You'll have to 
take this up with them. If they did not intend to be different, then you've 
found bugs and they should  be fixed.

> > Anyway, the majority opinion is that Qt should look like the OS's own
> > look-
> > and-feel.
> 
> We're talking about giving choice, not about taking it away, but I'd like to
> see stats on that :) And also on what percentage thinks that user choice is
> even more important. And how many would actually prefer it if their
> application suite would look and feel the same regardless of what platform
> it runs on and use Qt in an attempt to achieve that.

Oh, there are lots of those. But Qt and especially QtWidgets were meant to 
make native look and feel with cross-platform code. Being able to support your 
UX is an aside, not the main goal. If you want to do your own UX, you have Qt 
Quick -- just don't use Qt Quick Controls, and have absolute control over your 
UI.

> Setting a default style is almost feasible on OS X by making the bundle
> executable a shell script that calls the binary with a style choice. Same
> cannot be said about the default font, though.

Agreed, the -style option should be removed, along with most options that Qt 
applications take on the command-line. Those are options for the application 
developer to use when writing the application, not meant to be used in 
production or, worse, be used by the user.

> Anyway, don't you think it could at least be possible to set such
> configuration choices per application so they become persistent across
> restarts?

You have access to QSettings. Use it.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list