style: Apply clang-format to all C++ files
qt-migration-copilot-demo/pipeline/pr-main There was a failure building this commit
qt-migration-copilot-demo/pipeline/pr-main There was a failure building this commit
- Format MainWindow.cpp, MainWindow.h, main.cpp - Format test files (test_main.cpp, test_mainwindow.cpp) - Fixes Jenkins clang-format policy check Entire-Checkpoint: ea47c089bf3a
This commit is contained in:
4 files changed
+20
-12
No files matched your search
@@ -1,16 +1,15 @@
|
||||
#include "MainWindow.h"
|
||||
|
||||
#include "ui_MainWindow.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QScreen>
|
||||
#include <QPixmap>
|
||||
#include <QString>
|
||||
#include <QRect>
|
||||
#include <QScreen>
|
||||
#include <QString>
|
||||
|
||||
MainWindow::MainWindow(QWidget* parent)
|
||||
: QMainWindow(parent)
|
||||
, ui(new Ui::MainWindow)
|
||||
, m_pattern(QRegularExpression(R"(^[A-Za-z]+\d+$)"))
|
||||
: QMainWindow(parent), ui(new Ui::MainWindow), m_pattern(QRegularExpression(R"(^[A-Za-z]+\d+$)"))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
@@ -36,7 +35,8 @@ bool MainWindow::validateInput(const QString &text) const
|
||||
QString MainWindow::getScreenInfo() const
|
||||
{
|
||||
const QScreen* screen = QApplication::primaryScreen();
|
||||
if (!screen) {
|
||||
if (!screen)
|
||||
{
|
||||
return u"Screen: unavailable"_s;
|
||||
}
|
||||
const QRect geometry = screen->geometry();
|
||||
@@ -47,9 +47,12 @@ void MainWindow::onValidateClicked()
|
||||
{
|
||||
const QString text = ui->lineEdit->text();
|
||||
|
||||
if (validateInput(text)) {
|
||||
if (validateInput(text))
|
||||
{
|
||||
ui->resultLabel->setText(u"Match"_s);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->resultLabel->setText(u"No match"_s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,12 @@
|
||||
#include <QRegularExpression>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui {
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <QApplication>
|
||||
#include "MainWindow.h"
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#include <QtTest/QtTest>
|
||||
#include <QApplication>
|
||||
#include "MainWindow.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QtTest/QtTest>
|
||||
|
||||
class TestMainWindowWidget : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Reference in new issue
Block a user