From 760c3fdd0f2cd87509d305d7218a0300a29f4031 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 23 Mar 2019 23:37:26 +0100 Subject: [PATCH] DATV demod: not functionning full screen --- plugins/channelrx/demoddatv/datvdemodgui.cpp | 2 + plugins/channelrx/demoddatv/datvdemodgui.ui | 54 +++++-------------- .../channelrx/demoddatv/datvideorender.cpp | 23 ++++++-- plugins/channelrx/demoddatv/datvideorender.h | 4 ++ 4 files changed, 36 insertions(+), 47 deletions(-) diff --git a/plugins/channelrx/demoddatv/datvdemodgui.cpp b/plugins/channelrx/demoddatv/datvdemodgui.cpp index e0a6bf671..403c07900 100644 --- a/plugins/channelrx/demoddatv/datvdemodgui.cpp +++ b/plugins/channelrx/demoddatv/datvdemodgui.cpp @@ -164,6 +164,8 @@ DATVDemodGUI::DATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Ba connect(&m_objTimer, SIGNAL(timeout()), this, SLOT(tick())); m_objTimer.start(); + //ui->fullScreen->setVisible(false); + ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03))); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999); diff --git a/plugins/channelrx/demoddatv/datvdemodgui.ui b/plugins/channelrx/demoddatv/datvdemodgui.ui index 663bc2565..e5f22af04 100644 --- a/plugins/channelrx/demoddatv/datvdemodgui.ui +++ b/plugins/channelrx/demoddatv/datvdemodgui.ui @@ -7,7 +7,7 @@ 0 0 530 - 442 + 443 @@ -204,7 +204,7 @@ QTabWidget::West - 0 + 1 @@ -775,46 +775,6 @@ Full Screen - - - - 0 - 20 - 488 - 272 - - - - - - - - 0 - 0 - - - - - 480 - 270 - - - - - 355 - 270 - - - - Video - - - - - - - - false @@ -998,6 +958,16 @@ true + + + + 2 + 22 + 492 + 270 + + + diff --git a/plugins/channelrx/demoddatv/datvideorender.cpp b/plugins/channelrx/demoddatv/datvideorender.cpp index 4cbea4253..a117f824d 100644 --- a/plugins/channelrx/demoddatv/datvideorender.cpp +++ b/plugins/channelrx/demoddatv/datvideorender.cpp @@ -18,6 +18,8 @@ #include #include +#include + extern "C" { #include @@ -26,7 +28,7 @@ extern "C" #include "audio/audiofifo.h" #include "datvideorender.h" -DATVideoRender::DATVideoRender(QWidget *parent) : TVScreen(true, parent) +DATVideoRender::DATVideoRender(QWidget *parent) : TVScreen(true, parent), m_parentWidget(parent) { installEventFilter(this); m_isFullScreen = false; @@ -94,14 +96,25 @@ void DATVideoRender::SetFullScreen(bool fullScreen) if (fullScreen == true) { - setWindowFlags(Qt::Window); - showFullScreen(); + m_originalWindowFlags = this->windowFlags(); + m_originalSize = this->size(); + this->setParent(0); + this->setWindowFlags( Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint); + this->showMaximized(); + // setWindowFlags(Qt::Window); + // setWindowState(Qt::WindowFullScreen); + // show(); m_isFullScreen = true; } else { - setWindowFlags(Qt::Widget); - showNormal(); + this->setParent(m_parentWidget); + this->resize(m_originalSize); + this->overrideWindowFlags(m_originalWindowFlags); + this->show(); + // setWindowFlags(Qt::Widget); + // setWindowState(Qt::WindowNoState); + // show(); m_isFullScreen = false; } } diff --git a/plugins/channelrx/demoddatv/datvideorender.h b/plugins/channelrx/demoddatv/datvideorender.h index c0e415f97..6e1739112 100644 --- a/plugins/channelrx/demoddatv/datvideorender.h +++ b/plugins/channelrx/demoddatv/datvideorender.h @@ -109,6 +109,10 @@ class DATVideoRender : public TVScreen struct DataTSMetaData2 MetaData; private: + QWidget *m_parentWidget; + Qt::WindowFlags m_originalWindowFlags; + QSize m_originalSize; + bool m_running; bool m_isFullScreen;