Archive for the ‘Qt’ Category

QT SDK 1.1.2 -Install The QODBC Driver

In the most recent versions of the Qt SDK it appears as if default support for all databases except SQLite has been removed.

The Qt documentation provides a short write-up on how to re-enable this driver, but it leaves out some important details.

To enable support for the QODBC driver follow these steps:

1. From the Qt Creator Application Launch Start Updater:

Continued after the jump…

Read More

SSE And Inline Assembly Example

In previous posts we’ve covered Inline Assembly and SSE Intrinsics coding.

In this post we’ll merge these concepts by creating a version of the CMYK to RGB conversion code strictly in raw SSE and assembly. The upshot is you’ll see how we can take existing, real-world C++ code and use GCC’s Extended Assembly syntax to interweave raw assembly code for potential performance gains.

This means this tutorial is not just about extended assembly or sse coding, it’s about using both in a real-world application. We’ll learn many concepts including data retrieval, loop processing, SSE processor instructions, floating point number representation, and much more!

Read More

Aesop – A Hip Hop PHP UI

Download the Complete (and free, as in open source free) Aesop + HPHP files from right here.

PHP is my favorite language, bare none. It’s simple, elegant, and fun to use. Problem is, for highly trafficked sites it’s a touch slow and can be quite memory hungry. If you’re Facebook this can lead to problems, which is why they invented Hip Hop PHP (HPHP), a collection of tools and technology that turns our slow and hungry PHP code into lean and mean C++.

Ok, So Just How Fast Is It?

As a quick comparison I created a simple FormBoss form and ran Apache Bench (ab from the command line), to get a sense of the speed difference between Apache 2.2 and HPHP.

The top two tests are when running our simple .php files, the bottom test is when serving a simple 62 byte .xml file with 100 concurrent users:

**It’s important to note these numbers will be lower when running though a network and calling a database. Also, while other servers like Cherokee can be twice as fast as Apache, HPHP is still nearly twice as fast again.

So yes, qualifications aside, HPHP is very fast indeed.

Sure these numbers are fantastic, but using HPHP means compiling the source from scratch and then using a series of command-line switches to run and manage the compiled PHP code.

No longer–In my spare time I’ve created and now released an open-source front-end UI to HPHP.

Read on to learn more, or just download the files!

Read More

Connecting to an MSSQL Database in Qt

In this post we’ll review code for connecting a 32-bit Qt application to an SQL Server 2008 R2 instance running on 64-bit Windows 7.

Read More

Building Qt Projects With MMX, SSE, and SSE2

Quick post here about a problem I came across when trying to use intrinsics in a Qt project on 32-bit Ubuntu 10.10.

Read More

Converting CMYK to RGB In Qt Using Little CMS :: Part 2

In the first post of this series we saw how we can use a library called Little CMS to create accurate CMYK to RGB conversions in Qt. In this post we’ll take a look at the actual act of conversion as well as address performance concerns.

Read More

Converting CMYK to RGB In Qt Using Little CMS :: Part 1

In this post we’ll create at a multi-threaded application that properly converts CMYK images to RGB. The key here is properly, by which I mean a ‘standard’ conversion to CMYK goes something like:

R = ( (255-C)*(255-K) ) / 255;
G = ( (255-M)*(255-K) ) / 255;
B = ( (255-Y)*(255-K) ) / 255;

…which is simple but unfortunately leaves our images looking pretty awful. The reason is we are not taking into account any color profile information, which means the mapping of say, a green we see in CMYK is not the same green in we’ll get in RGB.

The solution for this problem is to complicate the solution just a touch by employing a third party library called Little CMS to act as the middle-man for the color conversion process.

This comprehensive library does many things you may be interested in, but for us, allows us to employ color profiles during the CMYK -> RGB conversion process. The end result is an RGB images that very closely matches the original CMYK source.

Read More

Linking libjpeg and Boost+GIL in Qt and X-Code

In this post I’d like to share my experiences of linking an external library and code files to an X-Code and Qt project. This task, more than anything, requires a good deal of “glue” information, that is, knowing how and when to do this or that little task to get to the next stage. It’s not too hard, but can be quite time consuming as you scour the net for hints. Hopefully this single write-up will help others.

Read More

Qt – 3 Methods Of Adding & Integrating Designer Forms

The Qt Designer tool allows us to create forms for our application in a visual manner, freeing us from the tedium of hand-coding. While this saves time, it’s important to understand the various ways Qt creates these forms and by extension, the methods at our disposal to integrate these forms into a larger application.

In this post we’ll look at the 3 main technical options Qt Designer employs to serve this function:

  • Aggregation as a pointer member
  • Aggregation
  • Multiple Inheritance

We’ll also see examples of each method in practice. By the end of this post we should have a good grasp on the various ways we can use Qt Designer to create and integrate designer forms into a larger application.

Read More

Threading In Qt 4

In this quick post we’ll take a look at Qt’s elegant and simple QFuture, QtConcurrentRun, and QFutureWatcher interfaces. Using these classes allows us to consume a QThreadPool thread for a specific function.

This is handy for many operations, and while simplistic in that we’re not synchronizing data, still has many uses, from processing large blocks of images to streaming chunks of data.

In this post we’ll check out some sample code for implementing QFuture.

Read More