Showing the changes to interface/src/MainWindow.cpp (1 of 8 files). Show all
Unified · Split
| @@ -4,6 +4,10 @@ · 3 unmodified lines | ||
| 4 | 4 | // |
| 5 | 5 | // Created by Mohammed Nafees on 04/06/2014. |
| 6 | 6 | // Copyright (c) 2014 High Fidelity, Inc. All rights reserved. |
| 7 | +// | |
| 8 | +// Distributed under the Apache License, Version 2.0. | |
| 9 | +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html | |
| 10 | +// | |
| 7 | 11 | |
| 8 | 12 | #include "MainWindow.h" |
| 9 | 13 | |
| @@ -14,56 +18,50 @@ · 4 unmodified lines | ||
| 14 | 18 | #include <QHideEvent> |
| 15 | 19 | #include <QWindowStateChangeEvent> |
| 16 | 20 | |
| 17 | −MainWindow::MainWindow(QWidget *parent) : | |
| 18 | − QMainWindow(parent) | |
| 19 | −{ | |
| 21 | +MainWindow::MainWindow(QWidget* parent) : | |
| 22 | + QMainWindow(parent) { | |
| 20 | 23 | } |
| 21 | 24 | |
| 22 | −void MainWindow::moveEvent(QMoveEvent *e) | |
| 23 | −{ | |
| 24 | − emit windowGeometryChanged(QRect(e->pos(), size())); | |
| 25 | − QMainWindow::moveEvent(e); | |
| 25 | +void MainWindow::moveEvent(QMoveEvent* event) { | |
| 26 | + emit windowGeometryChanged(QRect(event->pos(), size())); | |
| 27 | + QMainWindow::moveEvent(event); | |
| 26 | 28 | } |
| 27 | 29 | |
| 28 | −void MainWindow::resizeEvent(QResizeEvent *e) | |
| 29 | −{ | |
| 30 | − emit windowGeometryChanged(QRect(QPoint(x(), y()), e->size())); | |
| 31 | − QMainWindow::resizeEvent(e); | |
| 30 | +void MainWindow::resizeEvent(QResizeEvent* event) { | |
| 31 | + emit windowGeometryChanged(QRect(QPoint(x(), y()), event->size())); | |
| 32 | + QMainWindow::resizeEvent(event); | |
| 32 | 33 | } |
| 33 | 34 | |
| 34 | −void MainWindow::showEvent(QShowEvent *e) | |
| 35 | −{ | |
| 36 | − if (e->spontaneous()) { | |
| 35 | +void MainWindow::showEvent(QShowEvent* event) { | |
| 36 | + if (event->spontaneous()) { | |
| 37 | 37 | emit windowShown(true); |
| 38 | 38 | } |
| 39 | − QMainWindow::showEvent(e); | |
| 39 | + QMainWindow::showEvent(event); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | −void MainWindow::hideEvent(QHideEvent *e) | |
| 43 | −{ | |
| 44 | − if (e->spontaneous()) { | |
| 42 | +void MainWindow::hideEvent(QHideEvent* event) { | |
| 43 | + if (event->spontaneous()) { | |
| 45 | 44 | emit windowShown(false); |
| 46 | 45 | } |
| 47 | − QMainWindow::hideEvent(e); | |
| 46 | + QMainWindow::hideEvent(event); | |
| 48 | 47 | } |
| 49 | 48 | |
| 50 | −void MainWindow::changeEvent(QEvent *e) | |
| 51 | −{ | |
| 52 | − if (e->type() == QEvent::WindowStateChange) { | |
| 53 | − QWindowStateChangeEvent *event = static_cast<QWindowStateChangeEvent*>(e); | |
| 54 | − if ((event->oldState() == Qt::WindowNoState || | |
| 55 | − event->oldState() == Qt::WindowMaximized) && | |
| 49 | +void MainWindow::changeEvent(QEvent* event) { | |
| 50 | + if (event->type() == QEvent::WindowStateChange) { | |
| 51 | + QWindowStateChangeEvent* stateChangeEvent = static_cast<QWindowStateChangeEvent*>(event); | |
| 52 | + if ((stateChangeEvent->oldState() == Qt::WindowNoState || | |
| 53 | + stateChangeEvent->oldState() == Qt::WindowMaximized) && | |
| 56 | 54 | windowState() == Qt::WindowMinimized) { |
| 57 | 55 | emit windowShown(false); |
| 58 | 56 | } else { |
| 59 | 57 | emit windowShown(true); |
| 60 | 58 | } |
| 61 | − } else if (e->type() == QEvent::ActivationChange) { | |
| 59 | + } else if (event->type() == QEvent::ActivationChange) { | |
| 62 | 60 | if (isActiveWindow()) { |
| 63 | 61 | emit windowShown(true); |
| 64 | 62 | } else { |
| 65 | 63 | emit windowShown(false); |
| 66 | 64 | } |
| 67 | 65 | } |
| 68 | − QMainWindow::changeEvent(e); | |
| 66 | + QMainWindow::changeEvent(event); | |
| 69 | 67 | } |