disable window geometry session handling for Qt < 4.2.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20543 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-09-27 15:07:40 +00:00
parent 90d1935d94
commit cd56d44a69
2 changed files with 8 additions and 0 deletions

View File

@ -95,17 +95,21 @@ private:
void showEvent(QShowEvent * e)
{
#if (QT_VERSION >= 0x040200)
QSettings settings;
std::string key = name_ + "/geometry";
QDialog::restoreGeometry(settings.value(key.c_str()).toByteArray());
#endif
QDialog::showEvent(e);
}
void closeEvent(QCloseEvent * e)
{
#if (QT_VERSION >= 0x040200)
QSettings settings;
std::string key = name_ + "/geometry";
settings.setValue(key.c_str(), QDialog::saveGeometry());
#endif
QDialog::closeEvent(e);
}
};

View File

@ -243,18 +243,22 @@ void GuiDialog::setController(Controller * controller)
void GuiDialog::showEvent(QShowEvent * e)
{
#if (QT_VERSION >= 0x040200)
QSettings settings;
string key = name_ + "/geometry";
restoreGeometry(settings.value(key.c_str()).toByteArray());
#endif
QDialog::showEvent(e);
}
void GuiDialog::closeEvent(QCloseEvent * e)
{
#if (QT_VERSION >= 0x040200)
QSettings settings;
string key = name_ + "/geometry";
settings.setValue(key.c_str(), saveGeometry());
#endif
QDialog::closeEvent(e);
}