Remix.run Logo
jasongill a day ago

Ignoring concerns about the security of UPnP, and the fact that this is somewhat of a "solved" problem considering there are things like libupnp and miniupnpc, I am wondering if this is really the cleanest way to solve the problem in C++ with Qt?

I'm most curious about the fact that this program has ~30,000 lines of included headers to simply generate a static string (the XML output).

Obviously if you were generating large XML payloads repeatedly, then including a dependency would be a good idea, but this implementation is using "inja.hpp" which in turn requires "json.hpp" to output what is effectively a concatenated string.

Why not just use Qt's built in QStringLiteral and feed it the (short) bit of XML to it along with your 4 variables, similar to a sprintf?

WesolyKubeczek a day ago | parent [-]

Likely a side effect of Qt trying to be an “everything” library, batteries and battery factory included.

jasongill a day ago | parent | next [-]

I guess that's my point - the author is already using Qt which has so much included, but are still including two large header files in the project just to output a ~12 line XML snippet

jacquesm a day ago | parent | prev [-]

Qt is terrible. Since a couple of years they want a login just to download the code required for a build and I really have zero desire to get a bunch of marketeers that are wondering if I'm ripe for the plucking yet just because I've decided to fix some bugs in open source code.

StellarScience a day ago | parent | next [-]

  git clone --branch v6.10.1 https://code.qt.io/qt/qt5.git .
No login required.

They do require a login to download precompiled binaries, but what self-respecting Hacker News reader wants those?!

Ok, I'll admit, I've done it. And yes, I received Qt marketing at that email alias for a while, but they've stopped.

And remember, Qt has an LPGL license too, not just Commercial and GPL.

EDIT: Ah, ranger_danger pointed out that https://download.qt.io/archive/qt/6.10/ hosts binaries with no login required as well!

jcelerier a day ago | parent [-]

> They do require a login to download precompiled binaries, but what self-respecting Hacker News reader wants those?!

even then, they're freely accessible and there's a simple CLI to get them.

    uvx --from aqtinstall aqt install-qt linux desktop 6.10.1
and tada
ranger_danger a day ago | parent | prev [-]

IMO Qt is amazing. No login is technically required to download anything, especially code.

The official SDK installer GUI does require a login, but you don't have to use it in order to download or use Qt at all.

Not only can you download all the individual components that the GUI fetches via download.qt.io yourself, there's also third-party installers like aqtinstall, as well as many different OS package managers that provide Qt binaries.