Rajagopalan Srinivasan wrote:
> Are the Qt4 objects compatible with Ada containers?
> 
Yes. Only note, not all Qt classes allow to create objects before
application is initialized. For example I have successfully built and
run following program:

---------------------------------------------------------------------
with Ada.Containers.Indefinite_Doubly_Linked_Lists;
with Ada.Wide_Wide_Text_IO;

with Qt_Ada.Application;
with Qt4.Colors;
with Qt4.Painter_Paths;

procedure Container is

   type Segment is record
      Path  : Qt4.Painter_Paths.Q_Painter_Path;
      Color : Qt4.Colors.Q_Color;
   end record;

   package Lists is
     new Ada.Containers.Indefinite_Doubly_Linked_Lists (Segment);

   procedure Output_Name (Position : Lists.Cursor) is
      Element : constant Segment := Lists.Element (Position);

   begin
      Ada.Wide_Wide_Text_IO.Put_Line (Element.Color.Name.To_Ucs_4);
   end Output_Name;

   X : Lists.List;

begin
   Qt_Ada.Application.Initialize;

   X.Append ((Qt4.Painter_Paths.Create, Qt4.Colors.Create (Qt4.White)));
   X.Append ((Qt4.Painter_Paths.Create, Qt4.Colors.Create (Qt4.Red)));
   X.Append ((Qt4.Painter_Paths.Create, Qt4.Colors.Create (Qt4.Blue)));

   X.Iterate (Output_Name'Access);

   Qt_Ada.Application.Finalize;
end Container;
---------------------------------------------------------------------

> for example I have trouble making the following work. any ideas?
> 
Which problem do you have?

_______________________________________________
qtada-users mailing list
[email protected]
http://lists.qtada.com/mailman/listinfo/qtada-users_lists.qtada.com

Reply via email to