Format code using clang-format

This commit is contained in:
Luis Ángel San Martín
2019-05-30 19:46:37 +02:00
parent e0eb94e3ae
commit e3ec56aa43
356 changed files with 19824 additions and 21874 deletions

View File

@ -4,73 +4,71 @@
#include <QVBoxLayout>
#include <QFileDialog>
RenameLibraryDialog::RenameLibraryDialog(QWidget * parent)
:QDialog(parent)
RenameLibraryDialog::RenameLibraryDialog(QWidget *parent)
: QDialog(parent)
{
setupUI();
setupUI();
}
void RenameLibraryDialog::setupUI()
{
newNameLabel = new QLabel(tr("New Library Name : "));
newNameEdit = new QLineEdit;
newNameLabel->setBuddy(newNameEdit);
connect(newNameEdit,SIGNAL(textChanged(QString)),this,SLOT(nameSetted(QString)));
newNameLabel = new QLabel(tr("New Library Name : "));
newNameEdit = new QLineEdit;
newNameLabel->setBuddy(newNameEdit);
connect(newNameEdit, SIGNAL(textChanged(QString)), this, SLOT(nameSetted(QString)));
accept = new QPushButton(tr("Rename"));
accept->setDisabled(true);
connect(accept,SIGNAL(clicked()),this,SLOT(rename()));
accept = new QPushButton(tr("Rename"));
accept->setDisabled(true);
connect(accept, SIGNAL(clicked()), this, SLOT(rename()));
cancel = new QPushButton(tr("Cancel"));
connect(cancel,SIGNAL(clicked()),this,SLOT(close()));
cancel = new QPushButton(tr("Cancel"));
connect(cancel, SIGNAL(clicked()), this, SLOT(close()));
QHBoxLayout *nameLayout = new QHBoxLayout;
QHBoxLayout *nameLayout = new QHBoxLayout;
nameLayout->addWidget(newNameLabel);
nameLayout->addWidget(newNameEdit);
nameLayout->addWidget(newNameLabel);
nameLayout->addWidget(newNameEdit);
QHBoxLayout *bottomLayout = new QHBoxLayout;
bottomLayout->addStretch();
bottomLayout->addWidget(accept);
bottomLayout->addWidget(cancel);
QHBoxLayout *bottomLayout = new QHBoxLayout;
bottomLayout->addStretch();
bottomLayout->addWidget(accept);
bottomLayout->addWidget(cancel);
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(nameLayout);
mainLayout->addStretch();
mainLayout->addLayout(bottomLayout);
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(nameLayout);
mainLayout->addStretch();
mainLayout->addLayout(bottomLayout);
QHBoxLayout * imgMainLayout = new QHBoxLayout;
QLabel * imgLabel = new QLabel(this);
QPixmap p(":/images/edit.png");
imgLabel->setPixmap(p);
imgMainLayout->addWidget(imgLabel);
imgMainLayout->addLayout(mainLayout);
setLayout(imgMainLayout);
QHBoxLayout *imgMainLayout = new QHBoxLayout;
QLabel *imgLabel = new QLabel(this);
QPixmap p(":/images/edit.png");
imgLabel->setPixmap(p);
imgMainLayout->addWidget(imgLabel);
imgMainLayout->addLayout(mainLayout);
setModal(true);
setWindowTitle(tr("Rename current library"));
setLayout(imgMainLayout);
setModal(true);
setWindowTitle(tr("Rename current library"));
}
void RenameLibraryDialog::rename()
{
//accept->setEnabled(false);
emit(renameLibrary(newNameEdit->text()));
//accept->setEnabled(false);
emit(renameLibrary(newNameEdit->text()));
}
void RenameLibraryDialog::nameSetted(const QString & text)
void RenameLibraryDialog::nameSetted(const QString &text)
{
if(!text.isEmpty())
accept->setEnabled(true);
else
accept->setEnabled(false);
if (!text.isEmpty())
accept->setEnabled(true);
else
accept->setEnabled(false);
}
void RenameLibraryDialog::close()
{
newNameEdit->clear();
//accept->setEnabled(false);
QDialog::close();
newNameEdit->clear();
//accept->setEnabled(false);
QDialog::close();
}