[Kde-java] QSettings.sync( )
David Goodenough
david.goodenough at btconnect.com
Wed Oct 6 13:21:02 CEST 2004
I presume that QSettings.sync is there to make sure that when saving
settings that the data is actually written out, given that there are no
real reliable destructors in Java. I presume also that it should be used
in preference to dispose?
Are there other classes like QSettings which normally assume a
reliable destructor mechanism and for which extra explict actions
on the programmers behalf are required?
I am also confused by the loadsettings( ) routine shown in the Qt
Designer manual. It runs like this:-
private void loadSettings( ) {
QSettings settings = new QSettings( );
int windowWidth = settings.readNumEntry( APP_KEY + "WindowWidth", 550);
int windowHeight = settings.readNumEntry( APP_KEY + "WindowHeight", 500);
int windowX = settings.readNumEntry( APP_KEY + "WindowX", 0);
int windowY = settings.readNumEntry( APP_KEY + "WindowY", 0);
m_clip_as = settings.readNumEntry( APP_KEY + "ClipAs", CLIP_AS_HEX);
m_show_web = settings.readBoolEntry( APP_KEY + "ShowWeb");
if( !settings.readBoolEntry( "View", true))
{
colourWidgetStack.raiseWidget( iconsPage);
viewIconsAction.setOn( true);
}
}
The thing that confused me is that the window* variables are read,
but never used. Is there something in the C++ environment that
makes this implicit, or is the manual just wrong. For my Java
version I had to add explicit calls to resize and move for the window
to return to where it was saved.
David
More information about the Kde-java
mailing list