QWidget2: Fix Qt 5.12 build

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2020-12-01 17:56:56 +08:00
parent 27be916e11
commit a610c84a3c
2 changed files with 11 additions and 1 deletions

View File

@ -57,7 +57,7 @@ void ContentsWidget::paintEvent(QPaintEvent *event)
if (m_bShouldDrawWindowBorder) {
QPainter painter(this);
painter.save();
painter.setPen({Qt::black, 1.5});
painter.setPen({window()->isActiveWindow() ? Qt::black : Qt::darkGray, 1.5});
painter.drawLine(0, 0, width(), 0);
painter.drawLine(0, height(), width(), height());
painter.drawLine(0, 0, 0, height());

View File

@ -26,6 +26,16 @@
#include <QWidget>
#if (QT_VERSION < QT_VERSION_CHECK(5, 13, 0))
#define Q_DISABLE_MOVE(Class) \
Class(Class &&) = delete; \
Class &operator=(Class &&) = delete;
#define Q_DISABLE_COPY_MOVE(Class) \
Q_DISABLE_COPY(Class) \
Q_DISABLE_MOVE(Class)
#endif
class QGraphicsDropShadowEffect;
class QPushButton;
class QLabel;