Re: Arrays With Designer?
the designer is only a tool for designing GUIs. You can't do this with designer. Why do you need it? You can get all push buttons later via qFindChild() or if you need an array for signal/slots normally a QSignalMapper is better than a list.
Re: Arrays With Designer?
Tell us what you are trying to do first, and we may be able to tell you an easier method.
Re: Arrays With Designer?
Hallo,
thanks for your answers!
I wrote a sudoku solver in C++ and now I'll try to give it a GUI. The solver works on an array of fields, each holding one number of a sudoku game. (Every field is an array by itself, so I have 3 dimensions.) My Problem is not, to write the GUI by hand. I look for a solution with QDesigner and I would like to include a 9x9 array of appropriate widgets in a QDesigner form.
Erich
Re: Arrays With Designer?
One way of doing that would be to drop an appropriate widget on the form (eg. a QLineEdit) and then using copy/paste to give 9 of that objects. Then you could copy those nine and paste 9 times to give you your 9x9 array. You can then easily place these into an array of pointers (to call there methods) as you'll know the names from what you type into the designer. To manage the signals, you can use a QSignalMapper which will inform you which widget the signal came from.
There are other ways, but thats the first way that comes to mind if you want to use designer. Doing it in code wouldn't be much more difficult - you would just create the objects dynamically.
Re: Arrays With Designer?
Many thanks for your answers!
I found an easy way by myself: I coded the array as a subclass (QFrame). Then I put a QFrame in the designer and used it as a placeholder for my own object. Now i have the array with propper indices (codet by hand) and the complete GUI in designer. It works!
Erich