Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / qt / 2010-01

uclibc + libqt4intf- EAccessViolation : Access violation

19 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Nataraj S Narayan

Hi

I am on Arm-linux-uclibc and qt-embedded-opensouce-4.5.2 compiled for uclibc. Getting the following:-

May I have some clues?

regards

Nataraj

# ./shapedclock -qws
FT_New_Face failed with index 0 : 2
FT_New_Face failed with index 0 : 2
FT_New_Face failed with index 0 : 2
FT_New_Face failed with index 0 : 2
FT_New_Face failed with index 0 : 2
An unhandled exception occurred at $00062488 :
EAccessViolation : Access violation
$00062488 of ../objpas/rtlconsts.pp

# ./concentric -qws
start of program
FT_New_Face failed with index 0 : 2
FT_New_Face failed with index 0 : 2
FT_New_Face failed with index 0 : 2
FT_New_Face failed with index 0 : 2
FT_New_Face failed with index 0 : 2
An unhandled exception occurred at $00051AB0 :
EAccessViolation : Access violation
$00051AB0 of ../objpas/rtlconsts.pp

zeljko
to Nataraj S Narayan
Nataraj S Narayan wrote 6 lines
Hi I am on Arm-linux-uclibc and qt-embedded-opensouce-4.5.2 compiled for uclibc. Getting the following:- May I have some clues?

Yes, run it via gdb (first shapedclocl compile with gdb enabled) and send backtrace here.

Show quoted text 29 lines
regards Nataraj # ./shapedclock -qws FT_New_Face failed with index 0 : 2 FT_New_Face failed with index 0 : 2 FT_New_Face failed with index 0 : 2 FT_New_Face failed with index 0 : 2 FT_New_Face failed with index 0 : 2 An unhandled exception occurred at $00062488 : EAccessViolation : Access violation $00062488 of ../objpas/rtlconsts.pp # ./concentric -qws start of program FT_New_Face failed with index 0 : 2 FT_New_Face failed with index 0 : 2 FT_New_Face failed with index 0 : 2 FT_New_Face failed with index 0 : 2 FT_New_Face failed with index 0 : 2 An unhandled exception occurred at $00051AB0 : EAccessViolation : Access violation $00051AB0 of ../objpas/rtlconsts.pp _______________________________________________ Qt mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/qt
Nataraj S Narayan
to zeljko

Hi zeljko

May i a sample single button click pure fpc app, without lcl, to check?

strace listing of ./shapedclock is quite frightening.

regards

nataraj

zeljko wrote 46 lines
On Wednesday 27 January 2010 13:33, Nataraj S Narayan wrote: > Hi > > I am on Arm-linux-uclibc and qt-embedded-opensouce-4.5.2 compiled for > uclibc. Getting the following:- > > May I have some clues? Yes, run it via gdb (first shapedclocl compile with gdb enabled) and send backtrace here. > regards > > Nataraj > > # ./shapedclock -qws > FT_New_Face failed with index 0 : 2 > FT_New_Face failed with index 0 : 2 > FT_New_Face failed with index 0 : 2 > FT_New_Face failed with index 0 : 2 > FT_New_Face failed with index 0 : 2 > An unhandled exception occurred at $00062488 : > EAccessViolation : Access violation > $00062488 of ../objpas/rtlconsts.pp > > # ./concentric -qws > start of program > FT_New_Face failed with index 0 : 2 > FT_New_Face failed with index 0 : 2 > FT_New_Face failed with index 0 : 2 > FT_New_Face failed with index 0 : 2 > FT_New_Face failed with index 0 : 2 > An unhandled exception occurred at $00051AB0 : > EAccessViolation : Access violation > $00051AB0 of ../objpas/rtlconsts.pp > > _______________________________________________ > Qt mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/qt _______________________________________________ Qt mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/qt
zeljko
to Nataraj S Narayan
Nataraj S Narayan wrote 5 lines
Hi zeljko May i a sample single button click pure fpc app, without lcl, to check? strace listing of ./shapedclock is quite frightening.

