Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

angelosa
Copy link
Member

@angelosa angelosa commented Jan 10, 2025

  • chore: bump Linux CI to Qt6

@angelosa
Copy link
Member Author

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 angelosa marked this pull request as draft January 10, 2025 11:11
@angelosa
Copy link
Member Author

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

@rb6502
Copy link
Contributor

rb6502 commented Jan 11, 2025

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

@cuavas
Copy link
Member

cuavas commented Jan 11, 2025

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.

@angelosa
Copy link
Member Author

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

else
if _OPTIONS["QT_HOME"]~=nil then
local qt_version = str_to_version(backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_VERSION"))
linkoptions {
"-L" .. backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_INSTALL_LIBS"),
}
if qt_version < 60000 then
links {
"Qt5Core",
"Qt5Gui",
"Qt5Widgets",
}
else
links {
"Qt6Core",
"Qt6Gui",
"Qt6Widgets",
}
end
else
local str = backtick(pkgconfigcmd() .. " --libs Qt5Widgets")
addlibfromstring(str)
addoptionsfromstring(str)

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 angelosa added the PoC label Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants