calc: on editing invalidation of view with different zoom is wrong
[LibreOffice.git] / vcl / qt5 / QtMainWindow.cxx
blob5ff9ac9a81160ad758dcec90fc62f8d4d64c05ba
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 */
11 #include <QtMainWindow.hxx>
12 #include <QtMainWindow.moc>
13 #include <QtAccessibleWidget.hxx>
15 #include <QtGui/QAccessible>
16 #include <QtGui/QCloseEvent>
18 QtMainWindow::QtMainWindow(QtFrame& rFrame, Qt::WindowFlags f)
19 : QMainWindow(nullptr, f)
20 , m_rFrame(rFrame)
22 #ifndef EMSCRIPTEN
23 QAccessible::installFactory(QtAccessibleWidget::customFactory);
24 #endif
27 void QtMainWindow::closeEvent(QCloseEvent* pEvent)
29 bool bRet = false;
30 bRet = m_rFrame.CallCallback(SalEvent::Close, nullptr);
32 if (bRet)
33 pEvent->accept();
34 // SalEvent::Close returning false may mean that user has vetoed
35 // closing the frame ("you have unsaved changes" dialog for example)
36 // We shouldn't process the event in such case
37 else
38 pEvent->ignore();
41 void QtMainWindow::moveEvent(QMoveEvent* pEvent)
43 const qreal fRatio = m_rFrame.devicePixelRatioF();
44 m_rFrame.maGeometry.setPos(toPoint(pEvent->pos() * fRatio));
45 m_rFrame.CallCallback(SalEvent::Move, nullptr);