I said gdb trace, not strace command.

Nataraj S Narayan
to zeljko

Hi

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1024 (LWP 495)]
0x00000000 in ?? ()
(gdb) bt
#0 0x00000000 in ?? ()
#1 0x401c0ab4 in QObject_hook::eventFilter () from /usr/lib/libqt4intf.so #2 0x40456424 in QCoreApplicationPrivate::sendThroughObjectEventFilters () from /usr/armel-311009/lib/libQtCore.so.4
#3 0x40721d64 in QApplicationPrivate::notify_helper () from /usr/armel-311009/lib/libQtGui.so.4
#4 0x407243cc in QApplication::notify ()
from /usr/armel-311009/lib/libQtGui.so.4
#5 0x404560f4 in QCoreApplication::notifyInternal () from /usr/armel-311009/lib/libQtCore.so.4
#6 0x4076334c in QWidget::ensurePolished ()
from /usr/armel-311009/lib/libQtGui.so.4
#7 0x407633d4 in QWidget::ensurePolished ()
from /usr/armel-311009/lib/libQtGui.so.4
#8 0x40771d0c in QWidget::setVisible ()
from /usr/armel-311009/lib/libQtGui.so.4
#9 0x401bff5c in QWidget::show () from /usr/lib/libqt4intf.so #10 0x40116de8 in QWidget_show () from /usr/lib/libqt4intf.so #11 0x0000968c in TMAINFORM__CREATE (vmt=0x37c2c, this=0x5bb4c) at concentric.pas:214
#12 0x00009874 in TAPPLICATION__CREATE (vmt=0x37d1c, this=0x4b4fc) at concentric.pas:241
#13 0x00009958 in main () at concentric.pas:254
(gdb)

regards

Nataraj

zeljko wrote 14 lines
On Monday 01 February 2010 09:26, Nataraj S Narayan wrote: > Hi zeljko > > May i a sample single button click pure fpc app, without lcl, to check? > > strace listing of ./shapedclock is quite frightening. I said gdb trace, not strace command. _______________________________________________ Qt mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/qt
zeljko
to Nataraj S Narayan
Nataraj S Narayan wrote 29 lines
Hi Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1024 (LWP 495)] 0x00000000 in ?? () (gdb) bt #0 0x00000000 in ?? () #1 0x401c0ab4 in QObject_hook::eventFilter () from /usr/lib/libqt4intf.so #2 0x40456424 in QCoreApplicationPrivate::sendThroughObjectEventFilters () from /usr/armel-311009/lib/libQtCore.so.4 #3 0x40721d64 in QApplicationPrivate::notify_helper () from /usr/armel-311009/lib/libQtGui.so.4 #4 0x407243cc in QApplication::notify () from /usr/armel-311009/lib/libQtGui.so.4 #5 0x404560f4 in QCoreApplication::notifyInternal () from /usr/armel-311009/lib/libQtCore.so.4 #6 0x4076334c in QWidget::ensurePolished () from /usr/armel-311009/lib/libQtGui.so.4 #7 0x407633d4 in QWidget::ensurePolished () from /usr/armel-311009/lib/libQtGui.so.4 #8 0x40771d0c in QWidget::setVisible () from /usr/armel-311009/lib/libQtGui.so.4 #9 0x401bff5c in QWidget::show () from /usr/lib/libqt4intf.so #10 0x40116de8 in QWidget_show () from /usr/lib/libqt4intf.so #11 0x0000968c in TMAINFORM__CREATE (vmt=0x37c2c, this=0x5bb4c) at concentric.pas:214 #12 0x00009874 in TAPPLICATION__CREATE (vmt=0x37d1c, this=0x4b4fc) at concentric.pas:241 #13 0x00009958 in main () at concentric.pas:254

What code is inside concentric.pas ? It seem that widget is trying to set it's visiblity inside TMainForm.Create before handle is created or something like that. I cannot give you more information without code from concentric.pas.

