applied some clang modernize (#2435)
This commit is contained in:
@@ -1696,7 +1696,7 @@ void CaptureWidget::redo()
|
||||
QRect CaptureWidget::extendedSelection() const
|
||||
{
|
||||
if (!m_selection->isVisible()) {
|
||||
return QRect();
|
||||
return {};
|
||||
}
|
||||
QRect r = m_selection->geometry();
|
||||
return extendedRect(r);
|
||||
@@ -1705,10 +1705,10 @@ QRect CaptureWidget::extendedSelection() const
|
||||
QRect CaptureWidget::extendedRect(const QRect& r) const
|
||||
{
|
||||
auto devicePixelRatio = m_context.screenshot.devicePixelRatio();
|
||||
return QRect(r.left() * devicePixelRatio,
|
||||
r.top() * devicePixelRatio,
|
||||
r.width() * devicePixelRatio,
|
||||
r.height() * devicePixelRatio);
|
||||
return { static_cast<int>(r.left() * devicePixelRatio),
|
||||
static_cast<int>(r.top() * devicePixelRatio),
|
||||
static_cast<int>(r.width() * devicePixelRatio),
|
||||
static_cast<int>(r.height() * devicePixelRatio) };
|
||||
}
|
||||
|
||||
QRect CaptureWidget::paddedUpdateRect(const QRect& r) const
|
||||
|
||||
@@ -11,12 +11,13 @@
|
||||
#include <QPainter>
|
||||
#include <QPropertyAnimation>
|
||||
#include <QTimer>
|
||||
#include <utility>
|
||||
|
||||
#define MARGIN (m_THandle.width())
|
||||
|
||||
SelectionWidget::SelectionWidget(const QColor& c, QWidget* parent)
|
||||
SelectionWidget::SelectionWidget(QColor c, QWidget* parent)
|
||||
: QWidget(parent)
|
||||
, m_color(c)
|
||||
, m_color(std::move(c))
|
||||
, m_activeSide(NO_SIDE)
|
||||
, m_ignoreMouse(false)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ public:
|
||||
CENTER = 0b10000,
|
||||
};
|
||||
|
||||
explicit SelectionWidget(const QColor& c, QWidget* parent = nullptr);
|
||||
explicit SelectionWidget(QColor c, QWidget* parent = nullptr);
|
||||
|
||||
SideType getMouseSide(const QPoint& mousePos) const;
|
||||
QVector<QRect> handlerAreas();
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
LoadSpinner::LoadSpinner(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
, m_startAngle(0)
|
||||
, m_span(0)
|
||||
, m_growing(true)
|
||||
{
|
||||
|
||||
@@ -12,14 +12,15 @@
|
||||
#include <QTimer>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWheelEvent>
|
||||
#include <utility>
|
||||
|
||||
UpdateNotificationWidget::UpdateNotificationWidget(
|
||||
QWidget* parent,
|
||||
const QString& appLatestVersion,
|
||||
const QString& appLatestUrl)
|
||||
QString appLatestUrl)
|
||||
: QWidget(parent)
|
||||
, m_appLatestVersion(appLatestVersion)
|
||||
, m_appLatestUrl(appLatestUrl)
|
||||
, m_appLatestUrl(std::move(appLatestUrl))
|
||||
, m_layout(nullptr)
|
||||
{
|
||||
setMinimumSize(400, 100);
|
||||
|
||||
@@ -20,7 +20,7 @@ class UpdateNotificationWidget : public QWidget
|
||||
public:
|
||||
explicit UpdateNotificationWidget(QWidget* parent,
|
||||
const QString& appLatestVersion,
|
||||
const QString& appLatestUrl);
|
||||
QString appLatestUrl);
|
||||
void setAppLatestVersion(const QString& latestVersion);
|
||||
|
||||
void hide();
|
||||
|
||||
Reference in New Issue
Block a user