MW

Tag qt

Recent Posts

KDevelop 5.0 Beta 2 and 4.7.3 Releases! (February 01, 2016)

Hey all!

I have the pleasure to announce the releases of two new KDevelop versions:

On one hand, there is the new and shiny KDevelop 5.0 Beta 2 release, which brings us much closer to a final release. Tons of issues have been resolved, many features got polished, and even our UI cleaned up a bit here and there. And did I mention impoved OS X and Windows support? See here for more:

https://www.kdevelop.org/news/kdevelop-50-beta2-release

Besides this new beta release, which is where most of our effort went into, I am also happy to announce KDevelop 4.7.3, a new bugfix release of our latest stable KDE 4 based KDevelop. Several annoying problems are resolved now, see the announcement for more information:

https://www.kdevelop.org/news/kdevelop-473-release

Many thanks to everyone involved!

Cheers

continue reading...

Akademy 2014 - Come to my Profiling 101 Workshop! (February 12, 2015)

Hello all!

I have the pleasure to attend Akademy this year again. From my past experience, I’m really looking forward to have a good time again. Lots of hacking, meeting known and unknown faces, drinking beer and socializing ahead! I also love that it’s in a (to me) new country again, and wonder what I will see of the Czech Republic and Brno!

This year, the conference schedule is a bit different from the past years. Not only do we have the usual two days packed with interesting talks and keynotes. No - this year there will also be workshops on the third day! These are more in-depth talks which hopefully teach the audience some new skills, be it QML, mobile development, testing, or … profiling :) Your’s truly has the honor to hold a one-hour Profiling 101 workshop.

continue reading...

Qt: Tint alphatransparent PNG (September 21, 2011)

Let’s assume you want to display the logo of your company in your Qt app. Most probably that logo has just single color with an alpha channel.But: Having the color hard coded in the image is not nice, there are users (like me!) out there, who use a custom (dark!) color scheme. Meaning: If your logo is black/dark and assumes a bright background and you just embed it blindly in your app, I probably won’t see it since the background will be dark in my case.

Here is a solution for the simple case of a mono-colored PNG with an alpha channel which I came up with:

      QLabel* label = new QLabel;
      // load your image
      QImage img(QString("..."));
      // morph it into a grayscale image
      img = img.alphaChannel();
      // the new color we want the logo to have
      QColor foreground = label->palette().foreground().color();
      // now replace the colors in the image
      for(int i = 0; i < img.colorCount(); ++i) {
        foreground.setAlpha(qGray(img.color(i)));
        img.setColor(i, foreground.rgba());
      }
      // display the new logo
      label->setPixmap(QPixmap::fromImage(img));
      label->show();

continue reading...

Should all callgrind bottlenecks be optimized? (December 10, 2010)

Hey all,

I’d like to have some feedback from you. Consider this code:

    #include <iostream>
    #include <memory.h>
     
    using namespace std;
     
    struct List {
        List(int size) {
            begin = new int[size];
            memset(begin, 0, size);
            end = begin + size;
        }
        ~List() {
            delete[] begin;
        }
        int at(int i) const {
            return begin[i];
        }
        int size() const {
    //         std::cout << "size called" << std::endl;
            return end - begin;
        }
        int& operator[](int i) {
            return begin[i];
        }
     
    private:
        int* begin;
        int* end;
    };
     
    int main() {
        const int s = 1000000;
        for (int reps = 0; reps < 1000; ++reps) {
            List l(s);
            List l2(s);
            // version 1
            for ( int i = 0; i < l.size(); ++i ) {
            // version 2
    //         for ( int i = 0, c = l.size(); i < c; ++i ) {
                l2[i] = l.at(i);;
            }
        }
        return 0;
    }

continue reading...

Spotlight: linux-minidisc (January 01, 2010)

Hi there!

Today I want to abuse the fact, that my blog is aggregated on some planets, to bring a project of a friend of mine into the spotlight:

The Linux-Minidisc project

It’s a project to bring Read/Write access on mini discs to Linux. It consists of a CLI and a Qt Gui. All code is licensed under the GPL and can be accessed via Git.

To get a nice introduction about the project, read this excerpt from a recent Linux Journal edition: http://users.physik.fu-berlin.de/~glaubitz/minidisclj.pdf

The project itself has a wiki under the following address: https://wiki.physik.fu-berlin.de/linux-minidisc/doku.php

As every other FOSS project, Adrian and his fellow developers need more man power. Especially someone who can spruce up the Qt GUI is needed. Help them!

continue reading...

Dear Lazy Web: Hackable Mobile Phone with good Music Player? (July 06, 2009)

Hey all, I need your help:

I lost my Ipod and now have to live without music on the road… Sucks pretty much, I can’t live without music…

Since my current mobile phone is pretty shabby I thought about fixing both in one go: Buy a mobile phone which could replace my Ipod as well!

Now lets first say what I need most:

  • should’nt be too expensive: A new Ipod with 120gb costs only ~200€. So even though I hate that device, I doubt I’ll pay like twice the sum just to get something different…
  • It needs a “Klinke” stereo output, i.e. something where I can put my normal headphones in.
  • I need space for my music: My last Ipod (80Gb) was completly full… Ok, I think I can make a few cuts, though 8gb only is not enough. Hence the phone should support hot-swapping of SDHC cards at least.
  • If I buy such an expensive device, I’d like to be able to write my own software for it, or put existing software on it.

What I found is the Nokia 5800 express music. It costs like ~260€. 16Gb more space costs like ~45€… It has stereo output and SDHC support. But what I don’t know: Where will custom software be saved on? Also on the SDHC? That would make hot- swapping kind of pointless…

continue reading...

PHP support for KDevelop 4 (and eventually Quanta+) (March 03, 2009)

Hello Planet KDE!

I want to give you a little insight on the current state of PHP support in KDevelop4:

Me and Nikolaus Sams (nsams) are working diligently on a plugin for PHP support in playground. It’s somewhat stable, i.e. we fix any crashes we stumble upon, but I would call it Alpha state at most. It may eat your babies so to speak. Yet I’m happy to say that at least one user is already using it for production (hi leinir ;-) ).

implemented PHP support

Well, here’s a (not complete) list of features that are already working. Though I have to warn you: no screenshots included ;-) It’s actually all very similar to the C++ screenies you can see on the web.

sematic highlighting

Let’s start with a feature that only very recently was added for PHP - semantic highlighting. Niko moved some language independent parts of the C++ plugin from KDevelop to KDevplatform and now PHP has the same code highlighting features as C++.

continue reading...

Patching Kirocker Music Display for volume control via mouse scrolling (March 28, 2008)

Kirocker is such a great application, it’s a pity the developer Sébastien Laoût has given up on it and is using Windows now!

Usually I only use the kicker applet, the full screen window is nice for parties though. But I didn’t like the way the applet handles scroll events: It seeks (if possible). Since I rarely seek when listening to music I’d rather have the behaviour of the Amarok tray icon: volume control!

I had a look inside the sources and found this part in src/coverdisplay.cpp:

    void CoverDisplay::wheelEvent(QWheelEvent *event)
    {
        if (areControlsShown()) {
          if (event->orientation() == Qt::Vertical) {
             PlayerInformation *infos = PlayerInformation::instance();
              if (infos->canSeek()) {
                 int deltaSeconds = 10 * (event->delta() > 0 ? 1 : -1);
                   m_infos->seekRelative(deltaSeconds);
                }
          } else {
               if (event->delta() > 0)
                  AmarokApi::volumeUp();
             else
                   AmarokApi::volumeDown();
           }
      }
    }

continue reading...

Opera 9.50 beta (September 04, 2007)

Opera released their first 9.5 Alpha today, nicknamed Kestrel. Usually I don’t use Opera, I use Firefox for webdevelopment with Firebug and similar tools but it’s pretty slow even on my fast new machine. For my everyday browsing I use Konqueror for it’s neat desktop integration (read ASpell, KWallet, Kio, Filebrowser etc.). And compared to Firefox Konqueror is fast.

But Opera… Well I knew it was fast but in their release note they mentioned even more speed improvements, also for ECMA Script (JavaScript). So I thought, lets give it a try and I have to say I’m pretty much flabbergasted. It feals like it’s more than double as fast as Konqueror! I really might start to use Opera more frequently now… Let’s see what else they got except speed!

Also very interesting is this part of the release note:

Platform integration

We worked to make Kestrel feel even more integrated with your platform. Mac users can expect a nice new visual look and feel, while Opera for Linux will add a QT4 build, so you can easily adjust your skin to match the desktop. 64-bit Linux/FreeBSD packages will also be available.

continue reading...