zeljko

Nataraj S Narayan
to zeljko

Hi

The following code is part one the examples in demos-V1.72_Qt4.5.2.

regards

Nataraj

program concentric;
{$mode objfpc}{$H+}
(* {$linklib gcc_s}
*)

uses

  CMem,Strings,
  SysUtils,Classes,Types,Math,qt4;
function SlotName(Name:String):PAnsiChar;
begin
Result:=StrNew(PChar('1'+Name));
end;
function SignalName(Name:String):PAnsiChar;
begin
Result:=StrNew(PChar('2'+Name));
end;
type
  TMainForm = class;
  TCircleWidget = class(TObject)
  private
    Handle : QWidgetH;
    FFloatBased : Boolean;
    FAntialiased : Boolean;
    FFrameNo : Integer;
    procedure SetFloatBased (const Value : Boolean);
    procedure SetAntiAliased (const Value : Boolean);
    procedure NextAnimationFrame;cdecl;
    function EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl;
    procedure Paint (QPaintEvent : QPaintEventH);
  public
    constructor Create(Parent:TMainForm);
    property FloatBased : Boolean read FFloatBased write SetFloatBased;
    property Antialiased : Boolean read FAntialiased write SetAntialiased;
  end;
  TMainForm = class(TObject)
  private
    CircleWidgets : array [1..2,1..2] of TCircleWidget;
    function CreateLabel (s : WideString) : QLabelH;
  public
    Handle : QWidgetH;
    quitButton : QPushButtonH;
    constructor Create;
  end;
  TApplication = class(TObject)
  private
  public
    MainForm : TMainForm;
    constructor Create;
  end;
//*******************************************************
// TCircleWidget
//*******************************************************
//===============================================
constructor TCircleWidget.Create(Parent:TMainForm);
var
  Hook   : QWidget_hookH;
begin
inherited Create();
Handle:=QWidget_create(Parent.Handle);
FFloatBased:=false;
FAntialiased:=false;
FFrameNo:=0;
QWidget_setBackgroundRole(Handle, QPaletteBase);
QWidget_setSizePolicy(Handle, QSizePolicyExpanding, QSizePolicyExpanding);
// Event filter
Hook:=QWidget_hook_create(handle);
QObject_hook_hook_events(Hook, at EventFilter);
end;
//===============================================
procedure TCircleWidget.SetFloatBased (const Value : Boolean);
begin
FFloatbased:=Value;
QWidget_update(Handle);
end;
//===============================================
procedure TCircleWidget.SetAntiAliased (const Value : Boolean);
begin
FAntialiased:=Value;
QWidget_update(Handle);
end;
//===============================================
procedure TCircleWidget.NextAnimationFrame;cdecl;
begin
FFrameNo:=FFrameNo+1;
QWidget_update(Handle);
end;
//===============================================
function TCircleWidget.EventFilter(Sender: QObjectH; Event: QEventH):
Boolean; cdecl;
begin
Result:=False;
if QEvent_type(Event) = QEventPaint then Paint(QPaintEventH(Event));
end;
//===============================================
procedure TCircleWidget.Paint (QPaintEvent : QPaintEventH);
var
  Painter : QPainterH;
  Diameter : Integer;
  Alpha, Delta : Integer;
  QPen : QPenH;
  QColor : TQColor;
  QRectF : QRectFH;
begin
try
  Painter:=QPainter_create(QWidget_to_QPaintDevice(Handle));
  QPainter_setRenderHint(Painter,QPainterAntialiasing, Antialiased);
  QPainter_translate(Painter,QWidget_width(Handle) div 2,
QWidget_height(Handle) div 2);
  Diameter:=0;
  while Diameter < 256 do
    begin
    Delta := abs((FFrameNo mod 128) - Diameter div 2);
    Alpha := 255 - (Delta * Delta) div 4 - Diameter;
    if (Alpha > 0) then
       begin
       QColor_fromRGB(@QColor,0, Diameter div 2, 127, Alpha);
       QPen := QPen_create(@QColor);
       QPen_setWidth(QPen, 3);
       QPainter_setPen(painter, QPen);
       if FloatBased then
          begin
          QRectF:=QRectF_create(-diameter / 2.0, -diameter / 2.0,
                                           Diameter, Diameter);
          QPainter_drawEllipse(painter,QRectF);
          QRectF_destroy(QRectF);
          end
       else
          QPainter_drawEllipse(painter,-diameter div 2, -diameter div 2,
                                           Diameter, Diameter);
       end;
    Diameter:=Diameter+9;
    end;
