On Mon, 15 Mar 2021 15:43:15 +0100 Stefan Hundhammer <shundhammer@suse.de> wrote:
On 2021-03-12 22:32, josef Reidinger wrote:
My previous experience was just with visual basic ( 20 years ago ) and netbeans one for swing ( 12 years ago )[1].
Back then, Visual Basic (or Visual C/C++) did not have any geometry management, so any dialogs had a fixed size, and all widgets ("controls" in MS lingo) had fixed sizes and positions. That's why it broke horribly if you needed to use a larger font, and you had to "make it big enough" to fit translated messages (no kidding, that was the original statement from MS when I asked that question on a "Windows NT for Unix programmers" workshop back in the late 90s).
It's trivial to create a GUI builder that can only do fixed sizes and positions for everything. But that's not what we need; we need real geometry management. Think about all our translations and how verbose some languages can be. Think about HiDPI vs. minimalistic screen resolutions. And I am not even mentioning NCurses.
I think it is time for me to refresh a bit memory with netbeans one as I remember that as very powerfull one that allows easy creation of flexible dialogs.
...
So I explore and play a bit with qt designer. ... So I create testing project and start. The output is ui file which is XML based, so quite easy to parse and hard to read for human.
...and the best part is that Qt comes with the "uic" (UI Compiler) preprocessor that can create C++ code from it that you can compile and link with your project. Not C++ code that you are supposed to edit; just C++ code that you can embed into your own C++ classes.
That is not the best part for me as I would like to use it from ruby or any high level language. Writting frontend application in C++ is a bit 2000s and probably won't attract much people. BTW when I google for that wysiwyg it looks like a lot of people use combination of qt designer + pyqt.
I have tons of examples here:
https://github.com/shundhammer/qdirstat/tree/master/src
Look at the *.ui files.
I will check it.
But looks quite promising for us to parse it and e.g. try to show ncurses equivalent.
Good luck with that.
Widgets in XML has its id, so it should be easy to connect widgets with actions in programming language as for us the direct connect in designer does not make much sense and I do not like it much. I think that GUI layout should be in WYSIWYG, but connection to data model should be in code.
I try layouts available and I am not sure if it is limitation of designer or qt, but all layouts are quite trivial
No; you didn't look hard enough. There is the QVBoxLayout / QHBoxLayout which is pretty much the same as our VBox and HBox, there is QSplitter that has that movable border, there is QGridLayout that is very much like a HTML table and which I had suggested to add to libyui a year or two ago (which was rejected as "we don't need that" by the team).
But to make it really work nicely, you always have to set a QSizePolicy for every widget to specify its resize behaviour, including its initial size; and our 20 years of experience with our libyui shows that normal application developers mostly don't grasp even the simple cases (hstretchable, vstretchable; weights). I have little hope that it will work better with considerably more complex concept like QSizePolicy.
Well, I expect that editor do it for me or at least guide me. My goal is to really have UI design created by designers and not programmators and if some parameter is mandatory I expect designer emphasize it enough.
and nothing like Spring Layout[2] in Netbeans which allows to specify constrains on widgets like align left side to center of this widget and have right side align with left of different widget.
You add a QLayoutStretch.
Yes, you can always work around it, but as I said it is about power of designer. It is different to just drag right border and snap it to some line ( like e.g. powerpoint do ) or finding some special purpose virtual widget that you needs to place to proper place. So usability of designer.
Situation with layouts was even worse for me and I failed to create design that works well with resizing of window ( maybe issue was that I use MainDialog as base? ).
No, you didn't set the right QSizePolicy; see above.
Probably issue on my side, but it says something about usability of designer. Nice feature is also builtin tooltips and translations, but I worry how easy will be to use gettext for translations instead of qt built-in localization.
That's the trivial side. I worry more about the sheer amount of texts vs. broken English.
I am not sure if I get it. So you think that bigger problem is that we have a lot of new text in tooltips that will contain broken english?
There are some widgets that are currently not supported by libyui.
What I like in designer is clear separation of input and display widgets. So it is clear which ones are for displaying info and which should be used for getting data.
You mean how they are arranged in the Qt Designer toolbox; which has nothing to do with what you can use them for.
Yeah, I am trying mostly designer and how it helps me with creating dialog. I do not dig into qt.
I try to design more complex menu with submenus and it works nicely in designer.
Overall qt designer for me is comparable to visual basic experience 20 years ago and still not so nice experience as netbeans designer 12 years ago.
Clearly, you have seen only the tip of the iceberg. ;-)
Having actively used Qt Designer in my QDirStat and having given quite a number of one-week-long Qt trainings during my time as a Qt consultant I can tell you that Qt designer is as good as it gets without nailing down everything to fixed coordinates and sizes. I like it a lot.
But it's not a trivial tool, and it does not turn everybody into an instant GUI expert. Its major advantage is to avoid tons of boilerplate code that you otherwise have to write; code that is repetitive, error-prone and hard to maintain.
yeah, I as user of designer compare mostly usability of it and not its power. Maybe it sounds familiar for yast developers. Lots of hidden features and you can do anything for it, you just need weeks long training to use it properly.
What we do in libyui is not only the abstraction from NCurses; it's also the abstraction from the gory details of complex toolkits like Qt that allow to do just about everything, but you still need a lot of expertise to actually use it. Libyui does much of that stuff for you, if you only let it.
And this is what I hope from Designer tool. That it hides a lot of details for me and I just design nice dialog with widgets and then connects somehow that widgets to data in my program.
But if you put it into yet another wrapper like CWM, application developers have a hard time to make use of libyui because CMW, like all wrappers, loses some information between the wrapped layer and the application (plus you need to have intimate knowledge of CWM because you need to know WHAT method to overwrite on WHAT layer and how; the documentation leaves a lot of questions open).
It is a bit different topic, but feel free to open github issue where documentation is not clear and leaves open questions.
Use libyui the way it was intended to be used, and it will become considerably easier.
Sadly this does not help with my main goal. WYSIWYG dialog editor that allows anyone to play with how dialog looks like. Something like if Ken wants to change dialog to have less spacing there and different arrangement elsewhere like feature we get in few weeks ago from him.
Read the "layout how-to" document and look at the examples, and it will become even easier.
Wrap it into CWM, and everything becomes arcane Voodoo.
Keep wrapping dialog parts into more and more unneeded widgets, and the side effects will take over, and you will lose control of what is happening. I see that a lot in our dialogs.
Maybe we should analyse why it happens. E.g. see my email few weeks ago about something trivial as box that is on center and its content center alignment. I failed to do it trivially and needs a lot of additional widgets to achieve it. And seeing our code it looks like I am not the only one that have hard time to do layout how he wants. Still my target was to try WYSIWYG editors like if I am designer that wants to arrange dialog without touching any code and knowing much about qt and I fail for qt designer (sadly). But of course we can try to ask someone from UX team if he wants to try it.
I could go on more, but this is a good point to stop this.
Kind regards
Josef