diff options
author | Aleksei Nikiforov <darktemplar@basealt.ru> | 2018-12-14 12:39:44 +0300 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-12-18 19:40:11 +0100 |
commit | 4aa66236d69c63b648a966de2e2d7a3f12eed8de (patch) | |
tree | 4ada3e83065d0114ab824fb2f9b8dc5f59cbcfe6 /vcl/qt5/Qt5Object.cxx | |
parent | 5658da22f77a48599bb20cf6c7c37abf0388186e (diff) |
Qt5: Fix fullscreen window size
Allow setting Qt5Object's position and size
Change-Id: I9f70b68ff402a3975e36baca4d81103603110d82
Reviewed-on: https://gerrit.libreoffice.org/65309
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Tested-by: Jenkins
Diffstat (limited to 'vcl/qt5/Qt5Object.cxx')
-rw-r--r-- | vcl/qt5/Qt5Object.cxx | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/vcl/qt5/Qt5Object.cxx b/vcl/qt5/Qt5Object.cxx index 3b68c0746d30..4f0a92da7bf7 100644 --- a/vcl/qt5/Qt5Object.cxx +++ b/vcl/qt5/Qt5Object.cxx @@ -25,10 +25,13 @@ Qt5Object::Qt5Object(Qt5Frame* pParent, bool bShow) : m_pParent(pParent) + , m_pQWidget(nullptr) { if (!m_pParent || !pParent->GetQWidget()) return; - m_pQWidget.reset(new QWidget(pParent->GetQWidget())); + + m_pQWidget = new QWidget(pParent->GetQWidget()); + if (bShow) m_pQWidget->show(); @@ -43,7 +46,7 @@ Qt5Object::Qt5Object(Qt5Frame* pParent, bool bShow) void Qt5Object::ResetClipRegion() { - if (m_pQWidget.get()) + if (m_pQWidget) m_pRegion = QRegion(m_pQWidget->geometry()); else m_pRegion = QRegion(); @@ -58,11 +61,18 @@ void Qt5Object::UnionClipRegion(long nX, long nY, long nWidth, long nHeight) void Qt5Object::EndSetClipRegion() { - if (m_pQWidget.get()) + if (m_pQWidget) m_pRegion = m_pRegion.intersected(m_pQWidget->geometry()); } -void Qt5Object::SetPosSize(long /*nX*/, long /*nY*/, long /*nWidth*/, long /*nHeight*/) {} +void Qt5Object::SetPosSize(long nX, long nY, long nWidth, long nHeight) +{ + if (m_pQWidget) + { + m_pQWidget->move(nX, nY); + m_pQWidget->setFixedSize(nWidth, nHeight); + } +} void Qt5Object::Show(bool bVisible) { |