finally
  QPen_destroy(QPen);
  QPainter_destroy(Painter);
end;
end;
//*******************************************************
// TMainForm
//*******************************************************
//===============================================
constructor TMainForm.Create;
var
  w      : Widestring;
  i, j   : integer;
  layout : QGridLayoutH;
  QTimer : QTimerH;
  TimerHook : QTimer_hookH;
begin
inherited;
Handle:=QWidget_create();
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;
QTimer_start(QTimer, 100);
QWidget_setLayout(Handle,layout);
w:='Concentric Circles';
QWidget_setWindowTitle(Handle, at w);
QWidget_resize(Handle,600,600);
QWidget_show(Handle);
end;
//===============================================
function TMainForm.CreateLabel (s : WideString) : QLabelH;
begin
Result := QLabel_create(@s);
QLabel_setAlignment(Result, QtAlignCenter);
QLabel_setMargin(Result, 2);
QFrame_setFrameStyle(Result, Integer(QFrameBox) or Integer(QFrameSunken));
end;
//*******************************************************
// TApplication
//*******************************************************
//===============================================
constructor TApplication.Create;
begin
inherited;
QApplication_Create(@argc,argv);
MainForm:=TMainForm.Create;
QApplication_Exec();
end;
//*******************************************************
// Main
//*******************************************************
begin
writeln('start of program');
TApplication.Create;
writeln('end of program');
end.
zeljko wrote 42 lines
On Monday 01 February 2010 11:41, Nataraj S Narayan wrote: > Hi > > Program received signal SIGSEGV, Segmentation fault. > [Switching to Thread 1024 (LWP 495)] > 0x00000000 in ?? () > (gdb) bt > #0 0x00000000 in ?? () > #1 0x401c0ab4 in QObject_hook::eventFilter () from /usr/lib/libqt4intf.so > #2 0x40456424 in QCoreApplicationPrivate::sendThroughObjectEventFilters () > from /usr/armel-311009/lib/libQtCore.so.4 > #3 0x40721d64 in QApplicationPrivate::notify_helper () > from /usr/armel-311009/lib/libQtGui.so.4 > #4 0x407243cc in QApplication::notify () > from /usr/armel-311009/lib/libQtGui.so.4 > #5 0x404560f4 in QCoreApplication::notifyInternal () > from /usr/armel-311009/lib/libQtCore.so.4 > #6 0x4076334c in QWidget::ensurePolished () > from /usr/armel-311009/lib/libQtGui.so.4 > #7 0x407633d4 in QWidget::ensurePolished () > from /usr/armel-311009/lib/libQtGui.so.4 > #8 0x40771d0c in QWidget::setVisible () > from /usr/armel-311009/lib/libQtGui.so.4 > #9 0x401bff5c in QWidget::show () from /usr/lib/libqt4intf.so > #10 0x40116de8 in QWidget_show () from /usr/lib/libqt4intf.so > #11 0x0000968c in TMAINFORM__CREATE (vmt=0x37c2c, this=0x5bb4c) > at concentric.pas:214 > #12 0x00009874 in TAPPLICATION__CREATE (vmt=0x37d1c, this=0x4b4fc) > at concentric.pas:241 > #13 0x00009958 in main () at concentric.pas:254 What code is inside concentric.pas ? It seem that widget is trying to set it's visiblity inside TMainForm.Create before handle is created or something like that. I cannot give you more information without code from concentric.pas. zeljko _______________________________________________ Qt mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/qt
zeljko
to Nataraj S Narayan

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.

Show quoted text 10 lines
//=============================================== 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);
Show quoted text 22 lines
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)
Show quoted text 8 lines
QTimer_start(QTimer, 100); w:='Concentric Circles'; QWidget_setWindowTitle(Handle, at w); QWidget_resize(Handle,600,600); QWidget_show(Handle); end;
Den Jean
to Nataraj S Narayan: Hi Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1024 (LWP…
Nataraj S Narayan wrote
#1 0x401c0ab4 in QObject_hook::eventFilter () from /usr/lib/libqt4intf.so

in embedded, first try a very small c++ app like
qt-embedded-linux-opensource-src-4.5.3/examples/tutorials/addressbook/part1 to verify your qt setup

then try a very small freepascal writeln hello world app in fpc (*without* Qt)

then translate the qt tutor to a pascal qt4 app with the binding.(see below)

compiling the Qt libs and the Qt binding with debug info if still problems

addressbook.lpr:
http://users.telenet.be/Jan.Van.hijfte/qtforfpc/addressbook.png

program addressbook;
{$mode objfpc}{$H+}
uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Classes,SysUtils,Types,Qt4;
type
TAddressBook = class(TObject)
  public
  Handle : QWidgetH;
  NameLine : QLineEditH;
  AddressText : QTextEditH;
  constructor Create;
end;
constructor TAddressBook.Create;
var
  NameLabel : QLabelH;
  AddressLabel : QLabelH;
  MainLayout : QGridLayoutH;
  w : WideString;
begin
  Handle:=QWidget_create;
  w:='Name:';
  NameLabel:=QLabel_Create(@w);
  NameLine:=QLineEdit_create;
  w:='Address:';
  AddressLabel:=QLabel_create(@w);
  AddressText:=QTextEdit_create;
  MainLayout:=QGridLayout_create;
  QGridLayout_addWidget(MainLayout,NameLabel,0,0);
  QGridLayout_addWidget(MainLayout,NameLine,0,1);
  QGridLayout_addWidget(MainLayout,AddressLabel,1,0,QtAlignTop);
  QGridLayout_addWidget(MainLayout,AddressText,1,1);
  QWidget_setLayout(Handle,MainLayout);
  w:='Simple Address Book';
  QWidget_setWindowTitle(Handle, at w);
  end;
var
  App : QApplicationH;
  AddrBook : TAddressBook;
begin
  App:=QApplication_create(@Argc,Argv);
  AddrBook:=TAddressBook.Create;
  QWidget_show(AddrBook.Handle);
  QCoreApplication_exec;
end.
zeljko
to Den Jean: since when ?
Den Jean wrote
On Monday 01 February 2010 13:45:21 zeljko wrote: > a)Qt must have QMainWindow since when ?

Since qt-4.0. Don't know now, but seen some discussions about it long time ago , and it must have centralwidget.I think that if you create QWidget as main window, qt overrides it with QMainWindow, and then centralwidget is a must (if I correctly remember - as I said it was a long time ago).

z.

Den Jean
to zeljko
zeljko wrote
ago , and it must have centralwidget.I think that if you create QWidget as main window, qt overrides it with QMainWindow, and then centralwidget is a

I would be very surprised

Nataraj S Narayan
to Den Jean: in embedded, first try a very small c++ app like…

Den,zeljko

I have wokring setup of qt-embedded-opensource-4.5.2 compiled using buildroot toolchain - arm-linux-uclibcgnueabi- on my at91sam9263 SBC.

I have compiled and executed /packages/ncurses/examples/firework.pp on this setup using:-

