comp.lang.ada
 help / color / mirror / Atom feed
* How to create qlabels for a table via loop? (QtAda 3.2/GPS 2014 - Beginners question)
@ 2014-07-05  2:01 ironshirt
  2014-07-07 21:09 ` Adam Beneschan
  2014-07-08  1:06 ` ironshirt
  0 siblings, 2 replies; 3+ messages in thread
From: ironshirt @ 2014-07-05  2:01 UTC (permalink / raw)


Hi all! 

I decided to learn some programming and just started with Ada + Qt a week ago. So far so good, but the last days I have issues with the attempt to populate a QTable with a certain number (20) of QLabels via 'for' loop.  Is this generally possible? At the moment only the name of the label should be set (for the sake of simplicity) as 'index1' to 'index20'.

Creating a single label and adding it to the table was no problem, but I couldn't figure out how to do this in a loop.
The declaration seems to be the sticking point. Hopefully someone here can give me a hint, or even better, a short example if possible.
Thanks in advance!

Regards
Michael
http://compgroups.net/comp.lang.ada/


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to create qlabels for a table via loop? (QtAda 3.2/GPS 2014 - Beginners question)
  2014-07-05  2:01 How to create qlabels for a table via loop? (QtAda 3.2/GPS 2014 - Beginners question) ironshirt
@ 2014-07-07 21:09 ` Adam Beneschan
  2014-07-08  1:06 ` ironshirt
  1 sibling, 0 replies; 3+ messages in thread
From: Adam Beneschan @ 2014-07-07 21:09 UTC (permalink / raw)


On Friday, July 4, 2014 7:01:33 PM UTC-7, ironshirt wrote:
> Hi all! 
> 
> 
> 
> I decided to learn some programming and just started with Ada + Qt a week ago. So far so good, but the last days I have issues with the attempt to populate a QTable with a certain number (20) of QLabels via 'for' loop.  Is this generally possible? At the moment only the name of the label should be set (for the sake of simplicity) as 'index1' to 'index20'.
> 
> 
> 
> Creating a single label and adding it to the table was no problem, but I couldn't figure out how to do this in a loop.
> 
> The declaration seems to be the sticking point. Hopefully someone here can give me a hint, or even better, a short example if possible.
> 
> Thanks in advance!

Could you post what you've tried so far?  If you were able to get it to work with one label, showing us the code you've gotten to work and some indication of what you'd like it to do in a loop would be helpful.  

                              -- Adam

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to create qlabels for a table via loop? (QtAda 3.2/GPS 2014 - Beginners question)
  2014-07-05  2:01 How to create qlabels for a table via loop? (QtAda 3.2/GPS 2014 - Beginners question) ironshirt
  2014-07-07 21:09 ` Adam Beneschan
@ 2014-07-08  1:06 ` ironshirt
  1 sibling, 0 replies; 3+ messages in thread
From: ironshirt @ 2014-07-08  1:06 UTC (permalink / raw)


Hi again,

meanwhile I found a solution for the problem and was able to populate the table via loop. Only the index is missing in the name, but this is something I will figure out by myself.

Here is the code of a simple test procedure if someone is interested.


procedure Populate_Table (Count : In Integer) is
     
begin

for n in 1 .. Count loop

Qt4.Table_Widgets.Set_Cell_Widget(Table,qt4.Q_Integer(n),qt4.Q_Integer(n),Qt4.Labels.Constructors.Create(Qt4.Strings.From_Ucs_4("Test")));

end loop;

end Populate_Table;


Regards
Michael



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-08  1:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-05  2:01 How to create qlabels for a table via loop? (QtAda 3.2/GPS 2014 - Beginners question) ironshirt
2014-07-07 21:09 ` Adam Beneschan
2014-07-08  1:06 ` ironshirt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox