Fix warnings in Qt6 builds
This commit is contained in:
parent
45af044cd8
commit
a24a497759
4 changed files with 29 additions and 10 deletions
2
cli.cpp
2
cli.cpp
|
|
@ -29,7 +29,7 @@
|
||||||
\*-------------------------------------------------------------*/
|
\*-------------------------------------------------------------*/
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
#define strcasecmp strcmpi
|
#define strcasecmp _strcmpi
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
|
|
|
||||||
6
main.cpp
6
main.cpp
|
|
@ -221,8 +221,10 @@ int main(int argc, char* argv[])
|
||||||
/*-----------------------------------------------------*\
|
/*-----------------------------------------------------*\
|
||||||
| Enable high DPI scaling support |
|
| Enable high DPI scaling support |
|
||||||
\*-----------------------------------------------------*/
|
\*-----------------------------------------------------*/
|
||||||
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
|
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
||||||
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
|
||||||
|
#endif
|
||||||
|
|
||||||
/*-----------------------------------------------------*\
|
/*-----------------------------------------------------*\
|
||||||
| Enable high DPI fractional scaling support on Windows |
|
| Enable high DPI fractional scaling support on Windows |
|
||||||
|
|
|
||||||
|
|
@ -596,10 +596,17 @@ void DeviceView::mousePressEvent(QMouseEvent *event)
|
||||||
/*-----------------------------------------------------*\
|
/*-----------------------------------------------------*\
|
||||||
| It's okay if the size becomes negative |
|
| It's okay if the size becomes negative |
|
||||||
\*-----------------------------------------------------*/
|
\*-----------------------------------------------------*/
|
||||||
selectionRect.setLeft(event->x());
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
selectionRect.setTop(event->y());
|
selectionRect.setLeft(event->position().x());
|
||||||
selectionRect.setRight(event->x());
|
selectionRect.setTop(event->position().y());
|
||||||
selectionRect.setBottom(event->y());
|
selectionRect.setRight(event->position().x());
|
||||||
|
selectionRect.setBottom(event->position().y());
|
||||||
|
#else
|
||||||
|
selectionRect.setLeft(event->x());
|
||||||
|
selectionRect.setTop(event->y());
|
||||||
|
selectionRect.setRight(event->x());
|
||||||
|
selectionRect.setBottom(event->y());
|
||||||
|
#endif
|
||||||
|
|
||||||
updateSelection();
|
updateSelection();
|
||||||
update();
|
update();
|
||||||
|
|
@ -611,8 +618,14 @@ void DeviceView::mouseMoveEvent(QMouseEvent *event)
|
||||||
if(per_led)
|
if(per_led)
|
||||||
{
|
{
|
||||||
lastMousePos = event->pos();
|
lastMousePos = event->pos();
|
||||||
selectionRect.setRight(event->x());
|
|
||||||
selectionRect.setBottom(event->y());
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
selectionRect.setRight(event->position().x());
|
||||||
|
selectionRect.setBottom(event->position().y());
|
||||||
|
#else
|
||||||
|
selectionRect.setRight(event->x());
|
||||||
|
selectionRect.setBottom(event->y());
|
||||||
|
#endif
|
||||||
|
|
||||||
if(mouseDown)
|
if(mouseDown)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1641,7 +1641,11 @@ void OpenRGBDialog::onShowDialogMessage()
|
||||||
|
|
||||||
DontShowAgain = false;
|
DontShowAgain = false;
|
||||||
|
|
||||||
QObject::connect(CheckBox_DontShowAgain, &QCheckBox::stateChanged, [this](int state)
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
QObject::connect(CheckBox_DontShowAgain, &QCheckBox::checkStateChanged, [this](Qt::CheckState state)
|
||||||
|
#else
|
||||||
|
QObject::connect(CheckBox_DontShowAgain, &QCheckBox::stateChanged, [this](int state)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
if(static_cast<Qt::CheckState>(state) == Qt::CheckState::Checked)
|
if(static_cast<Qt::CheckState>(state) == Qt::CheckState::Checked)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue