Qt

proCreator: another helper for legacy Qt-projects

Written by  on October 21, 2017

Ok, today at work I ran into the problem that for a Qt-project we have the code, the binaries and an awkward buildsystem (mpc). But I don’t want to process first the mpc and then fire up Visual Studio and wait for hours until the whole solution has been build. I want to use QtCreator! <3 So, there was never a real pro-file. The project consists of about ten classes, some forms and one ressource-file. Not much, possible to tinker it manually into a self-generated pro-file. Which can be processed then by QtCreator or qmake. (Hint "ls -X" is helpful for sorting by filetype.) But: why not delegate this to a small tool? First I thought about bash, then ... "maybe something better, like Python" ... and then ... why not Qt itself? So, please have a look at https://github.com/marcelpetrick/proCreator, which is half-way done. Outputting works. Just input-grabbing has to be implemented. Should be ready by sunday 🙂

Will keep you updated.

Qt: find the sender (aka: invoking signal) for a slot

Written by  on August 27, 2017

Sometimes several signals lead to one single slot. Without any parameter. So you are stuck and can’t find out who was the ‘caller’.
But wait, there is a nasty hack to find it for those which are direct connections.

QtScrobbler (final cut)

Written by  on October 22, 2015

Just to close the topic: I finished what I planned for the forked QtScrobbler-project. I changed the workflow, so that if you did not provide correct credentials for your favourite submission-site (last.fm, libre.fm ..), then the progress-dialog will be closed and you will see immediately the error in the ui (not just log). Because before the user could wait until the cows come home – and I found this really annoying, especially when I set up QtScrobbler on a new system, mistyped or forgot to set the credentials at all.
Besides: also cleaned the code a little bit with the help of cppcheck 😉

The repository: https://github.com/marcelpetrick/QTScrobbler

All in all it was a nice experience: set up GitHub, clone the repository, work into a medium large project, try to fix an error without breaking the remaining functionality ..
I do not fully agree to the original code of conduct for style and includes. But as long as it is comprehensive ..

My first (?) offical fork?

Written by  on October 2, 2015

I want to fix several smaller, but annoying issues with QtScrobbler. Originally hosted on sourceforge, but development was discontinued in 2013. I mean: it worked. I used it for years with my upgraded SANSA clips.
So I forked the project to github, upgraded the whole project to the current Qt-version (5.5) and fixed immediately some ‘klein-klein’. But now I am too tired …

Qt: normalized signal-slot-connections

Written by  on July 13, 2015

While writing my last post I remembered a tool I run at least once for every project I touch (do, finish, ..): ‘normalize’.
Originally I stumbled about it while reading Marc Mutz’ blog. The downside is: currently the original download-location is not available anymore .. I will try to fix this.

The effect behind normalised signal-slot-connections is that for the whole project every connect will use the same style. No additional whitespace, no const, no unneeded variable-names, .. perfect.
Invoke it with “normalize –modify PROJECTPATH”. Without the flag it will just show the “to be changed sections”.
Never seen any downside effects.

edit: Working download-URL added!

Qt: find the libs (Linux)

Written by  on June 26, 2015

I let synaptic install the libs, the qt-creator, the other stuff and their dependencies. Upon creating my first project I noticed NO kit was configured. Compiler was doable, but what about the libs? Tried this:

part II: Remove multiple whitespace-lines from a file

Written by  on May 7, 2015

I was so annoyed that the simple idea with sed did not worked like I wanted, that I wrote a short full-fledged Qt-appp for it. Code follows. Just compile the main.cpp. Usage is also explained in the header of the file.
I know it’s like to break a butterfly on a wheel, but I need this functionality since I don’t want to do such a boring task like code-styling by myself ..

Update: first version had a small glitch! Found after applying it to some bigger files.

Replace the Sansa Clip (Clip+ or Clip Zip) firmware to make it scrobbleable

Written by  on May 3, 2015

Work of 5 min (?)
Maybe even less if you know how to handle a mouse, the keyboard and a browser … 😉

First step is to exchange the firmware with Rockbox. A very good OSS mp3-player software for several different device kinds which enhances the hardware. You can even play Doom on your player!

  • set the device to MSC-mode (MTP or Auto does not work)
  • get the firmware for you device: Firmware thread at the Sansa-forums
  • get and run the rockbox-installer
  • select device and mount-point; pick the firmware-binary; select your options (bootloader and firmware yes; no games, no themes, no fonts …): “finish”, doneScreen Shot 2015-04-21 at 10.09.09

The second step is to enable scrobbling:

  • got to your players settings (after restarting it and select “Settings > Playback Settings > last.fm log” with “enable”)

Play some tunes and afterwards connect you device to the PC and run QTScrobbler (note: Qt not QT! We are not in a hurry ;))

Qt Linguist: Extract all new strings

Written by  on April 30, 2015

Task to achieve is: get all the new strings from the project, but the target user does not want to use Qt Linguist!

0. run lupdate (like always)
1. run

useless data pt. II

Written by  on March 28, 2015

If you ever wondered how many times you compiled your project {today, the last week, ..} and got no answer: here is a clue.
Add the command “date >> someTextFile.txt” as custom command to QtCreator as build step before make is executed.
This will insert everytime you compile a new line with the current time into a textfile. Processing that data is your own task.
Small hint: if you are lazy and just want some alltime-stats use “wc compileDates.txt” 😉

compileRuns

Edit 20150407:
If you are just interested in the date, use this: