Format all C++ and Java code via clang-format

Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
Konstantin Pastbin
2025-08-17 14:32:37 +07:00
parent 9f0290c0ec
commit bfffa1fff4
2169 changed files with 56441 additions and 64188 deletions

View File

@@ -3,63 +3,61 @@
#include "base/assert.hpp"
#include <QtGui/QIcon>
#include <QtWidgets/QTextBrowser>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QVBoxLayout>
#include <QtWidgets/QLabel>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QTextBrowser>
#include <QtWidgets/QVBoxLayout>
namespace qt
{
InfoDialog::InfoDialog(QString const & title, QString const & text, QWidget * parent,
QStringList const & buttons)
InfoDialog::InfoDialog(QString const & title, QString const & text, QWidget * parent, QStringList const & buttons)
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
{
QIcon icon(":/ui/logo.png");
setWindowIcon(icon);
setWindowTitle(title);
setFocusPolicy(Qt::StrongFocus);
setWindowModality(Qt::WindowModal);
QVBoxLayout * vBox = new QVBoxLayout();
QTextBrowser * browser = new QTextBrowser();
browser->setReadOnly(true);
browser->setOpenLinks(true);
browser->setOpenExternalLinks(true);
browser->setText(text);
vBox->addWidget(browser);
// this horizontal layout is for buttons
QHBoxLayout * hBox = new QHBoxLayout();
hBox->addSpacing(static_cast<int>(browser->width() / 4 * (3.5 - buttons.size())));
for (int i = 0; i < buttons.size(); ++i)
{
QIcon icon(":/ui/logo.png");
setWindowIcon(icon);
setWindowTitle(title);
setFocusPolicy(Qt::StrongFocus);
setWindowModality(Qt::WindowModal);
QVBoxLayout * vBox = new QVBoxLayout();
QTextBrowser * browser = new QTextBrowser();
browser->setReadOnly(true);
browser->setOpenLinks(true);
browser->setOpenExternalLinks(true);
browser->setText(text);
vBox->addWidget(browser);
// this horizontal layout is for buttons
QHBoxLayout * hBox = new QHBoxLayout();
hBox->addSpacing(static_cast<int>(browser->width() / 4 * (3.5 - buttons.size())));
for (int i = 0; i < buttons.size(); ++i)
QPushButton * button = new QPushButton(buttons[i], this);
switch (i)
{
QPushButton * button = new QPushButton(buttons[i], this);
switch (i)
{
case 0: connect(button, &QAbstractButton::clicked, this, &InfoDialog::OnButtonClick1); break;
case 1: connect(button, &QAbstractButton::clicked, this, &InfoDialog::OnButtonClick2); break;
case 2: connect(button, &QAbstractButton::clicked, this, &InfoDialog::OnButtonClick3); break;
default:
ASSERT(false, ("Only 3 buttons are currently supported in info dialog"));
}
hBox->addWidget(button);
case 0: connect(button, &QAbstractButton::clicked, this, &InfoDialog::OnButtonClick1); break;
case 1: connect(button, &QAbstractButton::clicked, this, &InfoDialog::OnButtonClick2); break;
case 2: connect(button, &QAbstractButton::clicked, this, &InfoDialog::OnButtonClick3); break;
default: ASSERT(false, ("Only 3 buttons are currently supported in info dialog"));
}
vBox->addLayout(hBox);
setLayout(vBox);
hBox->addWidget(button);
}
void InfoDialog::OnButtonClick1()
{
done(1);
}
void InfoDialog::OnButtonClick2()
{
done(2);
}
void InfoDialog::OnButtonClick3()
{
done(3);
}
vBox->addLayout(hBox);
setLayout(vBox);
}
void InfoDialog::OnButtonClick1()
{
done(1);
}
void InfoDialog::OnButtonClick2()
{
done(2);
}
void InfoDialog::OnButtonClick3()
{
done(3);
}
} // namespace qt