Archive for category Programing

Compressing – Decompressing web GZIP stream

Compressing and decompressing is one of the essential task when dealing with the web oriented programming. Qt allow to manipulate compressed data stream using qUncompress/qCompress functions, but they are problematic and don’t really helps much. From my experience, with these functions, it’s practically impossible to decompress gzip stream (although I can be wrong on this one, and maybe there is a way – never say never) . Read the rest of this entry »

, , , , ,

No Comments

QtThreads are not scary! – part 1 – How not to write It

From my experience QThread class can be somewhat confusing to use. Mostly due to how they work, not because they are hard, so here is a short explanation what and how to use threads in qT.
In the first place why to use threads? Threads are useful for heavy duty or computation expensive tasks that cause GUI to freeze. In example video compression takes a long time and is very CPU intensive. If that task is run on the same thread as you main GUI, in main application thread, program don’t receive events and operating system mark it as non responsive. Of course, if application is well written, after video compression GUI “unfreeze” and program works fine after that. This behaviour is not expected, because user don’t rally know if program works correctly or not. Read the rest of this entry »

, , , , ,

No Comments

Static qT compilation and mingwm10.dll (MinGW) confusion.

After some reading, on the web, about MinGW compiler It comes to my attention that using static qT build without mingwm10.dll could cause memory leeks. That’s due to specific job that mingwm10 perform, with is catch dying threads and clean up data after them and handle exception in code. This is probably the reason, why by default, MinGW links that library in the first place. Read the rest of this entry »

, , , , ,

No Comments

[qT] Remove items from model and list

Removing items from views can be somewhat troublesome. Not because it is hard, but because the idea behind it is part of more wide subject, with is MVC (Model View Controller). It nutshell Model is something like database, that store all the information that can be later displayed by Views. View is visual representation of model, it can be i.e. ListView, TableView, or ListWidgetView and so on. Read the rest of this entry »

, , , ,

No Comments

qt static , mingwm10.dll and deployment under windows environment

After spending countless hours creating functions, algorithms and design, You application finally is done. And what now? At this point important decision must be made. Do I deploy it using Qt dynamic or static library? Under Window environment it’s unusual to redistribute application with “many dll’s” (at least with many Qt libs). In that case linking it dynamically is pointless. Another choice is to build, and link it against, Qt statically. In some cases it can be really pain in an … Read the rest of this entry »

, , , , , ,

No Comments

QtDesigner and qGLWidget

Creating OpenGL application in Qt can be sometimes really painful. Especially when you need to design additional widgets into main form along with qGLWidget. Of course it all can be done by typing ‘by hand’ all positions, sizes and properties, but it takes a lot of time.
Qt offers a really handful application called qtDesigner. It’s additional module with support programmers in creating GUI. But it doesn’t offer qGLWidget, so basically you cant place it onto a form within Designer. Read the rest of this entry »

, , ,

No Comments

Simple but effective bash script [network adapters]

In some cases, where for example particular sets of commands is frequently used, really handy “tool” to simplify life can be used. I talk here about bash scripting.

What script does? To put it simple, scripts allows to write a sets of command in “specific way” that will be interpreted by shell (in this case “/bin/bash”). These scripts can perform from simple task like rm’ing temp files to really advanced stuff, only limitation here is a imagination and programing skills.

Below is my sample script that I use to manage my network connections. I wrote it because I have a need to change my network settings depending on my location or ‘particular needs’ and doing it by hand can be frustrating and simply takes too long. Script is fairly simple yet effective. Read the rest of this entry »

, , ,

No Comments