Quick QT question

Started by
8 comments, last by Servant of the Lord 11 years, 3 months ago

Is QT free on Windows? If yes, then can I sell the stuff I made using QT?

Sorry, I googled it but I couldnt find a clear answer. Thanks!

Advertisement

If by QT you mean Qt (the lower-case "t" is significant, and gives it the pronunciation "cute"), the answer is yes (to both questions), so long as you properly abide by the LGPL. You can also buy a commercial license of Qt, but that's not required to sell your application.

If by QT you mean QuickTime, I'm not exactly sure, seeing as they provide several licenses and I'm too lazy to read them (and hunt down any Windows specific things).

[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

Seconding what Cornstalks said, Qt the cross-platform windowing API is dual-licensed under LGPL, which means you can use it commercially under the LGPL's licensing requirements. You don't need to license your own code under LGPL either.

You're basically safe with LGPL if you: Link to Qt as a DLL (instead of statically linking) [1], don't modify Qt itself [2], distribute the Qt license with your project [3] and link to where others can download Qt [4].

I am not a laywer, so take my misunderstandings with a grain of thionite:

[1] I think FSF is working this ambiguity out, but until they do, it's a legal liability unless you sublicense your code under LGPL as well.

[2] Unless you clearly state you are using a modified version, and you make sure the modified sources are available and you license the Qt modifications under LGPL.

[3] You aren't licensing your project under LGPL, you are saying the Qt part is licensed under LGPL. Make sure you make that clear to end-users so they aren't confused.

[4] You are required to make LGPL licensed software (Qt in this case) source code available so others can recompile the DLLs. In practice, just linking to the Qt website is fine.

It's really one of the best open source licenses that permit commercial usage - only really liberal licenses like MIT/zlib/PNG license are better, from a commercial developer standpoint.

[Edit:] Qt used to not be free on Windows, but has been LGPL'd since 2009. Late last year, the previously corporate-managed API has now been transferred over the a community-run management structure with corporate assistance and backing. It's LGPL and permanently and legally irrevocably so - you are safe with it, even commercially. Just make sure you download the framework and IDE from qt-project.org, instead of from the commercially-licensed package that will cost you money (because it comes with commercial developer support).

Yes, I mean the cross-platform API Qt. Sorry

Thanks for the answers!

I think Im going to use it with C++ and OpenGL. I hope it has no effect on performance

I think Im going to use it with C++ and OpenGL. I hope it has no effect on performance

It has a big effect on performance, actually (if using the Widget system). These kind of APIs are designed for regular non-game applications, and the whole way the API is laid out goes contrary to the whole way most games are laid out. Games have infinite loops of: handle events, update, draw as fast as you can. Applications have infinite loops of: react to events, with the events sometimes telling the GUI to redraw itself.

Games are designed to run as fast as possible, with thousands and millions of objects needing constant updating, where applications are designed to sleep as much as possible, and only updating one or two objects when they are interacted with.

You can still make games with Qt and OpenGL, you just need to be aware of the performance effects. If you're making something simple, you probably won't notice any slowdown (though you'll notice the extreme difference in architecture), but once you start having more performance-critical requirements, you might bump against it. It's unfortunate, because Qt would otherwise be very useful for game GUIs (since you use CSS to skin the widgets). One of these days someone needs to modify Qt and make a version that is game-friendly. ([Edit:] Apparently some people are: Qt Game Enabler and Qt Game API - but I'm not sure how stable and active they are)

My game, which is a simple 2D game, using Qt for the editor but SFML for the game. I hope to get it so I can compile Qt entirely out of the code (and only use SFML) for when releasing the game, and only use Qt in the version of the game with the built-in editor.

See this thread and this thread and this blog entry to form your own opinions about Qt.

Note, I'm not saying Qt is bad. It's an excellent API. It's just not designed with games in mind, and if you want to use it for games you need to be aware of the shortcomings and decide whether the pros are worth the cons, or how to work around those shortcomings (I believe they can be worked around, but it'll take some work).

<blockquote class="ipsBlockquote" data-author="Servant of the Lord" data-cid="5018651"><p><br /></p><blockquote class="ipsBlockquote" data-author="Aliii" data-cid="5018555"><p>I think Im going to use it with C++ and OpenGL. I hope it has no effect on performance</p></blockquote> <br />It has a big effect on performance, actually (if using the Widget system). These kind of APIs are designed for regular non-game applications, and the whole way the API is laid out goes contrary to the whole way most games are laid out. Games have infinite loops of: handle events, update, draw as fast as you can. Applications have infinite loops of: react to events, with the events sometimes telling the GUI to redraw itself.<br /> <br />Games are designed to run as fast as possible, with thousands and millions of objects needing constant updating, where applications are designed to sleep as much as possible, and only updating one or two objects when they are interacted with.<br /> <br />You can still make games with Qt and OpenGL, you just need to be aware of the performance effects. If you're making something simple, you probably won't notice any slowdown (though you'll notice the extreme difference in architecture), but once you start having more performance-critical requirements, you might bump against it. It's unfortunate, because Qt would otherwise be very useful for game GUIs (since you use CSS to skin the widgets). One of these days someone needs to modify Qt and make a version that is game-friendly. (<span style="font-size:10px;"><strong>[Edit:]</strong> Apparently some people are: <a data-cke-saved-href="http://projects.developer.nokia.com/qtgameenabler" href="http://projects.developer.nokia.com/qtgameenabler">Qt Game Enabler</a> and <a data-cke-saved-href="http://harmattan-dev.nokia.com/docs/library/html/libqtgameopengles2/main.html?tab=1" href="http://harmattan-dev.nokia.com/docs/library/html/libqtgameopengles2/main.html?tab=1">Qt Game API</a> - but I'm not sure how stable and active they are</span>) <br /> <br />My game, which is a simple 2D game, using Qt for the editor but SFML for the game. I hope to get it so I can compile Qt entirely out of the code (and only use SFML) for when releasing the game, and only use Qt in the version of the game with the built-in editor.<br /> <br />See <a data-cke-saved-href="http://www.gamedev.net/topic/628049-qt-c-mmorpg/" href="http://www.gamedev.net/topic/628049-qt-c-mmorpg/">this thread</a> and <a data-cke-saved-href="http://www.gamedev.net/topic/625708-use-qt-something-else-or-roll-my-own/" href="http://www.gamedev.net/topic/625708-use-qt-something-else-or-roll-my-own/">this thread</a> and <a data-cke-saved-href="http://www.shamusyoung.com/twentysidedtale/?p=15904" href="http://www.shamusyoung.com/twentysidedtale/?p=15904">this blog entry</a> to form your own opinions about Qt.<br />Note, I'm not saying Qt is bad. It's an excellent API. It's just not designed with games in mind, and if you want to use it for games you need to be aware of the shortcomings and decide whether the pros are worth the cons, or how to work around those shortcomings (I believe they <u>can</u> be worked around, but it'll take some work).<br /><p><br /></p></blockquote><br />Those game APIs are for mobiles, a plain QGLWidget with the makeCurrent on each frame crap removed doesn't add any real slowdown compared to a Win32 or SFML window.<br /><br />The big problem with using QT really is that the vast majority of the API is unusable for games and thus redundant. (You still have to ship a whole bunch of rather large dlls)

For an editor where the UI elements are outside the GL widget performance will be more than good enough, just don't put other widgets inside the GL widget.
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

Thanks for the intel about the 3rd party adaptations being mobile.

For an editor where the UI elements are outside the GL widget performance will be more than good enough, just don't put other widgets inside the GL widget.

Putting UI elements inside the game window is exactly what most games will be wanting. Putting them outside the game window is, as you mentioned, fine for editors.

Thanks! Im using winapi as little as possible, like creating the opengl window, get the system time, input handling ....and thats it. If I could replace this with something cross-platform(and stable) that would be nice. In the game I have my own menus and Its running on fullscreen(thats why I assumed that it wont really affect the performance), but I have an editor too which needs more:)

you'll notice the extreme difference in architecture

What do you mean? Cant I just include the headers and use the API calls?

You still have to ship a whole bunch of rather large dlls

Like how large?smile.png

Thanks!

You still have to ship a whole bunch of rather large dlls

Like how large?smile.png

11.2 MB total for the QtCore4.dll and QtGui4.dll on my system. If you use various extensions or optional packages in Qt I wouldn't be surprised if there might be some extra DLLs you need.

[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]
Thanks! Im using winapi as little as possible, like creating the opengl window, get the system time, input handling ....and thats it. If I could replace this with something cross-platform(and stable) that would be nice. In the game I have my own menus and Its running on fullscreen(thats why I assumed that it wont really affect the performance), but I have an editor too which needs more:)

Well, if you need widgets, use Qt. If you don't need widgets, I would suggest SFML.

you'll notice the extreme difference in architecture

What do you mean? Cant I just include the headers and use the API calls?

The Win32 architecture is quite a bit different than Qt's architecture.

It's not that you can't call the API functions, it's that the execution flow of the functions are different so you can't just swap things out one for one. The higher level architecture of different libraries can follow different styles of thought. Qt is signal-and-slot and event-based (not one or the other, but both simultaneously), Win32 is only event-based.

You still have to ship a whole bunch of rather large dlls

Like how large?smile.png

If you don't accidentally ship the debug libraries, some some foolish programmers (it was an accident!), in Qt5 you'll just ship Qt5Core.dll (4.39mb), Qt5Gui.dll (3.77mb), and QtWidgets.dll (5.62mb). You can add the Qt OpenGL module with Qt5OpenGL.dll for only 382 kb. There are additional modules that can increase things further (like the Webkit module which is over 20 mb).

For comparison, SFML's five DLLs are a total of 1.67 mb with another 2.6 DLLs of dependencies for less than 5mb total.
Whether DLL size is a problem or not depends on your project - but it's probably nothing to worry about.

This topic is closed to new replies.

Advertisement