Showing posts with label qt. Show all posts
Showing posts with label qt. Show all posts

Friday, June 29, 2012

Why I might move away from Qt

To begin with I loved Qt, and I still do for some projects. However, things have changed a lot the last 5 years in the tech industry, and Qt has fallen a bit off the grid after Nokia took charge.

Key points why I am reluctant in using Qt on future projects:

  • Android
  • iOS
  • Windows RT
  • Windows Phone
  • Still struggling to support meego, and symbian. Big waste of resources!

I think that should be quite self-explanatory, but let me dig a bit deeper.

At one point Qt was on the cutting edge of new platforms, then symbian and meego wanted to join in. I knew already than that it meant trouble, because both were already dying platforms. 

I've been using Qt successfully on quite a number of projects over the last 7-8 years, and it has been a pleasure.

Now I don't know if my next few projects will be Qt based at all, even though they will be both mobile and desktop applications.

Qt can support XP/Win7/Win8 Desktop and OS X, but not metro style WinRT (MS ARM based tablets). Qt cannot help me with mobile so I need a different framework here.

So I started looking this way. How many frameworks do I need to write the same software for iOS, Android, OS X, Win XP, Win 7, Win 8 and Win RT ?

I hoped to keep the number down to three, and with Qt, it still might be possible. But there are other frameworks lurking around as well now. 

Example: Mono/.NET:

I can use C# and write common code for all platforms that have Mono or .NET.
Well. All platforms both mobile and desktop has either .NET or Mono. I have to write the GUI for Desktop (OS X, Win XP/7/8) as one, mobile needs one for iOS and one for Android. I would actually have 1 "base" code and 3 derative guis on top. That is managable.

Example: Qt:

I can use C++ to write common objects for both mobile and desktop using STL. The GUI for OS X, Win XP/7/8 can be written in Qt, while the desktop for WinRT have to be written in C++/XAML. Android and iOS need a separate framework.

By choosing Qt, I end up having a C++ base and at least 4 gui implementations in various languages? It's almost doomed to fail. By choosing .NET/Mono I can have 3 gui implementations that actually use parts of each others code, so I save 1 framework/gui implementation. If that is 1 month of work, it's worth using a different framework.

I hope that Qt and the Trolls will open their eyes and make all non-gui parts of Qt compatible with more platforms. It's impossible to have the same GUI code for all the platforms we have today. Even thought it's possible, it will feel "Qt" on top of a native GUI, which isn't really user friendly...

Friday, March 26, 2010

Styling QWebKit scrollbars

I read some people had problems styling the scrollbars in QWebkit. It's quite simple, if you think of them as CSS (with webkit specific parameters) instead of Qt Scrollbars. Ideally it should be a stylesheet mapping between QStyleSheet and a css, so that it would automatically do the magic.

You need to implement this CSS in all the documents loaded. You can do this modifying the DOM for the document you load. If you are to provide static content, I would recommend putting the CSS into the content instead, as that is easier to modify later.

Here's a small example on how to style the scrollbars:
::-webkit-scrollbar {
    width: 42px;
}

::-webkit-scrollbar-track-piece {
    background: #CCCCCC;
    border: 2px solid #6666CC;
   -webkit-border-radius: 10px;
    width:20px;
}
::-webkit-scrollbar-thumb:vertical {
    height: 40px;
    border: 2px solid #6666CC;
    background-color: #6666CC;
    -webkit-border-radius: 10px;
}

::-webkit-scrollbar-button:end:increment {
    height:42px;
    width:42px;
    background-image: url(arrow-down.png);
    background-repeat:no-repeat;
    background-color:white;
}
::-webkit-scrollbar-button:start:decrement 
{
    height:42px;
    width:42px;
    background-image: url(arrow-up.png);
    background-repeat:no-repeat;
    background-color:white;
}

::-webkit-scrollbar-button:end:increment:hover {
    background-color:green;
}
::-webkit-scrollbar-button:start:decrement:hover
{
    background-color:green;
}

:not(.none):not(.double-start)::-webkit-scrollbar-track-piece:vertical:end:single-button,
:not(.none):not(.double-start)::-webkit-scrollbar-track-piece:vertical:end:double-button,
.single::-webkit-scrollbar-track-piece:vertical:end,
.double-end::-webkit-scrollbar-track-piece:vertical:end,
.double-both::-webkit-scrollbar-track-piece:vertical:end 
{
    margin-bottom: 40px;
}

:not(.none):not(.double-end)::-webkit-scrollbar-track-piece:vertical:start:single-button,
:not(.none):not(.double-end)::-webkit-scrollbar-track-piece:vertical:start:double-button,
.single::-webkit-scrollbar-track-piece:vertical:start,
.double-start::-webkit-scrollbar-track-piece:vertical:start,
.double-both::-webkit-scrollbar-track-piece:vertical:start 
{
    margin-top: 40px;
}



This is just an example, and you probably want to change it a lot to suite your needs.