mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-12-23 08:50:57 +01:00
Merge pull request #7161 from MightyCreak/fix-some-warnings
Fix a few warnings
This commit is contained in:
commit
2a77c29c6d
3 changed files with 11 additions and 8 deletions
|
@ -1837,7 +1837,7 @@ void PlayerControlPreview::DrawLeftBody(QPainter& p, const QPointF center) {
|
||||||
const float led_size = 5.0f;
|
const float led_size = 5.0f;
|
||||||
const QPointF led_position = sideview_center + QPointF(0, -36);
|
const QPointF led_position = sideview_center + QPointF(0, -36);
|
||||||
int led_count = 0;
|
int led_count = 0;
|
||||||
for (const auto color : led_color) {
|
for (const auto& color : led_color) {
|
||||||
p.setBrush(color);
|
p.setBrush(color);
|
||||||
DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size);
|
DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size);
|
||||||
}
|
}
|
||||||
|
@ -1933,7 +1933,7 @@ void PlayerControlPreview::DrawRightBody(QPainter& p, const QPointF center) {
|
||||||
const float led_size = 5.0f;
|
const float led_size = 5.0f;
|
||||||
const QPointF led_position = sideview_center + QPointF(0, -36);
|
const QPointF led_position = sideview_center + QPointF(0, -36);
|
||||||
int led_count = 0;
|
int led_count = 0;
|
||||||
for (const auto color : led_color) {
|
for (const auto& color : led_color) {
|
||||||
p.setBrush(color);
|
p.setBrush(color);
|
||||||
DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size);
|
DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size);
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,24 +143,28 @@ void MicroProfileWidget::hideEvent(QHideEvent* ev) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MicroProfileWidget::mouseMoveEvent(QMouseEvent* ev) {
|
void MicroProfileWidget::mouseMoveEvent(QMouseEvent* ev) {
|
||||||
MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0);
|
const auto mouse_position = ev->pos();
|
||||||
|
MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0);
|
||||||
ev->accept();
|
ev->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MicroProfileWidget::mousePressEvent(QMouseEvent* ev) {
|
void MicroProfileWidget::mousePressEvent(QMouseEvent* ev) {
|
||||||
MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0);
|
const auto mouse_position = ev->pos();
|
||||||
|
MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0);
|
||||||
MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton);
|
MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton);
|
||||||
ev->accept();
|
ev->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* ev) {
|
void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* ev) {
|
||||||
MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0);
|
const auto mouse_position = ev->pos();
|
||||||
|
MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0);
|
||||||
MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton);
|
MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton);
|
||||||
ev->accept();
|
ev->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MicroProfileWidget::wheelEvent(QWheelEvent* ev) {
|
void MicroProfileWidget::wheelEvent(QWheelEvent* ev) {
|
||||||
MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale,
|
const auto wheel_position = ev->position().toPoint();
|
||||||
|
MicroProfileMousePosition(wheel_position.x() / x_scale, wheel_position.y() / y_scale,
|
||||||
ev->angleDelta().y() / 120);
|
ev->angleDelta().y() / 120);
|
||||||
ev->accept();
|
ev->accept();
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,8 +159,7 @@ GameListSearchField::GameListSearchField(GameList* parent) : QWidget{parent} {
|
||||||
* @return true if the haystack contains all words of userinput
|
* @return true if the haystack contains all words of userinput
|
||||||
*/
|
*/
|
||||||
static bool ContainsAllWords(const QString& haystack, const QString& userinput) {
|
static bool ContainsAllWords(const QString& haystack, const QString& userinput) {
|
||||||
const QStringList userinput_split =
|
const QStringList userinput_split = userinput.split(QLatin1Char{' '}, Qt::SkipEmptyParts);
|
||||||
userinput.split(QLatin1Char{' '}, QString::SplitBehavior::SkipEmptyParts);
|
|
||||||
|
|
||||||
return std::all_of(userinput_split.begin(), userinput_split.end(),
|
return std::all_of(userinput_split.begin(), userinput_split.end(),
|
||||||
[&haystack](const QString& s) { return haystack.contains(s); });
|
[&haystack](const QString& s) { return haystack.contains(s); });
|
||||||
|
|
Loading…
Reference in a new issue