------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 2008, 2009 Vadim Godunko <vgodunko@gmail.com>                --
--                                                                          --
-- QtAda is free software;  you can  redistribute it and/or modify it under --
-- terms of the  GNU General Public License as published  by the Free Soft- --
-- ware  Foundation;  either version 2,  or (at your option) any later ver- --
-- sion. QtAda is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
-- for  more details.  You should have  received  a copy of the GNU General --
-- Public License distributed with QtAda;  see file COPYING.  If not, write --
-- to  the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, --
-- Boston, MA 02110-1301, USA.                                              --
--                                                                          --
------------------------------------------------------------------------------
--  $Revision$ $Date$
------------------------------------------------------------------------------
with Qt_Ada.Application;
with Qt4.Sql_Databases;
with Qt4.Strings;

with Connection;
with Table_Editors;

procedure Main is
begin
   Qt_Ada.Application.Initialize;

   declare
      DB : Qt4.Sql_Databases.Q_Sql_Database;

   begin
      Connection.Create_Connection (DB);

      declare
         Editor : constant not null access Table_Editors.Table_Editor
           := Table_Editors.Create (DB, Qt4.Strings.From_Utf_16 ("person"));
         Code   : Qt4.Q_Integer;

      begin
         Editor.Show;
         Code := Editor.Exec;
      end;
   end;
end Main;