# ppcrossarm -MObjFPC -TLinux -Parmv5 -gl -Xd -Xs -l -darm -XParm-linux-uclibcgnueabi- -CfSOFT -CaEABI -darm -gl -O- -CpARMV5 -uUSE_LOCALIZE -Fu/usr/local/lib/fpc/2.5.1/units/arm-linux/* -Fl$ARMPATH/usr/arm-linux-uclibcgnueabi/lib
-FL$ARMPATH/lib/ld-uClibc.so.0 -XR$ARMPATH -Fl$ARMPATH/lib -Fl$ARMPATH/usr/lib -k"--sysroot=$ARMPATH" firework.pp

Let me try out the addressbook example now,

regards

Nataraj

Den Jean wrote 89 lines
On Monday 01 February 2010 11:41:25 Nataraj S Narayan wrote: > #1 0x401c0ab4 in QObject_hook::eventFilter () from /usr/lib/libqt4intf.so > in embedded, first try a very small c++ app like qt-embedded-linux-opensource-src-4.5.3/examples/tutorials/addressbook/part1 to verify your qt setup then try a very small freepascal writeln hello world app in fpc (*without* Qt) then translate the qt tutor to a pascal qt4 app with the binding.(see below) compiling the Qt libs and the Qt binding with debug info if still problems addressbook.lpr: http://users.telenet.be/Jan.Van.hijfte/qtforfpc/addressbook.png program addressbook; {$mode objfpc}{$H+} uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Classes,SysUtils,Types,Qt4; type TAddressBook = class(TObject) public Handle : QWidgetH; NameLine : QLineEditH; AddressText : QTextEditH; constructor Create; end; constructor TAddressBook.Create; var NameLabel : QLabelH; AddressLabel : QLabelH; MainLayout : QGridLayoutH; w : WideString; begin Handle:=QWidget_create; w:='Name:'; NameLabel:=QLabel_Create(@w); NameLine:=QLineEdit_create; w:='Address:'; AddressLabel:=QLabel_create(@w); AddressText:=QTextEdit_create; MainLayout:=QGridLayout_create; QGridLayout_addWidget(MainLayout,NameLabel,0,0); QGridLayout_addWidget(MainLayout,NameLine,0,1); QGridLayout_addWidget(MainLayout,AddressLabel,1,0,QtAlignTop); QGridLayout_addWidget(MainLayout,AddressText,1,1); QWidget_setLayout(Handle,MainLayout); w:='Simple Address Book'; QWidget_setWindowTitle(Handle, at w); end; var App : QApplicationH; AddrBook : TAddressBook; begin App:=QApplication_create(@Argc,Argv); AddrBook:=TAddressBook.Create; QWidget_show(AddrBook.Handle); QCoreApplication_exec; end. _______________________________________________ Qt mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/qt
zeljko
to Den Jean: since when ?
Den Jean wrote
On Monday 01 February 2010 13:45:21 zeljko wrote: > a)Qt must have QMainWindow since when ?

Yes, my coleague told me that we discuss about it > 1 yr ago but it was in QMdiArea context :)

zeljko
to Den Jean: I would be very surprised
Den Jean wrote 6 lines
On Monday 01 February 2010 20:32:27 zeljko wrote: > ago , and it must have centralwidget.I think that if you create QWidget > as main window, qt overrides it with QMainWindow, and then centralwidget > is a I would be very surprised

ahh.. I answered to wrong post.... my coleague confirmed that we discussed about it > 1 yr ago, but that was in QMdiArea context :)

z.

Nataraj S Narayan
to Den Jean: in embedded, first try a very small c++ app like…

Yikes!!!

Address book code works!

Luckily, I changed the kernel from 2.6.28 to 2.6.30. Now I dont get seg fault. I mean, the same code gave me segmentation fault on 2.6.28.

BTW these errors remain :-
# ./shapedclock -qws
FT_New_Face failed with index 0 : 2
FT_New_Face failed with index 0 : 2
FT_New_Face failed with index 0 : 2
FT_New_Face failed with index 0 : 2
FT_New_Face failed with index 0 : 2
An unhandled exception occurred at $01054ED0 :
EAccessViolation : Access violation
$01054ED0 of ../objpas/rtlconsts.pp
$00009168 TCLOCK__CREATE, line 72 of shapedclock.pas $0000A048 TAPPLICATION__CREATE, line 318 of shapedclock.pas $0000A1AC main, line 339 of shapedclock.pas

