Category: Troubleshooting


Global hotkey

Let start by explaining the goal: we want to send a custom signal when the user press a combination of keys. Sound pretty easy, your are already thinking to override the keyPressEvent() and keyReleaseEvent() virtual methods of your QMainWindow with your custom code.
It’s a fair solution, but not the so elegant, and what’s happen if you have more than one QMainWindow instances or none at all?
View full article »

Google WebM is the new lossy encoder for images (and videos) which promise a better compression than the old and well known JPEG format. The source code is available anche can be build on Linux, Mac OS X and Windows as well.

Anyway, on Windows if you follow the instructions in the README you’ll ended up with this error message:

cwebp.obj : error LNK2019: unresolved external symbol _GUID_WICPixelFormat32bppRGBA referenced in function _ReadPictureWithWIC
output\release-static\x86\bin\cwebp.exe : fatal error LNK1120: 1 unresolved externalsNMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe"' : return code '0x460'
Stop.


View full article »

It’s very simple with the QtWebKit APIs to open an link with your default browser from a QWebView (you can find some solutions like this in StackOverflow about that) but that works well only with <a> elements. If you are opening an external browser by a window.open() JavaScript function you need a whole different approach.

View full article »

Some days ago I was writing a DLL’s wrapper in ctypes and I came across of this typedef in the header file:

typedef struct _FILEHandle *FILEHandle;

To translate this definition into ctypes is pretty straight-forward (if you already know the solution :-) ).
View full article »

With the new Mac OS X Lion out since a week I decided to upgrade my Mac Book Pro but at that time I didn’t know it will be a little long journey.

View full article »

To pass a Win32 window handler from a PySide object to a win32gui.GetDC() method is not so simple as with PyQt4 or wxPython.
View full article »


Why do recursive calls when you can do the same thing without it ? Use a recursive function makes the code clear but can be inefficient and soon or later you will hit the stack limit.

View full article »

Testing Qt code with the Python unittest module is simple as ever.

View full article »

One month ago I bought the new Samsung Galaxy S with a UK SIM card and a flat mobile Internet plan, which it’s a very good deal for who has an Android smartphone device. Unfortunately, when I come back to Italy and I switched the UK SIM with the italian one, I completely forgot to disable the data traffic and because of that I got a charge of €5 in a single day :-(

View full article »

Two weeks ago I bought the new Samsung Galaxy S smartphone and after a full day spent to make confidence with the Android OS one big question comes in my mind: will iTunes detect the phone and synchronize my music library ?

No :-)

View full article »