i am doing my first qtada program and am looking for some help. Listed here
is the spec and body of a new widget i am trying to create.
clearly something is missing since this widget does not update the window.
(Just a blank where it is supposed to be).
following is the spec of a new widget :any clues appreciated.
---------------Spec--------
with Qt4.Widgets ;
with Qt4.Widgets.Directors ;
with Qt4.LCD_Numbers ;
with Qt4.Paint_Events ;
package Engine_Widgets is
type Engine_Widget is limited new Qt4.Widgets.Q_Widget
with private ;
type Engine_Widget_Access is access all
Engine_Widget'Class ;
package Constructors is
function Create (Parent : access Qt4.Widgets.Q_Widget'Class := null)
return not null Engine_Widget_Access ;
end Constructors;
private
type Engine_Widget is new Qt4.Widgets.Directors.Q_Widget_Director
with record
Display : Qt4.Lcd_Numbers.Q_Lcd_Number_Access ;
end record ;
Overriding procedure Paint_Event
(Self : not null access Engine_Widget ;
Event : not null access Qt4.Paint_Events.Q_Paint_Event'Class);
end Engine_Widgets ;
----------------
-- and the body
----------------
with Qt4.Strings;
with Qt4.LCD_Numbers.Constructors ;
with Engine_Widgets.MOC;
pragma Warnings (Off, Engine_Widgets.MOC);
package body Engine_Widgets is
package body Constructors is
------------
-- Create --
------------
function Create (Parent : access Qt4.Widgets.Q_Widget'Class := null)
return not null Engine_Widget_Access
is
Self : constant Engine_Widget_Access := new Engine_Widget;
begin
Qt4.Widgets.Directors.Constructors.Initialize (Self, Parent);
Self.Display := Qt4.LCD_Numbers.Constructors.Create( Num_Digits =>
12 ) ;
Self.Display.Set_Segment_Style( Qt4.LCD_Numbers.Flat ) ;
return Self;
end Create;
end Constructors;
Overriding procedure Paint_Event
(Self : not null access Engine_Widget ;
Event : not null access Qt4.Paint_Events.Q_Paint_Event'Class)
is
begin
Self.Display.Update ;
end Paint_Event ;
end Engine_Widgets ;
--------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.qtada.com/pipermail/qtada-users_lists.qtada.com/attachments/20090726/919bc6dd/attachment.html>
_______________________________________________
qtada-users mailing list
[email protected]
http://lists.qtada.com/mailman/listinfo/qtada-users_lists.qtada.com