1 | /* $Id: QIMainWindow.cpp 70603 2018-01-16 17:56:07Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - QIMainWindow class implementation.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2016-2017 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifdef VBOX_WITH_PRECOMPILED_HEADERS
|
---|
19 | # include <precomp.h>
|
---|
20 | #else /* !VBOX_WITH_PRECOMPILED_HEADERS */
|
---|
21 |
|
---|
22 | /* GUI includes: */
|
---|
23 | # include "QIMainWindow.h"
|
---|
24 | # include "VBoxGlobal.h"
|
---|
25 | # include "UIDesktopWidgetWatchdog.h"
|
---|
26 |
|
---|
27 | #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
|
---|
28 |
|
---|
29 |
|
---|
30 | QIMainWindow::QIMainWindow(QWidget *pParent /* = 0 */, Qt::WindowFlags enmFlags /* = 0 */)
|
---|
31 | : QMainWindow(pParent, enmFlags)
|
---|
32 | {
|
---|
33 | }
|
---|
34 |
|
---|
35 | void QIMainWindow::restoreGeometry()
|
---|
36 | {
|
---|
37 | #if defined(VBOX_WS_MAC) || defined(VBOX_WS_WIN)
|
---|
38 | /* Use the old approach for OSX/Win: */
|
---|
39 | move(m_geometry.topLeft());
|
---|
40 | resize(m_geometry.size());
|
---|
41 | #else /* !VBOX_WS_MAC && !VBOX_WS_WIN */
|
---|
42 | /* Use the new approach for X11: */
|
---|
43 | VBoxGlobal::setTopLevelGeometry(this, m_geometry);
|
---|
44 | #endif /* !VBOX_WS_MAC && !VBOX_WS_WIN */
|
---|
45 |
|
---|
46 | /* Maximize (if necessary): */
|
---|
47 | if (shouldBeMaximized())
|
---|
48 | showMaximized();
|
---|
49 | }
|
---|
50 |
|
---|