Formats minimally release source files based on former clang-format
This commit is contained in:
387 files changed
+37323
-38074
No files matched your search
Executable → Regular
+106
-110
@@ -5,31 +5,29 @@
|
||||
#include <QtWidgets/QFrame>
|
||||
|
||||
NGLDialogButtonBox::NGLDialogButtonBox(QWidget *parent)
|
||||
: NGLDialogButtonBox(Qt::Horizontal, parent)
|
||||
{}
|
||||
: NGLDialogButtonBox(Qt::Horizontal, parent)
|
||||
{
|
||||
}
|
||||
|
||||
NGLDialogButtonBox::NGLDialogButtonBox(Qt::Orientation orientation,
|
||||
QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_orientation(orientation)
|
||||
, m_buttons(NGLStandardButton::NoButton)
|
||||
, m_line(nullptr)
|
||||
, m_bSpacer2ContextAction(nullptr)
|
||||
, m_bLineVisible(true)
|
||||
NGLDialogButtonBox::NGLDialogButtonBox(Qt::Orientation orientation, QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_orientation(orientation)
|
||||
, m_buttons(NGLStandardButton::NoButton)
|
||||
, m_line(nullptr)
|
||||
, m_bSpacer2ContextAction(nullptr)
|
||||
, m_bLineVisible(true)
|
||||
{
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
init();
|
||||
}
|
||||
|
||||
NGLDialogButtonBox::NGLDialogButtonBox(NGLStandardButton::StandardButtons buttons,
|
||||
Qt::Orientation orientation,
|
||||
QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_orientation(orientation)
|
||||
, m_buttons(buttons)
|
||||
, m_line(nullptr)
|
||||
, m_bSpacer2ContextAction(nullptr)
|
||||
, m_bLineVisible(true)
|
||||
NGLDialogButtonBox::NGLDialogButtonBox(NGLStandardButton::StandardButtons buttons, Qt::Orientation orientation, QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_orientation(orientation)
|
||||
, m_buttons(buttons)
|
||||
, m_line(nullptr)
|
||||
, m_bSpacer2ContextAction(nullptr)
|
||||
, m_bLineVisible(true)
|
||||
{
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
setStandardButtons(m_buttons);
|
||||
@@ -81,7 +79,7 @@ void NGLDialogButtonBox::setStandardButtons(NGLStandardButton::StandardButtons b
|
||||
button->setAutoDefault(true);
|
||||
}
|
||||
}
|
||||
i = (NGLStandardButton::StandardButton)((int) i << 1);
|
||||
i = (NGLStandardButton::StandardButton)((int)i << 1);
|
||||
}
|
||||
|
||||
init();
|
||||
@@ -118,7 +116,7 @@ NGLStandardButton *NGLDialogButtonBox::button(NGLStandardButton::StandardButton
|
||||
if (it.value()->type() == button)
|
||||
return it.value();
|
||||
}
|
||||
return new NGLStandardButton(nullptr);
|
||||
return new NGLStandardButton(nullptr);
|
||||
}
|
||||
|
||||
void NGLDialogButtonBox::removeFromActionList(NGLStandardButton::StandardButton button)
|
||||
@@ -192,7 +190,8 @@ static void addSpacer2(QLayout *l, Qt::Orientation orientation)
|
||||
void NGLDialogButtonBox::init()
|
||||
{
|
||||
delete layout();
|
||||
delete m_line; m_line = nullptr;
|
||||
delete m_line;
|
||||
m_line = nullptr;
|
||||
if (m_bSpacer2ContextAction)
|
||||
{
|
||||
removeAction(m_bSpacer2ContextAction);
|
||||
@@ -212,7 +211,7 @@ void NGLDialogButtonBox::init()
|
||||
lMain = new QHBoxLayout;
|
||||
l = new QVBoxLayout;
|
||||
}
|
||||
lMain->setContentsMargins(0,0,0,0);
|
||||
lMain->setContentsMargins(0, 0, 0, 0);
|
||||
if (m_bLineVisible)
|
||||
{
|
||||
m_line = new QFrame(this);
|
||||
@@ -225,7 +224,7 @@ void NGLDialogButtonBox::init()
|
||||
l->setContentsMargins(0, 0, 0, 0);
|
||||
setLayout(lMain);
|
||||
|
||||
const auto actions = findChildren<QAction*>();
|
||||
const auto actions = findChildren<QAction *>();
|
||||
for (auto a : actions)
|
||||
a->disconnect(a, &QAction::triggered, this, &NGLDialogButtonBox::buttonClicked);
|
||||
|
||||
@@ -246,7 +245,7 @@ void NGLDialogButtonBox::init()
|
||||
bSpacer1Added = true;
|
||||
if (bLowestPrioButton)
|
||||
{
|
||||
|
||||
|
||||
QSpacerItem *item = new QSpacerItem(7, 7, QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
l->addItem(item);
|
||||
}
|
||||
@@ -256,10 +255,10 @@ void NGLDialogButtonBox::init()
|
||||
bSpacer2Added = true;
|
||||
addSpacer2(l, m_orientation);
|
||||
}
|
||||
|
||||
|
||||
if (prio >= 30 && prio < 100)
|
||||
{
|
||||
|
||||
|
||||
const QList<QAction *> actions = button->actions();
|
||||
for (QAction *a : actions)
|
||||
removeAction(a);
|
||||
@@ -276,26 +275,23 @@ void NGLDialogButtonBox::init()
|
||||
}
|
||||
}
|
||||
l->addWidget(button);
|
||||
|
||||
|
||||
if (button->type() == NGLStandardButton::Library)
|
||||
{
|
||||
QAction *ex = button->findChild<QAction *>(QLatin1String("actionExport"));
|
||||
if (ex)
|
||||
{
|
||||
connect(ex, &QAction::triggered,
|
||||
this, &NGLDialogButtonBox::buttonClicked, Qt::UniqueConnection);
|
||||
connect(ex, &QAction::triggered, this, &NGLDialogButtonBox::buttonClicked, Qt::UniqueConnection);
|
||||
}
|
||||
QAction *im = button->findChild<QAction *>(QLatin1String("actionImport"));
|
||||
if (im)
|
||||
{
|
||||
connect(im, &QAction::triggered,
|
||||
this, &NGLDialogButtonBox::buttonClicked, Qt::UniqueConnection);
|
||||
connect(im, &QAction::triggered, this, &NGLDialogButtonBox::buttonClicked, Qt::UniqueConnection);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
connect(button, &NGLStandardButton::clicked,
|
||||
this, &NGLDialogButtonBox::buttonClicked, Qt::UniqueConnection);
|
||||
connect(button, &NGLStandardButton::clicked, this, &NGLDialogButtonBox::buttonClicked, Qt::UniqueConnection);
|
||||
}
|
||||
}
|
||||
if (!bSpacer2Added)
|
||||
@@ -315,10 +311,10 @@ void NGLDialogButtonBox::init()
|
||||
|
||||
void NGLDialogButtonBox::buttonClicked()
|
||||
{
|
||||
NGLStandardButton *b = qobject_cast<NGLStandardButton *> (sender());
|
||||
NGLStandardButton *b = qobject_cast<NGLStandardButton *>(sender());
|
||||
if (!b)
|
||||
{
|
||||
QAction *a = qobject_cast<QAction *> (sender());
|
||||
QAction *a = qobject_cast<QAction *>(sender());
|
||||
if (!a)
|
||||
return;
|
||||
if (a->objectName() == QLatin1String("actionExport"))
|
||||
@@ -335,80 +331,80 @@ void NGLDialogButtonBox::buttonClicked()
|
||||
}
|
||||
switch (b->type())
|
||||
{
|
||||
case NGLStandardButton::Ok:
|
||||
emit onOk();
|
||||
break;
|
||||
case NGLStandardButton::Send:
|
||||
emit onSend();
|
||||
break;
|
||||
case NGLStandardButton::New:
|
||||
emit onNew();
|
||||
break;
|
||||
case NGLStandardButton::Delete:
|
||||
emit onDelete();
|
||||
break;
|
||||
case NGLStandardButton::Save:
|
||||
emit onSave();
|
||||
break;
|
||||
case NGLStandardButton::Open:
|
||||
emit onOpen();
|
||||
break;
|
||||
case NGLStandardButton::Yes:
|
||||
emit onYes();
|
||||
break;
|
||||
case NGLStandardButton::No:
|
||||
emit onNo();
|
||||
break;
|
||||
case NGLStandardButton::Close:
|
||||
emit onClose();
|
||||
break;
|
||||
case NGLStandardButton::Cancel:
|
||||
emit onCancel();
|
||||
break;
|
||||
case NGLStandardButton::Help:
|
||||
emit onHelp();
|
||||
break;
|
||||
case NGLStandardButton::Apply:
|
||||
emit onApply();
|
||||
break;
|
||||
case NGLStandardButton::Reset:
|
||||
emit onReset();
|
||||
break;
|
||||
case NGLStandardButton::Print:
|
||||
emit onPrint();
|
||||
break;
|
||||
case NGLStandardButton::Modify:
|
||||
emit onModify();
|
||||
break;
|
||||
case NGLStandardButton::Add:
|
||||
emit onAdd();
|
||||
break;
|
||||
case NGLStandardButton::Remove:
|
||||
emit onRemove();
|
||||
break;
|
||||
case NGLStandardButton::Edit:
|
||||
emit onEdit();
|
||||
break;
|
||||
case NGLStandardButton::Download:
|
||||
emit onDownload();
|
||||
break;
|
||||
case NGLStandardButton::Library:
|
||||
break;
|
||||
case NGLStandardButton::Show:
|
||||
emit onShow();
|
||||
break;
|
||||
case NGLStandardButton::ZoomIn:
|
||||
emit onZoomIn();
|
||||
break;
|
||||
case NGLStandardButton::ZoomOut:
|
||||
emit onZoomOut();
|
||||
break;
|
||||
case NGLStandardButton::Hide:
|
||||
emit onHide();
|
||||
break;
|
||||
default:
|
||||
emit clicked(b);
|
||||
break;
|
||||
case NGLStandardButton::Ok:
|
||||
emit onOk();
|
||||
break;
|
||||
case NGLStandardButton::Send:
|
||||
emit onSend();
|
||||
break;
|
||||
case NGLStandardButton::New:
|
||||
emit onNew();
|
||||
break;
|
||||
case NGLStandardButton::Delete:
|
||||
emit onDelete();
|
||||
break;
|
||||
case NGLStandardButton::Save:
|
||||
emit onSave();
|
||||
break;
|
||||
case NGLStandardButton::Open:
|
||||
emit onOpen();
|
||||
break;
|
||||
case NGLStandardButton::Yes:
|
||||
emit onYes();
|
||||
break;
|
||||
case NGLStandardButton::No:
|
||||
emit onNo();
|
||||
break;
|
||||
case NGLStandardButton::Close:
|
||||
emit onClose();
|
||||
break;
|
||||
case NGLStandardButton::Cancel:
|
||||
emit onCancel();
|
||||
break;
|
||||
case NGLStandardButton::Help:
|
||||
emit onHelp();
|
||||
break;
|
||||
case NGLStandardButton::Apply:
|
||||
emit onApply();
|
||||
break;
|
||||
case NGLStandardButton::Reset:
|
||||
emit onReset();
|
||||
break;
|
||||
case NGLStandardButton::Print:
|
||||
emit onPrint();
|
||||
break;
|
||||
case NGLStandardButton::Modify:
|
||||
emit onModify();
|
||||
break;
|
||||
case NGLStandardButton::Add:
|
||||
emit onAdd();
|
||||
break;
|
||||
case NGLStandardButton::Remove:
|
||||
emit onRemove();
|
||||
break;
|
||||
case NGLStandardButton::Edit:
|
||||
emit onEdit();
|
||||
break;
|
||||
case NGLStandardButton::Download:
|
||||
emit onDownload();
|
||||
break;
|
||||
case NGLStandardButton::Library:
|
||||
break;
|
||||
case NGLStandardButton::Show:
|
||||
emit onShow();
|
||||
break;
|
||||
case NGLStandardButton::ZoomIn:
|
||||
emit onZoomIn();
|
||||
break;
|
||||
case NGLStandardButton::ZoomOut:
|
||||
emit onZoomOut();
|
||||
break;
|
||||
case NGLStandardButton::Hide:
|
||||
emit onHide();
|
||||
break;
|
||||
default:
|
||||
emit clicked(b);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user