Skip to content

Commit

Permalink
Re #4282. A correction for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mantid-roman committed Jan 17, 2012
1 parent e21f3e9 commit f6a65af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions Code/Mantid/MantidPlot/src/FloatingWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@
* Constructor.
*/
FloatingWindow::FloatingWindow(ApplicationWindow* appWindow, Qt::WindowFlags f):
#ifdef Q_OS_WIN
QMainWindow(appWindow,f),
#else
QMainWindow(NULL,f),
//QMainWindow(appWindow,f),
#endif
d_app(appWindow)
{
setFocusPolicy(Qt::StrongFocus);
connect(appWindow,SIGNAL(shutting_down()),this,SLOT(close()));
#ifdef _WIN32
#ifdef Q_OS_WIN
// remember the flags
m_flags = windowFlags();
#endif
Expand Down Expand Up @@ -74,7 +77,7 @@ bool FloatingWindow::event(QEvent * e)
{
if (this->isMinimized())
{
#ifdef _WIN32
#ifdef Q_OS_WIN
// set parent to NULL wich makes it minimize nicely into a program bar icon
this->setParent(NULL);
this->showMinimized();
Expand All @@ -84,7 +87,7 @@ bool FloatingWindow::event(QEvent * e)
}
else if ( !this->isMaximized() || !this->isMinimized() )
{
#ifdef _WIN32
#ifdef Q_OS_WIN
// re-parent to the main window making the floating window stay on top of it
if (this->parent() != d_app)
{
Expand All @@ -97,7 +100,7 @@ bool FloatingWindow::event(QEvent * e)
}
else if (this->isMaximized())
{
#ifdef _WIN32
#ifdef Q_OS_WIN
// re-parent to the main window making the floating window stay on top of it
if (this->parent() != d_app)
{
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/MantidPlot/src/FloatingWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class FloatingWindow: public QMainWindow
QWidget* widget() const;
virtual bool event(QEvent * e);
ApplicationWindow* d_app; ///< Pointer to the main window
#ifdef _WIN32
#ifdef Q_OS_WIN
Qt::WindowFlags m_flags; ///< Keeps a copy of window flags, used when re-parenting
#endif
};
Expand Down

0 comments on commit f6a65af

Please sign in to comment.