Category Archives: Qt

How To Embed Font in Qt Application Using QFontDatabase

You can embed a True Type font or Open Type font into your Qt application using QFontDatabase. You can link to an external font file or link to a font embedded as a resource. First, make sure you include a … Continue reading

Posted in Qt | Leave a comment

How to create X11 colors into Qt QColor Wrapper

You can mix any color you want nowadays with 32-bit colors. But sometimes, it’s just so much more convenient if the color palette already exists. And unfortunately, Qt only provides users with the most basic of colors. Therefore, it’s up … Continue reading

Posted in Qt | Leave a comment

How to Implement Custom Optimized MouseDoubleClickEvent Function in Qt

If you were unaware that Qt’s default mouseDoubleClickEvent isn’t exactly optimized, as that is the nature of the beast, so when you override it, it will slow everything down. So the only thing you can do is write your own … Continue reading

Posted in Qt | Leave a comment

Qt MouseDoubleClickEvent May Slow Down Performance

http://qt-project.org/doc/qt-4.8/qwidget.html#mouseDoubleClickEvent I just discovered this. I’ve been implementing the convenience overriding of MouseDoubleClickEvent in all of my custom widgets. After optimizing all of my basic overrided mouse handling events: mousePressed, mouseMove, mouseReleased, it turns out it was that dang doubleclick … Continue reading

Posted in Qt | Leave a comment

How to change screen resolution in Windows using Qt

If you, too, are scouring the Interwebs for the answer, here it is: http://www.qtforum.org/article/30063/qt-opengl-resolution.html?s=404deefd560e1ab54cce082517049711d0fdb836#post100696 First, you’re going to need to download the Windows SDK to get the proper c++ header files to reference. In this particular case, you’re going to … Continue reading

Posted in Qt | Leave a comment

How to generate random number in Qt

If you thought Qt provided you with a robust count of math algorithms already, you’ll be in for a surprise. There is qrand(), but it doesn’t quite provide you with the user-friendliness of other languages. For example, sometimes you want … Continue reading

Posted in Qt | Tagged , , , , , , , , , , , | 2 Comments

Most comprehensive guide to HTML5 Canvas Element

http://qt-project.org/doc/qt-4.8/qtwebkit-guide-canvas.html This is the most comprehensive guide to HTML5 canvas I’ve seen so far on the Internet. Even Mozilla doesn’t explain it this well. How ironic that Qt has written up such a proficient guide even though their framework doesn’t … Continue reading

Posted in Qt | Tagged , , , , , , | Leave a comment

Qt 2D Game Prototype Demos SDXM

Here are some functioning pure Qt 2D game prototypes I’ve created as a foundation for my 2D game engine SDXM.

Posted in Qt, SDXM | Tagged , , , , , , , , , , | Leave a comment

Solution: Qt setMouseTracking Doesn’t Work

By default, Qt will set any QWidget into a QMainWindow unless you set it yourself. This is possibly why you can’t setMouseTracking in your default QWidget. You need to enable setMouseTracking if you want real-time mouse position tracking; it is … Continue reading

Posted in Qt | Tagged , , , , , , , , , , , , , , , , , , , | Leave a comment

Overriding QWidget Events

For the most part, Qt comes with a bunch of convenience widgets built on top of their own QWidget. They may provide very specific features and might suit your needs perfectly. But when you want to implement something that is … Continue reading

Posted in Qt | Tagged , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment