[p4] Fwd: p4v 2007.3 and Qt "styles"
Rick Macdonald
rickmacd at shaw.ca
Fri May 9 20:47:40 PDT 2008
Arnt - thanks, you helped me get to the bottom of it all.
I have the Qt3 version of qtconfig. It writes out to ~/.qt/qtrc. A style
setting in the General section of this file does indeed affect old
versions of p4v, such as p4v 2006.1, but not 2007.3 which is Qt4.
I don't have a Qt4 version qtconfig. I ran strace on p4v 2007.3 starting
up, and looked at all the files that might hold a style setting in the
[General] section. I found p4v-2007.3.151553/bin/qt.conf which comes
with p4v, and ~/.config/Trolltech.conf. I added the General section to
both but it had no effect.
Then I installed Qt4 on my Debian system to get qtconfig-qt4, and ran
it, and set the style. It wrote out to ~/.config/Trolltech.conf but this
time it worked! The difference was that qtconfig-qt4 put style=windows
in both a [General] section and a [Qt] section. Testing shows that it's
the [Qt] that makes it work.
Unfortunately, the [Qt] style setting has no effect if placed in the
p4v-supplied file p4v-2007.3.151553/bin/qt.conf. That would have made it
easy to deliver and install.
The ~/.config/Trolltech.conf directory and file are created the first
time you run p4v if it doesn't exist. If the file exists and contains
only the [Qt] section and the style setting, p4v appends the other
things that it would have created the file with. This means that a
wrapper script could:
- create ~/.config and the Trolltech.conf file with the style setting if
they don't exist
- append the [Qt] and style setting if the conf file exists but doesn't
contain the style setting.
So, all is finally well in terms of a get-around, but it's a bit fiddly.
The qtconfig-qt4 program also showed me the proper list of Qt4 styles:
CDE
Cleanlooks
Motif
Plastique
Windows
Thanks Arnt!
Rick
Arnt Gulbrandsen wrote:
> Hm... sounds like support either didn't know about Qt settings even
> though there is an enhancement request, or p4v goes to some length to
> disable Qt's settings code. The former sounds odd, the latter very
> much so.
>
> Qt applications generally look for settings in several files. In p4v's
> case I would expect it to look in /etc/qtrc, ~/.qt/qtrc and
> ~/.p4v/something, and it might create one or more of those files too.
>
> These files are (mostly) ASCII, you can edit them with a text editor.
> You want to set the [General] style setting to Windows, like this:
>
> [General]
> style=Windows
>
> You may also find that you have a program called qtconfig. If you do,
> you can use it to configure this and a few other aspects of Qt.
>
> On Windows, all this is stored in the registry. On the Mac it's carbon
> preferences. If you want it on mac/windows I'd try installing qtconfig
> and looking to see which precise registry setting or carbon preference
> setting qtconfig changes.
>
> Arnt
>
More information about the perforce-user
mailing list