# ./concentric -qws
start of program
An unhandled exception occurred at $0004C828 :
EAccessViolation : Access violation
$0004C828 of ../objpas/rtlconsts.pp

regards

Nataraj

Den Jean wrote 89 lines
On Monday 01 February 2010 11:41:25 Nataraj S Narayan wrote: > #1 0x401c0ab4 in QObject_hook::eventFilter () from /usr/lib/libqt4intf.so > in embedded, first try a very small c++ app like qt-embedded-linux-opensource-src-4.5.3/examples/tutorials/addressbook/part1 to verify your qt setup then try a very small freepascal writeln hello world app in fpc (*without* Qt) then translate the qt tutor to a pascal qt4 app with the binding.(see below) compiling the Qt libs and the Qt binding with debug info if still problems addressbook.lpr: http://users.telenet.be/Jan.Van.hijfte/qtforfpc/addressbook.png program addressbook; {$mode objfpc}{$H+} uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Classes,SysUtils,Types,Qt4; type TAddressBook = class(TObject) public Handle : QWidgetH; NameLine : QLineEditH; AddressText : QTextEditH; constructor Create; end; constructor TAddressBook.Create; var NameLabel : QLabelH; AddressLabel : QLabelH; MainLayout : QGridLayoutH; w : WideString; begin Handle:=QWidget_create; w:='Name:'; NameLabel:=QLabel_Create(@w); NameLine:=QLineEdit_create; w:='Address:'; AddressLabel:=QLabel_create(@w); AddressText:=QTextEdit_create; MainLayout:=QGridLayout_create; QGridLayout_addWidget(MainLayout,NameLabel,0,0); QGridLayout_addWidget(MainLayout,NameLine,0,1); QGridLayout_addWidget(MainLayout,AddressLabel,1,0,QtAlignTop); QGridLayout_addWidget(MainLayout,AddressText,1,1); QWidget_setLayout(Handle,MainLayout); w:='Simple Address Book'; QWidget_setWindowTitle(Handle, at w); end; var App : QApplicationH; AddrBook : TAddressBook; begin App:=QApplication_create(@Argc,Argv); AddrBook:=TAddressBook.Create; QWidget_show(AddrBook.Handle); QCoreApplication_exec; end. _______________________________________________ Qt mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/qt
Den Jean
to Nataraj S Narayan
Nataraj S Narayan wrote
Address book code works!

are there any console message (like below) when running

Show quoted text 11 lines
Luckily, I changed the kernel from 2.6.28 to 2.6.30. Now I dont get seg fault. I mean, the same code gave me segmentation fault on 2.6.28. BTW these errors remain :- # ./shapedclock -qws FT_New_Face failed with index 0 : 2 FT_New_Face failed with index 0 : 2 FT_New_Face failed with index 0 : 2 FT_New_Face failed with index 0 : 2 FT_New_Face failed with index 0 : 2 An unhandled exception occurred at $01054ED0 : EAccessViolation : Access violation

?? segfault is still there ??

Nataraj S Narayan
to Den Jean

Hi

Address book works as good as in the i386. Just a single kinda console message.

FT_New_Face failed with index 0 : 2

This , I get for all my Qt 4.5.2 apps.

No more seg faults. Only these :-# ./mainwindow -qws

start of program
An unhandled exception occurred at $4058E2B4 :
EAccessViolation : Access violation
$4058E2B4 of ../objpas/rtlconsts.pp

Strange that a kernel change should affect an fpc program.

regards

Nataraj

