fix addwidget UI

This commit is contained in:
like 2024-04-28 10:49:48 +08:00
parent b12ad664eb
commit b435aedca4
6 changed files with 51 additions and 10 deletions

View File

@ -536,8 +536,16 @@ void cursorAddIconWidget::paintEvent(QPaintEvent *event)
Q_UNUSED(event);
QPainter painter(this);
painter.setPen(Qt::DashLine);
painter.drawRect(rect().adjusted(1, 1, -1, -1));
QPen *m_pen = new QPen();
m_pen->setColor(QColor(Qt::gray));
m_pen->setStyle(Qt::DashLine);
painter.setPen(*m_pen);
int radius = 7;
QPainterPath path;
path.addRoundedRect(rect().adjusted(1,1,-1,-1), radius, radius);
painter.drawPath(path);
}
void cursorAddIconWidget::dragEnterEvent(QDragEnterEvent *event)

View File

@ -677,8 +677,16 @@ void addPicWidget::paintEvent(QPaintEvent *event)
Q_UNUSED(event);
QPainter painter(this);
painter.setPen(Qt::DashLine);
painter.drawRect(rect().adjusted(1, 1, -1, -1));
QPen *m_pen = new QPen();
m_pen->setColor(QColor(Qt::gray));
m_pen->setStyle(Qt::DashLine);
painter.setPen(*m_pen);
int radius = 7;
QPainterPath path;
path.addRoundedRect(rect().adjusted(1,1,-1,-1), radius, radius);
painter.drawPath(path);
}
void addPicWidget::dragEnterEvent(QDragEnterEvent *event)

View File

@ -318,8 +318,16 @@ void grubAddPicWidget::paintEvent(QPaintEvent *event)
Q_UNUSED(event);
QPainter painter(this);
painter.setPen(Qt::DashLine);
painter.drawRect(rect().adjusted(1, 1, -1, -1));
QPen *m_pen = new QPen();
m_pen->setColor(QColor(Qt::gray));
m_pen->setStyle(Qt::DashLine);
painter.setPen(*m_pen);
int radius = 7;
QPainterPath path;
path.addRoundedRect(rect().adjusted(1,1,-1,-1), radius, radius);
painter.drawPath(path);
}
void grubAddPicWidget::dragEnterEvent(QDragEnterEvent *event)

View File

@ -900,8 +900,16 @@ void addIconWidget::paintEvent(QPaintEvent *event)
Q_UNUSED(event);
QPainter painter(this);
painter.setPen(Qt::DashLine);
painter.drawRect(rect().adjusted(1, 1, -1, -1));
QPen *m_pen = new QPen();
m_pen->setColor(QColor(Qt::gray));
m_pen->setStyle(Qt::DashLine);
painter.setPen(*m_pen);
int radius = 7;
QPainterPath path;
path.addRoundedRect(rect().adjusted(1,1,-1,-1), radius, radius);
painter.drawPath(path);
}
void addIconWidget::dragEnterEvent(QDragEnterEvent *event)

View File

@ -27,6 +27,7 @@
#include <QGraphicsTextItem>
#include <QTextBlockFormat>
#include <QtWidgets>
#include <QPen>
class MainInterFaceFeature : public QWidget
{

View File

@ -401,8 +401,16 @@ void plymouthAddPicWidget::paintEvent(QPaintEvent *event)
Q_UNUSED(event);
QPainter painter(this);
painter.setPen(Qt::DashLine);
painter.drawRect(rect().adjusted(1, 1, -1, -1));
QPen *m_pen = new QPen();
m_pen->setColor(QColor(Qt::gray));
m_pen->setStyle(Qt::DashLine);
painter.setPen(*m_pen);
int radius = 7;
QPainterPath path;
path.addRoundedRect(rect().adjusted(1,1,-1,-1), radius, radius);
painter.drawPath(path);
}
void plymouthAddPicWidget::dragEnterEvent(QDragEnterEvent *event)