Quote Originally Posted by wysota View Post
No, this is not a workaround - this is a general way of doing things based on object names.
And I think this is a terrible hack like way. I some sense you do hand coding within the designer. You have to think of a naming scheme. You have to use regexp to use it. Your naming scheme can easily break, when you layout changes too much.

Quote Originally Posted by wysota View Post
Remember that a button group doesn't have anything to do with the layout of objects, so you can't put a QButtonGroup object on a form and assign buttons as children to it.
Please don't take me literally. And please be a bit more observant when I use examples, e.g. when I try to explain a possible feature in terms of already exiting ones.

And I can very well put a QButtonGroup on a form. At least in theory, it is just not implemented. It could be implemented as dropping a rectangle on the form, giving it a name, dropping buttons in it. Later on the uic compiler creates a QButtonGroup which is populated with the buttons I dropped in. There is no universal law that the designer can handle only layouts.


Btw. my idea of a designer meta object consists of several parts. The first part is not that different from that what you are doing. It could even be implemented using the object name (though I would not do so). You create an meta object tree just like you create a layout tree (Attention Example, it is not a layout. It is just used the same way by dropping boxes in boxes.). You drop your widgets in those meta object boxes, name those boxes, and this way your object names are created automatically in a well defined naming schema.
This would be cramming all meta information in this single string. Ugly, but possible.


Quote Originally Posted by wysota View Post
But what is the point of "grouping meta information of objects"? Would you like to use them in Designer or in the hand coded class making use of an ui file? I can imagine having a separate mode for Designer for such things but I don't see any benefit for a larger group of people (which is the only thing capable of making Trolls implement this).
This would be the second part of my idea. I would use them outside the designer. You create a naming schema manually and parse them in the subclassed object, e.g. you create a QButtonGroup, search all children of the ui class for a certain name to add it to the button group. Finally you then can pass a pointer of the button group to the object, which actually handles the buttons. Next you search for other parts in the ui class, dispatch gui parts to the correct handler, etc.

As I said, this is ugly, you have to remember your naming schema and if it changes, your regexps might have to change, too. Furthermore you enter your object names manually, which is error prone. One typo and the debugging starts.

With my idea you generate your object names (or other meta info) graphically. Effectively grouping your objects, e.g. you create a meta box and give it the name 'page_1' in this box you drop a second meta box and give it the name 'group_1'. Now you drop a button in the second box and it is automatically named page_1.group_1.button_1. No, this has nothing to do with layout. I just uses the same user interface to create a tree.

This is something you could do manually. The way you do it, you now would create some loops, some regexps, which parse the object names.

I'd like to have an auto generated query method where I can ask 'contains("page_1"). If the answer is true, I'd like to have a method

"QDesignerObject *getDesignerObect("page_1")",

This returned QDesignerObject should contain references to group_1 + all children + meta information. Now I can pass this object, which encapsulates a small logical part of the whole gui to a client class, which handles the stuff inside this object, e.g. group_1 and its buttons.