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

@ -2,18 +2,18 @@
#include <QtWidgets>
PageLabelWidget::PageLabelWidget(QWidget * parent)
:QWidget(parent)
PageLabelWidget::PageLabelWidget(QWidget *parent)
: QWidget(parent)
{
animation = new QPropertyAnimation(this,"pos");
animation = new QPropertyAnimation(this, "pos");
animation->setDuration(150);
animation->setEndValue(QPoint((parent->geometry().size().width()-this->width()),-this->height()));
animation->setEndValue(QPoint((parent->geometry().size().width() - this->width()), -this->height()));
int verticalRes = QApplication::desktop()->screenGeometry().height();
QHBoxLayout *layout = new QHBoxLayout;
layout->setMargin(0);
setContentsMargins(0,0,0,0);
setContentsMargins(0, 0, 0, 0);
QSize labelSize;
if (verticalRes <= 1024)
@ -24,8 +24,8 @@ PageLabelWidget::PageLabelWidget(QWidget * parent)
labelSize = QSize(205, 45);
textLabel = new QLabel(this);
textLabel->setAlignment(Qt::AlignVCenter|Qt::AlignHCenter);
if(verticalRes <= 1024)
textLabel->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
if (verticalRes <= 1024)
textLabel->setStyleSheet("QLabel { color : white; font-size:12px; padding-left:8px; }");
else if (verticalRes <= 1200)
textLabel->setStyleSheet("QLabel { color : white; font-size:16px; padding-left:8px;}");
@ -34,50 +34,46 @@ PageLabelWidget::PageLabelWidget(QWidget * parent)
setFixedSize(labelSize);
if(parent != 0)
move(QPoint((parent->geometry().size().width()-this->width()),-this->height()));
if (parent != 0)
move(QPoint((parent->geometry().size().width() - this->width()), -this->height()));
layout->addWidget(textLabel, 0 , Qt::AlignCenter);
layout->addWidget(textLabel, 0, Qt::AlignCenter);
setLayout(layout);
}
void PageLabelWidget::show()
{
if(this->pos().y() <= 0 && animation->state()!=QPropertyAnimation::Running)
{
QWidget * parent = dynamic_cast<QWidget *>(this->parent());
if(parent == 0)
{
return;
}
if (this->pos().y() <= 0 && animation->state() != QPropertyAnimation::Running) {
QWidget *parent = dynamic_cast<QWidget *>(this->parent());
if (parent == 0) {
return;
}
QWidget::show();
//connect(animation,SIGNAL(finished()),this,SLOT(QWidget::hide()));
animation->disconnect();
QWidget::show();
//connect(animation,SIGNAL(finished()),this,SLOT(QWidget::hide()));
animation->disconnect();
animation->setStartValue(QPoint((parent->geometry().size().width()-this->width()),-this->height()));
animation->setEndValue(QPoint((parent->geometry().size().width()-this->width()),0));
animation->start();
}
animation->setStartValue(QPoint((parent->geometry().size().width() - this->width()), -this->height()));
animation->setEndValue(QPoint((parent->geometry().size().width() - this->width()), 0));
animation->start();
}
}
void PageLabelWidget::hide()
{
if(this->pos().y() >= 0 && animation->state()!=QPropertyAnimation::Running)
{
QWidget * parent = dynamic_cast<QWidget *>(this->parent());
if(parent == 0)
{
return;
}
//connect(animation,SIGNAL(finished()),this,SLOT(setHidden()));
animation->setStartValue(QPoint((parent->geometry().size().width()-this->width()),0));
animation->setEndValue(QPoint((parent->geometry().size().width()-this->width()),-this->height()));
animation->start();
}
if (this->pos().y() >= 0 && animation->state() != QPropertyAnimation::Running) {
QWidget *parent = dynamic_cast<QWidget *>(this->parent());
if (parent == 0) {
return;
}
//connect(animation,SIGNAL(finished()),this,SLOT(setHidden()));
animation->setStartValue(QPoint((parent->geometry().size().width() - this->width()), 0));
animation->setEndValue(QPoint((parent->geometry().size().width() - this->width()), -this->height()));
animation->start();
}
}
void PageLabelWidget::setText(const QString & text)
void PageLabelWidget::setText(const QString &text)
{
textLabel->setText(text);
}
@ -86,20 +82,19 @@ void PageLabelWidget::paintEvent(QPaintEvent *)
{
QPainter painter(this);
painter.fillRect(0,0,width(),height(),QColor("#BB000000"));
painter.fillRect(0, 0, width(), height(), QColor("#BB000000"));
}
void PageLabelWidget::updatePosition()
{
QWidget * parent = dynamic_cast<QWidget *>(this->parent());
if(parent == 0)
{
QWidget *parent = dynamic_cast<QWidget *>(this->parent());
if (parent == 0) {
return;
}
}
animation->stop();
if (animation->endValue().toPoint().y() == 0)
move(QPoint((parent->geometry().size().width()-this->width()),0));
move(QPoint((parent->geometry().size().width() - this->width()), 0));
else
move(QPoint((parent->geometry().size().width()-this->width()),-this->height()));
move(QPoint((parent->geometry().size().width() - this->width()), -this->height()));
}