[Interest] I love QML

Till Oliver Knoll till.oliver.knoll at gmail.com
Wed Jul 8 08:09:18 CEST 2020


Am 03.07.20 um 17:46 schrieb joao morgado via Interest:
> When I started using Qt I never touched WIndows MFC again.

Ha! But you actually /did/ touch MFC then ;)

Here's another fan story (even though I am - unfortunately - not working
professionally with Qt for a very long time)...

Back in the days(tm), near the end of my computer science education, I
was so ready to write "real applications". You know, proper GUI, Windows
2000, games, ... enough with "silly Oberon", enough with "command line
exercises" written in C, enough with ugly Motif/C++ feature
extensions... I was ready for the real world!

So I bought a book "GoTo Visual C++ 6" with a "comprehensive
introduction to MFC", shortly around the time before my diploma work
started. I don't know how many hours (possibly days, to be fair ;)) I
had this book in my hands, but the very moment I came across "macro
programming" as in:

  BEGIN_MESSAGE_MAP(...)

    ON_COMMAND(ID_APP_ABOUT, ...)

    // Don't change this generated code!

    ...

  END_MESSAGE_MAP()

or "gems" like

  ON_BN_CLICKED(IDD_BUTTON_0, OnNumber)
  ...
  item.mask = LVIF_TEXT | LVIF_IMAGE;
  ...
  item.pszText = (LPSTR)&fd.cFileName;

I immediately knew: this is not it! I wasn't sure whether I should stick
a needle through the book or burn it entirely... but don't touch that!
(The above code snippets come straight from that book, which is proof
that it still exists - I couldn't make up such evil stuff myself ;))


Having some first experience with Linux and KDE 1.x I had heard about a
thing called Qt (which was at version 2.x at the time, IIRC). My diploma
work in 2001 was about developing a "3d paint editor"
(www.pointshop3.com, for the interested) based on an existing
"point-based software renderer", which was... of course written in C and
MFC - yikes! So my first suggestion to the PhD student who was
overseeing my work was to rip away everything that spelled "MFC", make
it compile with a C++ compiler and use Qt instead. "Go ahead, son. But
if you run into trouble you're on your own!"

Turned out that my decision to use Qt (of which I only knew so little,
but had browsed its excellent documentation, which already convinced me
that I could pull it off - and of course the nice "Java-like" syntax of
its API) was worth pure gold. After just two weeks or so I had the
existing 3D "point-based renderer" compiling and running within a basic
Qt application, with a main window and menu - yesss!

After exact four months I had a "3d paint editor" with selectable
brushes, "gauss texture filtering", a software and OpenGL renderer
(switchable at runtime), and all extendable with plugins. Hadn't it be
for Qt, its excellent API and especially the documentation and examples
I wouldn't have come that far, in so little time!

The application was later ported to Qt 3 by others and made runnable on
Linux as well (I developed it mainly on Windows at the time), and was
extended with some plugins "all over the world" (well, from some
universities in France and Holland at least ;))


Lessons learned: a clean API and a great documentation with examples is
what makes a great toolkit! And of course its functionality ;)

Hooray for Qt! :)


Cheers, Oliver


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200708/9ff48244/attachment.html>


More information about the Interest mailing list