[Qt] uclibc + libqt4intf- EAccessViolation : Access violation
zeljko
zeljko at holobit.net
Mon Feb 1 13:45:21 CET 2010
On Monday 01 February 2010 13:19, Nataraj S Narayan wrote:
I think that problem is in misusage of main form.
Try next:
1.change TMainForm.Handle to QMainWindow
2.Add private FCentralWidget to TMainForm
3.Change TMainForm constructor as I changed below (marked with *)
a)Qt must have QMainWindow
b) QMainWindow must have central widget assigned.
I've written this without any tests or code check.You can also look into
qtwidgets.TQtMainWindow.Create(), how we create QMainWindow and how to add
central widget to it.
> //===============================================
> constructor TMainForm.Create;
> var
> w : Widestring;
> i, j : integer;
> layout : QGridLayoutH;
> QTimer : QTimerH;
> TimerHook : QTimer_hookH;
> begin
> inherited;
* Handle:=QMainWindow_create();
* FCentralWidget := QWidget_create(Handle);
> layout := QGridLayout_create;
> QGridLayout_addWidget(layout,CreateLabel('Aliased'), 0, 1);
> QGridLayout_addWidget(layout,CreateLabel('Antialiased'), 0, 2);
> QGridLayout_addWidget(layout,CreateLabel('Int'), 1, 0);
> QGridLayout_addWidget(layout,CreateLabel('Float'), 2, 0);
>
> QTimer:=QTimer_create(Self.Handle);
>
> for i:=1 to 2 do
> for j:=1 to 2 do
> begin
> circleWidgets[i][j]:=TCircleWidget.Create(Self);
> circleWidgets[i][j].Antialiased := j <> 1;
> circleWidgets[i][j].FloatBased := i <> 1;
>
> TimerHook:=QTimer_hook_create(QTimer);
>
> QTimer_hook_hook_timeout(TimerHook, at circleWidgets[i][j].NextAnimationFrame)
>;
>
> QGridLayout_addWidget(layout,circleWidgets[i][j].Handle, i, j);
> end;
* QWidget_setLayout(FCentralWidget, layout);
* QMainWindow_setCentralWidget(Handle, FCentralWidget)
> QTimer_start(QTimer, 100);
> w:='Concentric Circles';
> QWidget_setWindowTitle(Handle, at w);
>
> QWidget_resize(Handle,600,600);
> QWidget_show(Handle);
>
> end;
More information about the Qt
mailing list