Den Jean wrote 22 lines
On Tuesday 02 February 2010 11:25:29 Nataraj S Narayan wrote: > Address book code works! are there any console message (like below) when running > Luckily, I changed the kernel from 2.6.28 to 2.6.30. Now I dont get seg > fault. I mean, the same code gave me segmentation fault on 2.6.28. > BTW these errors remain :- > # ./shapedclock -qws > FT_New_Face failed with index 0 : 2 > FT_New_Face failed with index 0 : 2 > FT_New_Face failed with index 0 : 2 > FT_New_Face failed with index 0 : 2 > FT_New_Face failed with index 0 : 2 > An unhandled exception occurred at $01054ED0 : > EAccessViolation : Access violation ?? segfault is still there ?? _______________________________________________ Qt mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/qt
Nataraj S Narayan
to Nataraj S Narayan

Hi

Finally, I am trying out a simple ,single button click evet lazarus program. I am on
libqt4intf.so.5.1.72, compiled for arm-linux-uclibc. I got the lazarus-Qt App working on FreeBSD-i386.

Did a "make clean lcl LCL_PLATFORM=qt OS_TARGET=linux CPU_TARGET=arm OPT='-dFPC_ARMEL -darm -dqt -CfSOFT -gl' FPC=ppcrossarm" on lazarus-svn.

Getting error in "Compiling /software/lazarus-svn/lcl/controls.pp" while compiling the App.

May I have some clues?

regards

Nataraj

# ppcrossarm -MObjFPC -TLinux -Parmv5 -gl -Xd -Xs -l -darm -XParm-linux-uclibcgnueabi- -CfSOFT -CaEABI -darm -gl -O- -CpARMV5 -uUSE_LOCALIZE -Fu/usr/local/lib/fpc/2.5.1/units/arm-linux/* -Fl$ARMPATH/usr/arm-linux-uclibcgnueabi/lib
-FL$ARMPATH/lib/ld-uClibc.so.0 -XR$ARMPATH -Fl$ARMPATH/lib -Fl$ARMPATH/usr/lib -k"--sysroot=$ARMPATH"
-k"-rpath-link=/cdrom/output/build/staging_dir/usr/arm-linux-uclibcgnueabi/lib/" -darm -darmlclqt noy1.lpr
Free Pascal Compiler version 2.5.1 [2010/02/08] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling noy1.lpr
Compiling /software/lazarus-svn/lcl/controls.pp
controls.pp(929,27) Error: Identifier not found "TPopupMenu" controls.pp(929,27) Error: Error in type definition controls.pp(1009,45) Error: Identifier not found "TPopupMenu" controls.pp(1191,38) Error: Identifier not found "TPopupMenu" controls.pp(1397,36) Error: Identifier not found "TPopupmenu" controls.pp(2393,1) Fatal: There were 5 errors compiling module, stopping Fatal: Compilation aborted

Nataraj S Narayan wrote 48 lines
Hi Address book works as good as in the i386. Just a single kinda console message. FT_New_Face failed with index 0 : 2 This , I get for all my Qt 4.5.2 apps. No more seg faults. Only these :-# ./mainwindow -qws start of program An unhandled exception occurred at $4058E2B4 : EAccessViolation : Access violation ?$4058E2B4 of ../objpas/rtlconsts.pp Strange that a kernel change should affect an fpc program. regards Nataraj On Wed, Feb 3, 2010 at 12:02 AM, Den Jean wrote: > On Tuesday 02 February 2010 11:25:29 Nataraj S Narayan wrote: >> Address book code works! > are there any console message (like below) when running > >> Luckily, I changed the kernel from 2.6.28 to 2.6.30. Now I dont get seg >> ?fault. I mean, the same code gave me segmentation fault on 2.6.28. >> BTW these errors remain :- >> # ./shapedclock -qws >> FT_New_Face failed with index 0 : 2 >> FT_New_Face failed with index 0 : 2 >> FT_New_Face failed with index 0 : 2 >> FT_New_Face failed with index 0 : 2 >> FT_New_Face failed with index 0 : 2 >> An unhandled exception occurred at $01054ED0 : >> EAccessViolation : Access violation > ?? segfault is still there ?? > > _______________________________________________ > Qt mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/qt >