Apply clang-format to Lts/Common and DTC/enum headers
- Formatted all CodeGen module files (9 files) - Formatted LtsAppDescriptor module files - Formatted LtsAppManager/AppChooser files - Applied clang-format to all DTC and enum headers across modules - Removed coordTransTests from CommonUnitTestsPlaceholder (moved to tests/) Cosmetic changes only, no functional modifications. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
848 files changed
+89305
-100020
No files matched your search
Executable → Regular
+125
-161
@@ -1,12 +1,12 @@
|
||||
#include "lts_screen_wide.h"
|
||||
|
||||
#include "lts_dummy_widget.h"
|
||||
#include "lts_screen_container.h"
|
||||
|
||||
#include <LtsWidgets/lts_base_layout_widget.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QSplitter>
|
||||
#include <QHBoxLayout>
|
||||
#include <QSplitter>
|
||||
#include <QTimer>
|
||||
#ifdef Q_OS_WIN
|
||||
#include <QtPlatformHeaders/qwindowswindowfunctions.h>
|
||||
@@ -15,221 +15,185 @@
|
||||
namespace LtsMultiMonitor
|
||||
{
|
||||
|
||||
LtsScreenWide::LtsScreenWide(const QRect &screenGeo, int screenId, bool debugMargins, const QString &serial)
|
||||
: LtsScreenBase(screenGeo, screenId, debugMargins, serial)
|
||||
, m_childContainerMain(new LtsScreenContainer(screenGeo))
|
||||
, m_childContainerLeft(new LtsScreenContainer(screenGeo))
|
||||
, m_childContainerRight(new LtsScreenContainer(screenGeo))
|
||||
LtsScreenWide::LtsScreenWide(const QRect& screenGeo, int screenId, bool debugMargins, const QString& serial)
|
||||
: LtsScreenBase(screenGeo, screenId, debugMargins, serial), m_childContainerMain(new LtsScreenContainer(screenGeo)),
|
||||
m_childContainerLeft(new LtsScreenContainer(screenGeo)), m_childContainerRight(new LtsScreenContainer(screenGeo))
|
||||
{
|
||||
|
||||
connect(m_childContainerMain, &LtsScreenContainer::check,
|
||||
this, &LtsScreenWide::check);
|
||||
connect(m_childContainerLeft, &LtsScreenContainer::check,
|
||||
this, &LtsScreenWide::check);
|
||||
connect(m_childContainerRight, &LtsScreenContainer::check,
|
||||
this, &LtsScreenWide::check);
|
||||
|
||||
auto *theLayout = new QHBoxLayout;
|
||||
connect(m_childContainerMain, &LtsScreenContainer::check, this, &LtsScreenWide::check);
|
||||
connect(m_childContainerLeft, &LtsScreenContainer::check, this, &LtsScreenWide::check);
|
||||
connect(m_childContainerRight, &LtsScreenContainer::check, this, &LtsScreenWide::check);
|
||||
|
||||
theLayout->setContentsMargins(0, 0, 0, 0);
|
||||
theLayout->setSpacing(0);
|
||||
theLayout->setStretch(0, 9999);
|
||||
auto* theLayout = new QHBoxLayout;
|
||||
|
||||
m_splitter = new QSplitter;
|
||||
m_splitter->setContentsMargins(0, 0, 0, 0);
|
||||
theLayout->setContentsMargins(0, 0, 0, 0);
|
||||
theLayout->setSpacing(0);
|
||||
theLayout->setStretch(0, 9999);
|
||||
|
||||
m_splitter->addWidget(m_childContainerLeft);
|
||||
m_splitter->addWidget(m_childContainerRight);
|
||||
m_splitter = new QSplitter;
|
||||
m_splitter->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
theLayout->addWidget(m_splitter);
|
||||
theLayout->addWidget(m_childContainerMain);
|
||||
m_splitter->addWidget(m_childContainerLeft);
|
||||
m_splitter->addWidget(m_childContainerRight);
|
||||
|
||||
m_screenDialog->setLayout(theLayout);
|
||||
theLayout->addWidget(m_splitter);
|
||||
theLayout->addWidget(m_childContainerMain);
|
||||
|
||||
m_splitter->hide();
|
||||
m_screenDialog->setLayout(theLayout);
|
||||
|
||||
m_splitter->hide();
|
||||
}
|
||||
|
||||
|
||||
void LtsScreenWide::putWidgetUnmanagedMain(QWidget *widget)
|
||||
void LtsScreenWide::putWidgetUnmanagedMain(QWidget* widget)
|
||||
{
|
||||
|
||||
m_childContainerMain->setWidget(widget);
|
||||
|
||||
m_childContainerMain->setWidget(widget);
|
||||
}
|
||||
|
||||
|
||||
void LtsScreenWide::putWidgetUnmanagedRight(QWidget *widget)
|
||||
void LtsScreenWide::putWidgetUnmanagedRight(QWidget* widget)
|
||||
{
|
||||
|
||||
m_childContainerRight->setWidget(widget);
|
||||
|
||||
m_childContainerRight->setWidget(widget);
|
||||
}
|
||||
|
||||
|
||||
void LtsScreenWide::putWidgetUnmanagedLeft(QWidget *widget)
|
||||
void LtsScreenWide::putWidgetUnmanagedLeft(QWidget* widget)
|
||||
{
|
||||
|
||||
m_childContainerLeft->setWidget(widget);
|
||||
|
||||
m_childContainerLeft->setWidget(widget);
|
||||
}
|
||||
|
||||
|
||||
bool LtsScreenWide::hasWidget(QWidget *widget) const
|
||||
bool LtsScreenWide::hasWidget(QWidget* widget) const
|
||||
{
|
||||
return (m_childContainerMain->hasWidget(widget) ||
|
||||
m_childContainerLeft->hasWidget(widget) ||
|
||||
m_childContainerRight->hasWidget(widget));
|
||||
return (m_childContainerMain->hasWidget(widget) || m_childContainerLeft->hasWidget(widget) ||
|
||||
m_childContainerRight->hasWidget(widget));
|
||||
}
|
||||
|
||||
|
||||
bool LtsScreenWide::isIrreplaceable() const
|
||||
{
|
||||
return (childLeft()->isIrreplaceable() && childRight()->isIrreplaceable() && childMain()->isIrreplaceable());
|
||||
return (childLeft()->isIrreplaceable() && childRight()->isIrreplaceable() && childMain()->isIrreplaceable());
|
||||
}
|
||||
|
||||
|
||||
bool LtsScreenWide::isEmpty() const
|
||||
{
|
||||
return (m_childContainerLeft->isEmpty() && m_childContainerRight->isEmpty() && m_childContainerMain->isEmpty());
|
||||
return (m_childContainerLeft->isEmpty() && m_childContainerRight->isEmpty() && m_childContainerMain->isEmpty());
|
||||
}
|
||||
|
||||
|
||||
int LtsScreenWide::containerIdOfWidget(QWidget *widget) const noexcept(false)
|
||||
int LtsScreenWide::containerIdOfWidget(QWidget* widget) const noexcept(false)
|
||||
{
|
||||
if (m_childContainerMain->hasWidget(widget))
|
||||
return 0;
|
||||
if (m_childContainerLeft->hasWidget(widget))
|
||||
return 1;
|
||||
if (m_childContainerRight->hasWidget(widget))
|
||||
return 2;
|
||||
throw "widget not on this screen";
|
||||
if (m_childContainerMain->hasWidget(widget))
|
||||
return 0;
|
||||
if (m_childContainerLeft->hasWidget(widget))
|
||||
return 1;
|
||||
if (m_childContainerRight->hasWidget(widget))
|
||||
return 2;
|
||||
throw "widget not on this screen";
|
||||
}
|
||||
|
||||
|
||||
LtsScreenContainer *LtsScreenWide::containerOfWidget(QWidget *widget) noexcept(false)
|
||||
LtsScreenContainer* LtsScreenWide::containerOfWidget(QWidget* widget) noexcept(false)
|
||||
{
|
||||
if (m_childContainerMain->hasWidget(widget))
|
||||
return m_childContainerMain;
|
||||
if (m_childContainerLeft->hasWidget(widget))
|
||||
return m_childContainerLeft;
|
||||
if (m_childContainerRight->hasWidget(widget))
|
||||
return m_childContainerRight;
|
||||
throw "widget is not present on this container";
|
||||
if (m_childContainerMain->hasWidget(widget))
|
||||
return m_childContainerMain;
|
||||
if (m_childContainerLeft->hasWidget(widget))
|
||||
return m_childContainerLeft;
|
||||
if (m_childContainerRight->hasWidget(widget))
|
||||
return m_childContainerRight;
|
||||
throw "widget is not present on this container";
|
||||
}
|
||||
|
||||
|
||||
LtsScreenContainer *LtsScreenWide::putWidget(QWidget *widget, int screenPart) noexcept(false)
|
||||
LtsScreenContainer* LtsScreenWide::putWidget(QWidget* widget, int screenPart) noexcept(false)
|
||||
{
|
||||
if (screenPart == -1)
|
||||
{
|
||||
if (!isEmpty())
|
||||
throw "cannot put widget as at least one container is occupied and screen part was not specified";
|
||||
|
||||
putWidgetUnmanagedMain(widget);
|
||||
return m_childContainerMain;
|
||||
}
|
||||
|
||||
switch (screenPart)
|
||||
{
|
||||
case 0:
|
||||
if (screenPart == -1)
|
||||
{
|
||||
if (!m_childContainerMain->isEmpty())
|
||||
throw "cannot put widget as main container is already occupied";
|
||||
if (!isEmpty())
|
||||
throw "cannot put widget as at least one container is occupied and screen part was not specified";
|
||||
|
||||
putWidgetUnmanagedMain(widget);
|
||||
return m_childContainerMain;
|
||||
putWidgetUnmanagedMain(widget);
|
||||
return m_childContainerMain;
|
||||
}
|
||||
|
||||
case 1:
|
||||
switch (screenPart)
|
||||
{
|
||||
if (!m_childContainerLeft->isEmpty())
|
||||
throw "cannot put widget as left container is already occupied";
|
||||
case 0: {
|
||||
if (!m_childContainerMain->isEmpty())
|
||||
throw "cannot put widget as main container is already occupied";
|
||||
|
||||
|
||||
putWidgetUnmanagedMain(widget);
|
||||
return m_childContainerMain;
|
||||
}
|
||||
|
||||
if (!m_childContainerMain->isEmpty())
|
||||
putWidgetUnmanagedRight(m_childContainerMain->stealWidget());
|
||||
case 1: {
|
||||
if (!m_childContainerLeft->isEmpty())
|
||||
throw "cannot put widget as left container is already occupied";
|
||||
|
||||
putWidgetUnmanagedLeft(widget);
|
||||
return m_childContainerLeft;
|
||||
if (!m_childContainerMain->isEmpty())
|
||||
putWidgetUnmanagedRight(m_childContainerMain->stealWidget());
|
||||
|
||||
putWidgetUnmanagedLeft(widget);
|
||||
return m_childContainerLeft;
|
||||
}
|
||||
|
||||
case 2: {
|
||||
if (!m_childContainerRight->isEmpty())
|
||||
throw "cannot put widget as right container is already occupied";
|
||||
|
||||
if (!m_childContainerMain->isEmpty())
|
||||
putWidgetUnmanagedLeft(m_childContainerMain->stealWidget());
|
||||
|
||||
putWidgetUnmanagedRight(widget);
|
||||
return m_childContainerRight;
|
||||
}
|
||||
|
||||
default: {
|
||||
throw "unknown screen part id";
|
||||
}
|
||||
}
|
||||
|
||||
case 2:
|
||||
{
|
||||
if (!m_childContainerRight->isEmpty())
|
||||
throw "cannot put widget as right container is already occupied";
|
||||
|
||||
|
||||
|
||||
if (!m_childContainerMain->isEmpty())
|
||||
putWidgetUnmanagedLeft(m_childContainerMain->stealWidget());
|
||||
|
||||
putWidgetUnmanagedRight(widget);
|
||||
return m_childContainerRight;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
throw "unknown screen part id";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LtsScreenWide::check()
|
||||
{
|
||||
|
||||
|
||||
Q_ASSERT(
|
||||
(!m_childContainerMain->isEmpty() && m_childContainerLeft->isEmpty() && m_childContainerRight->isEmpty()) ||
|
||||
m_childContainerMain->isEmpty());
|
||||
|
||||
|
||||
|
||||
Q_ASSERT( (!m_childContainerMain->isEmpty() && m_childContainerLeft->isEmpty() && m_childContainerRight->isEmpty()) || m_childContainerMain->isEmpty() );
|
||||
|
||||
|
||||
|
||||
if (m_childContainerMain->isEmpty())
|
||||
{
|
||||
if (m_childContainerLeft->isEmpty() && !m_childContainerRight->isEmpty())
|
||||
if (m_childContainerMain->isEmpty())
|
||||
{
|
||||
try
|
||||
{
|
||||
QWidget *widget = m_childContainerRight->stealWidget();
|
||||
m_childContainerMain->setWidget(widget);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
if (m_childContainerLeft->isEmpty() && !m_childContainerRight->isEmpty())
|
||||
{
|
||||
try
|
||||
{
|
||||
QWidget* widget = m_childContainerRight->stealWidget();
|
||||
m_childContainerMain->setWidget(widget);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
}
|
||||
else if (!m_childContainerLeft->isEmpty() && m_childContainerRight->isEmpty())
|
||||
{
|
||||
try
|
||||
{
|
||||
QWidget* widget = m_childContainerLeft->stealWidget();
|
||||
m_childContainerMain->setWidget(widget);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!m_childContainerLeft->isEmpty() && m_childContainerRight->isEmpty())
|
||||
|
||||
if (!m_childContainerMain->isEmpty())
|
||||
{
|
||||
try
|
||||
{
|
||||
QWidget *widget = m_childContainerLeft->stealWidget();
|
||||
m_childContainerMain->setWidget(widget);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
m_childContainerMain->show();
|
||||
m_splitter->hide();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!m_childContainerMain->isEmpty())
|
||||
{
|
||||
|
||||
m_childContainerMain->show();
|
||||
m_splitter->hide();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
m_childContainerMain->hide();
|
||||
m_splitter->setVisible(!m_childContainerLeft->isEmpty() || !m_childContainerRight->isEmpty());
|
||||
m_childContainerLeft->setVisible(!m_childContainerLeft->isEmpty());
|
||||
m_childContainerRight->setVisible(!m_childContainerRight->isEmpty());
|
||||
m_childContainerMain->hide();
|
||||
m_splitter->setVisible(!m_childContainerLeft->isEmpty() || !m_childContainerRight->isEmpty());
|
||||
m_childContainerLeft->setVisible(!m_childContainerLeft->isEmpty());
|
||||
m_childContainerRight->setVisible(!m_childContainerRight->isEmpty());
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace LtsMultiMonitor
|
||||
Reference in new issue
Block a user