mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-21 23:09:40 +00:00
* GuiDialog: Initial Window geometry session support. Inheriting class will have to be be modified to make use of that.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20539 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
49388f6abd
commit
83b63b2c53
@ -15,6 +15,10 @@
|
||||
#include "qt_helpers.h"
|
||||
#include "frontends/LyXView.h"
|
||||
|
||||
#include <QCloseEvent>
|
||||
#include <QSettings>
|
||||
#include <QShowEvent>
|
||||
|
||||
using std::string;
|
||||
|
||||
namespace lyx {
|
||||
@ -237,6 +241,23 @@ void GuiDialog::setController(Controller * controller)
|
||||
}
|
||||
|
||||
|
||||
void GuiDialog::showEvent(QShowEvent * e)
|
||||
{
|
||||
QSettings settings;
|
||||
string key = name_ + "/geometry";
|
||||
restoreGeometry(settings.value(key.c_str()).toByteArray());
|
||||
QDialog::showEvent(e);
|
||||
}
|
||||
|
||||
|
||||
void GuiDialog::closeEvent(QCloseEvent * e)
|
||||
{
|
||||
QSettings settings;
|
||||
string key = name_ + "/geometry";
|
||||
settings.setValue(key.c_str(), saveGeometry());
|
||||
QDialog::closeEvent(e);
|
||||
}
|
||||
|
||||
} // namespace frontend
|
||||
} // namespace lyx
|
||||
|
||||
|
@ -18,6 +18,9 @@
|
||||
#include <QDialog>
|
||||
#include <QObject>
|
||||
|
||||
class QCloseEvent;
|
||||
class QShowEvent;
|
||||
|
||||
namespace lyx {
|
||||
namespace frontend {
|
||||
|
||||
@ -75,7 +78,11 @@ public:
|
||||
virtual void applyView() {}
|
||||
/// default: do nothing
|
||||
virtual void updateContents() {}
|
||||
|
||||
///
|
||||
void closeEvent(QCloseEvent *);
|
||||
///
|
||||
void showEvent(QShowEvent *);
|
||||
|
||||
protected:
|
||||
/// Hide the dialog.
|
||||
virtual void hideView();
|
||||
|
Loading…
x
Reference in New Issue
Block a user