Cargador
::Cargador(QWidget *parent
) : QWidget(parent,Qt
::FramelessWindowHint), ui
(new Ui
::Cargador) { ui->setupUi(this);
resize(500,255);
// SUPERIOR IZQUIERDO
esquina
= QRegion(0,
0,
25,
25,
QRegion::Rectangle);
// Cuadrado de un cuarto del circulo region = region.subtracted(esquina.subtracted(circulo));
// INFERIOR DERECHO
region = region.subtracted(esquina.subtracted(circulo));
setMask(region);
QPixmap logo
(":/Cargador/Imagenes/Logo.png",
0,Qt
::AutoColor);
// qDebug() << logo;
ui->lblLogo->setPixmap(logo);
ui->lblLogo->show();
// Labels transparentes
ui->label->setAttribute(Qt::WA_TranslucentBackground);
ui->label_2->setAttribute(Qt::WA_TranslucentBackground);
ui->lblCargando->setAttribute(Qt::WA_TranslucentBackground);
ui->lblLogo->setAttribute(Qt::WA_TranslucentBackground);
// Borde en negro.
//QPolygon poligono;
zona.addRegion(region);
linea.setWidth(8);
linea.setColor(Qt::red);
decorador.setPen(linea);
decorador.drawPath(zona);
}
Cargador::Cargador(QWidget *parent) : QWidget(parent,Qt::FramelessWindowHint), ui(new Ui::Cargador) {
ui->setupUi(this);
resize(500,255);
QRegion esquina;
QRegion circulo;
QRegion region(0,0,width(),height(),QRegion::Rectangle);
// SUPERIOR IZQUIERDO
circulo = QRegion(0,0,50,50,QRegion::Ellipse); // Circulo hardcodeado
esquina = QRegion(0,0,25,25,QRegion::Rectangle); // Cuadrado de un cuarto del circulo
region = region.subtracted(esquina.subtracted(circulo));
// INFERIOR DERECHO
circulo = QRegion(width()-50,height()-50,50,50,QRegion::Ellipse);
esquina = QRegion(width()-25,height()-25,25,25,QRegion::Rectangle);
region = region.subtracted(esquina.subtracted(circulo));
setMask(region);
QPixmap logo(":/Cargador/Imagenes/Logo.png",0,Qt::AutoColor);
// qDebug() << logo;
ui->lblLogo->setPixmap(logo);
ui->lblLogo->show();
// Labels transparentes
ui->label->setAttribute(Qt::WA_TranslucentBackground);
ui->label_2->setAttribute(Qt::WA_TranslucentBackground);
ui->lblCargando->setAttribute(Qt::WA_TranslucentBackground);
ui->lblLogo->setAttribute(Qt::WA_TranslucentBackground);
// Borde en negro.
QPainter decorador(this);
//QPolygon poligono;
QPen linea;
QPainterPath zona;
zona.addRegion(region);
linea.setWidth(8);
linea.setColor(Qt::red);
decorador.setPen(linea);
decorador.drawPath(zona);
}
To copy to clipboard, switch view to plain text mode
Bookmarks