[Development] Moving QDesktopServices from Gui to Core?

Marc Mutz marc.mutz at qt.io
Tue May 7 12:51:36 CEST 2024


On 06.05.24 13:08, Tor Arne Vestbø via Development wrote:
> 
> 
>> On 6 May 2024, at 13:06, Juha Vuolle <juvuolle at gmail.com> wrote:
>>
>>> QtNetworkauth leaves the QDesktopServices::openUrl() usage/non-usage
>>> at the user's discretion, and thus that currently won't force a Gui
>>> dependency.
>>
>> (Ah shoot. Correcting myself, in the new qtnetworkauth class we do
>> need to call QDesktopServices::openUrl() too to forward any unhandled
>> URLs.)
> 
> Which you can do through the private QtCore API that we add.

AFAIU, it's the user that needs to make a connection to openUrl() from 
an OAuth signal: 
https://code.qt.io/cgit/qt/qtnetworkauth.git/tree/examples/oauth/redditclient/redditwrapper.cpp#n28

So, no, private-only API won't cut it.

Honestly, I don't understand the push-back for the move. It seems only 
logical to me: QUrl is in QtCore, so IMHO, it's only logical to have 
QUrl _handlers_ in QtCore, too. And in other emails, I showed use-cases 
of CLI programs that need openUrl(), but not the rest of QtGui.

So, we have use-cases and we seem to have no technical reason to not 
move the code (if we can provide it as private API, there can't be many).

So, if this boils down to private vs. public API: Why keep it private? 
It's not new API, it's just renamed for BC reasons.

Thanks,
Marc

-- 
Marc Mutz <marc.mutz at qt.io> (he/his)
Principal Software Engineer

The Qt Company
Erich-Thilo-Str. 10 12489
Berlin, Germany
www.qt.io

Geschäftsführer: Mika Pälsi, Juha Varelius, Jouni Lintunen
Sitz der Gesellschaft: Berlin,
Registergericht: Amtsgericht Charlottenburg,
HRB 144331 B



More information about the Development mailing list