voidynullness

(mis)adventures in software development...

21 June 2013    Python

Subclassing QTableWidget into submission

Python example of subclassing a Qt QTableWidget control and overriding copy behavior so that the entire selected row is copied to the clipboard, and stored in a Excel-friendly format for proper pasting.

Hello there QTableWidget, you look like just the sort of Qt control I’m looking for. I want to stick some data into you. But once the data is inside you, I might want to do other things. Like perhaps copy and paste rows of data into Excel …

Read more...



12 April 2013    Python

I’ll write a script instead…

A Python script to convert date fields in a CSV file from MM/DD/YYYY to DD/MM/YYYY format — because Excel wouldn’t do it properly!

I imagine there must be many jobs, especially in and around the finance industry, where using Excel is part of daily life. I feel sorry for those people.

I find myself using spreadsheets quite a bit lately, and it’s often a frustrating experience. There’s a lot of annoyingly repetitive pointing and …

Read more...


05 February 2013    Python

Populate a Qt combo box from a database table in PyQt

Python example of using QSqlTableModel to link a database table to a QComboBox control.

Qt provides some useful mappers for easily linking relational database tables with table/grid widgets. This works well for quickly producing simple CRUD applications. But sometimes we might want to escape the limitations of table and grid controls, and do something fancier — something to provide users with a more customised, fine-grained interface, which usually ends up being something based on forms/dialogs. So we design a form, populate it with controls, and we are then faced with having to populate …

Read more...


24 January 2013    Python

PyQt database driver loading issues on Windows after installing PySide

Had a Windows machine with a perfectly fine and functioning development setup of ActiveState Python 2.7, QT SDK, and PyQt bindings. Then decided to install PySide. What could possibly go wrong?

There’s always something…

After installing PySide, none of my PyQt SQLite database applications would work anymore (while still using the PyQt bindings). Not even the example programs. I would get a “Driver not loaded” error when trying to initialise the database. However, the PySide database examples ran …

Read more...


17 October 2012    Linux

Installing NX Client on Linux

So you wanna remotely access a Linux box? From a Windows machine? The Nomachine NX Client looks like a reasonable option.

To install on a 64-bit (Ubuntu-based) Linux, first download the NX Free Edition for Linux. You should end up with something like the following deb packages:

nxclient_3.5.0-7_amd64.deb
nxnode_3.5.0-9_amd64.deb
nxserver_3.5.0-11_amd64.deb

Then:

sudo chmod 755 /usr/lib/cups/backend/ipp
sudo dpkg -i nxclient_3.5.0-7_amd64.deb
sudo dpkg -i nxnode_3.5 …

Read more...


Home   Top