[PATCH] Reformat statistics tab in MainTab tab widget
Dirk Hohndel
dirk at hohndel.org
Tue May 7 06:53:47 PDT 2013
On Tue, 2013-05-07 at 07:24 +0100, Amit Chaudhuri wrote:
> Maybe not always better but some times useful....
Yes, hand coding things can often be useful. But in many cases that's
outweighed by the ease of using a good tool. I never could see an
advantage when using Glade for Gtk - believe me, I tried two or three
times and always went back to hand-coding the widgets.
But what I've seen so far from designer is actually quite nice. There
may be better tools out there (I've played with XCode on the Mac a bit)
but this is a really really decent tool.
And it has allowed us to very rapidly get to an impressive state of the
UI. So unless there are /really/good/reasons/ I would like to keep using
it.
> If you look at the output in a ui_*.h file it is a bunch of C++. The
> other technique is to just write that stuff direct. It assumes you
> are fairly fluent in Qt-dialog-speak but can conveniently give some
> additional control and/or allow you to use coding techniques which
> designer can't use.
> Example might be the info page of the tab widget. Instead of
> individually specifying the various calls to clear and maybe missing
> one...
>
> ui->sacText->setText(QString());
>
> ..it is possible to write a loop which runs through all widgets on the
> page and calls setText() if the widget is a QLabel and the object name
> contains a certain phrase.
That's an interesting thought. On the other hand it would be trivial to
auto-generate such a clear function with a bit of perl (or sed/awk, if
you must) applied to the .ui file.
This could even be done once (or after every change that creates a new
Widget) so that the tooling could be Linux-only and the generated files
are checked into git...
/D
More information about the subsurface
mailing list