Category: kde

  • Randa day 0

    Sitting on Lake Zurich and reflecting over things was a great way to get started. http://manifesta.org/2015/11/pavillon-of-reflections-for-zurich-in-2016/

    After spending a bit of time in a train, I climbed part of a mountain together with Adriaan – up to the snow where I could throw a snowball at him. We also designed a couple of new frameworks on our climbing trip. Maybe they will be presented later.

  • So close, but so far away

  • Compilers and error messages

    So. I typo’ed up some template code the other day. And once again I learned the importance of using several c++ compilers.

    Here is a very reduced version of my code:

    And let’s start with the compiler I was testing with first.

    MSVC (2013 and 2015)

    It is not completely clear from that error message what’s going on, so let’s try some other compilers:

    GCC (4.9-5.3)

    That’s pretty clear. More compilers:

    Clang (3.3-3.7)

    ICC (13)

    (Yes. I mistyped the variable name used for decltype. Replacing the x with t makes it build).

    Thanks to http://gcc.godbolt.org/ and http://webcompiler.cloudapp.net/ for testing with various compilers.

  • KDE at Qt World Summit

    So. KDE has landed at Qt World Summit.

    kdeboothqtws2015

    You can come and visit our booth and …

    • hear about our amazing Free Qt Addons (KDE Frameworks)
    • stories about our development tools
    • meet some of our developers
    • Talk about KDE in general
    • Or just say hi!

    KDE – 19 years of Qt Experience.

  • Debconf 2015 – 6

    There is more people with blue hair at Debconf than at an average Akademy. KDE – we need to do better :)

  • Getting a Q_INVOKABLE C++ function reevaluated by QML engine

    Unfortunately, with all the normal magic of QML property bindings, getting a property updated in a setup that involves return values from functions isn’t really doable, like this:

    I’m told there is a low priority feature request for a way of signalling that a function now returns a different value and all properties using it should be reevaluated.

    I have so far discovered two different workarounds for that that I will be presenting here.

    Using an extra property

    Appending an extra property to trigger the reevaluation of the function is one way of doing it.

    with the following on the C++ side:

    This is a bit more code to write and to remember to use, but it does get the job done.

    Intermediate layer
    Another way is to inject an intermediate layer, an extra object, that has the function. It can even be simplified by having a pointer to itself.

    with the following on the C++ side:

    It seems a bit simpler for the reader on the QML side, but also gets the job done.

    I am not sure which way is the best one, but the intermediate layer has a nicer feeling to it when more complicated types are involved.

  • QImage and QPixmap in a Qt Quick item

    For reasons I don’t know, apparantly a Qt Quick Item that can show a QImage or a QPixmap is kind of missing. The current Image QML item only works with data that can be represented by a URL.

    So I wrote one that kind of works. Comments most welcome.

    It is found on git.kde.org: http://quickgit.kde.org/?p=scratch/sune/imageitem.git

    Oh, and the KDE End of Year fundraiser is still running. https://www.kde.org/fundraisers/yearend2014/. Go support it if you haven’t already.

  • Is linux about choice?

    Occasionally, various quotes from people having an opinion if linux is about choice or not. Even pages like http://www.islinuxaboutchoice.com/ has shown up.

    My short answer is “YES”. Linux is about choice. And you get all your choices directly from your f/loss definition of choice (FSF’s 4 freedoms / OSI’s opensource definition / Debian Free Software Guidelines)

    It doesn’t mean that you get all the gui configuration bits that you want. It doesn’t mean that you without any problems can switch out any component. But it does mean that you can get it exactly your way. But it might require you to edit some source code and compile some stuff.

  • KDE makes Qt

    Recently I was trying some statistics on the qtbase-module (where QtCore, QtGui, QtWidgets and so on lives) and was wondering who made them.
    Not based on their current paid affilation, like Thiago’s graphs, but if each commit was made by a person coming from KDE.

    So, I got hold of Thiago’s scripts, a lovely mix of perl and zsh, and a QtBase git repository. First steps was to try to classify people as person coming from KDE or not. Of course, I’m a KDE person. Thiago is a KDE person. David Faure is a KDE person. Olivier Goffart is a KDE person. Lars Knoll is a KDE person.

    By the help of the KDE accounts file, and some of the long time KDE contributors, I got after a half day of work a good list of it. Then next steps was trying to put it into Thiago’s perlscripts

    All of it kind of succeeded:

    qtbase-KDE.graph

    So, KDE people makes up for 40-60% of the weekly commits to QtBase. This is again shows that KDE is important to Qt, just as the reverse is. So, let’s keep KDE healthy.

    KDE is running a end-of-year fundraiser over here https://www.kde.org/fundraisers/yearend2014/. Go ahead and donate, and help KDE stay healthy. For your own sake. And for Qt’s.

  • Fun and joy with .bat files

    Occasionally, one gets in touch with kind of ‘foreign’ technologies and needs to get stuff working anyways.

    Recently, I had to do some various hacking with and around .bat files. Bat files are a kind of script files for Microsoft Windows.

    Calling external commands

    Imagine need to call some other command, let’s say git diff. So from a cmd thing, you would write

    similar to writing shell scripts on unixes. But there is a catch. If the thing you want to call is another bat-script, just calling it ensures it ‘replaces’ the current script and never returns. So you need

    if the command you want to run is a bat file and you want to return to your script.

    Calling an external helper next to your script
    If you for some reason needs to call some external helper placed next to your script, there is a helpful thing to do that as well. Imagine your helper is called helper.bat

    is the very self-explanatory way of doing that.

    Stopping execution of your script

    If you somehow encounter some condition in your script that requires you to stop your script, there is a command ‘exit’ handy. It even takes a argument for what error code there is.

    stops your script with return code 2. But it also have the nice added feature that if you do it in a script you run by hand in a terminal, it also exits the terminal.

    Luckily there is also a fix for that:

    and it doesn’t exit your interactive terminal, and it sets the %ERRORLEVEL% variable to the exit code.

    Fortunately, the fun doesn’t stop here.

    If the script is run non-interactively, exit /b doesn’t set the exit code for for example perl’s system() call. You need to use exit without /b for that. So now you need two scripts. one for “interactive” use that calls exit /b and a similar one using exit for use by other apps/scripts.

    Or, we can combine some of our knowledge and add a extra layer of indirection.

    • write your script for interactive use (with exit /b) and let’s call it script.bat
    • create a simple wrapper script
    • call the wrapper for non-interactive use

    and then success.

    Oh. and on a unrelated note. Windows can’t schedule tasks for users that aren’t logged in and don’t have a password set. The response “Access Denied” is the only clue given.