mame icon indicating copy to clipboard operation
mame copied to clipboard

debugger/qt/debuggerview.cpp: fix deprecation warning on Qt6

Open angelosa opened this issue 1 year ago • 8 comments

  • chore: bump Linux CI to Qt6

angelosa avatar Jan 10 '25 09:01 angelosa

Courtesy branch just to check it compiles everywhere:

src/osd/modules/debugger/qt/debuggerview.cpp: In member function ‘virtual void osd::debugger::qt::DebuggerView::mousePressEvent(QMouseEvent*)’:
src/osd/modules/debugger/qt/debuggerview.cpp:311:67: warning: ‘int QMouseEvent::x() const’ is deprecated: Use position() [-Wdeprecated-declarations]
  311 |         clickViewPosition.x = (std::min)(int(topLeft.x + (event->x() / fontWidth)), topLeft.x + visibleCharDims.x - 1);
      |                                                           ~~~~~~~~^~
In file included from /usr/include/qt6/QtGui/QKeyEvent:1,
                 from src/osd/modules/debugger/qt/debuggerview.cpp:14:
/usr/include/qt6/QtGui/qevent.h:226:16: note: declared here
  226 |     inline int x() const { return qRound(position().x()); }
      |                ^
src/osd/modules/debugger/qt/debuggerview.cpp:312:67: warning: ‘int QMouseEvent::y() const’ is deprecated: Use position() [-Wdeprecated-declarations]
  312 |         clickViewPosition.y = (std::min)(int(topLeft.y + (event->y() / fontHeight)), topLeft.y + visibleCharDims.y - 1);
      |                                                           ~~~~~~~~^~
/usr/include/qt6/QtGui/qevent.h:228:16: note: declared here
  228 |     inline int y() const { return qRound(position().y()); }

angelosa avatar Jan 10 '25 09:01 angelosa

Given the Qt5 EoL in May 2025 may as well bump to Qt6 anyway. Thoughts?

angelosa avatar Jan 10 '25 11:01 angelosa

I agree we should bump to Qt 6, but it needs to compile successfully first obviously.

rb6502 avatar Jan 11 '25 16:01 rb6502

I’m not set up to deal with Qt6 for Windows test builds, and doing so would mean bumping the compiler version etc. for releases due to the mess of dependencies in MSYS2’s MinGW. I don’t really want to do that at the moment.

cuavas avatar Jan 11 '25 16:01 cuavas

I agree we should bump to Qt 6, but it needs to compile successfully first obviously.

I recognize the current error: somehow this section will go qt5 regardless of what's really installed (and locally I just populate the QT_HOME env)

Package Qt5Widgets was not found in the pkg-config search path. Perhaps you should add the directory containing `Qt5Widgets.pc' to the PKG_CONFIG_PATH environment variable

https://github.com/mamedev/mame/blob/cd2d3f417717fba6cf92a0aa96074451afc24d2b/scripts/src/osd/modules.lua#L509-L531

I’m not set up to deal with Qt6 for Windows test builds, and doing so would mean bumping the compiler version etc. for releases due to the mess of dependencies in MSYS2’s MinGW. I don’t really want to do that at the moment.

It's not urgent sure, it also needs Mac OS equivalent for using Qt6 anyway (and I'm not setup for that atm either).

angelosa avatar Jan 12 '25 14:01 angelosa

A Qt6 fix for the MacOS build was committed in c709a0f124d6028005bae7ec7c2b1c92b46a3c3a.

ajrhacker avatar Mar 28 '25 11:03 ajrhacker

An Arch distro I have does something dull: maps qt5 to /usr/bin/qmake and qt6 to /usr/bin/qmake6. Need to investigate over that front.

angelosa avatar Mar 28 '25 12:03 angelosa

2550f57948a4637167f6124673e4e9b086eed297 should fix the deprecation warning without breaking Qt5.

cuavas avatar Mar 31 '25 18:03 cuavas