Crash report on HbQtMsgbox usage

57 views
Skip to first unread message

Zoran Sibinovic

unread,
Feb 9, 2021, 4:47:22 AM2/9/21
to QtContribs
Hi Pritpal,
HbQtMsgbox crashes on 

...
      IF HB_ISNUMERIC( nX ) .AND. HB_ISNUMERIC( nY )
         :move( nX, nY )
      ELSE
         :adjustSize()
         :move( ( :parent:width() - :width() ) / 2, ( :parent:height() - :height() ) / 2 )
      ENDIF
...
Message in the attachment

By removing the line, the window is centered on the monitor screen.

Best regards,
Zoran
Untitled33.png

Pritpal Bedi

unread,
Feb 9, 2021, 5:56:07 PM2/9/21
to QtContribs
Hi Zoran

Did you announce your application window via __hbqtAppWidget( oMainWindow/widget/anyWidgetBasedObject ) ?
HbQtMessagebox expects a parent set via bove function


Pritpal Bedi
a student of software analysis & concepts

Zoran Sibinovic

unread,
Feb 10, 2021, 2:10:06 AM2/10/21
to QtContribs
Hi Pritpal,

No, I did not announced my application window via __hbqtAppWidget( oMainWindow/widget/anyWidgetBasedObject ).
I call HbQtMessagebox as a menu item in Build_MenuBar( oWnd ) where is as oWnd:= hbqtui_mainwindow().
There is no "parent" parameter place in the parameters that can be passed in HbQtMessagebox. Also in the function I did not changed anything.  
To be sure If i missed something, I tested the official .prg in ..\tests\glossybutton.prg by pressing the button in the main window and the attached error image is from It. So you can try it by yourself.

Also in ...\tests\hbmk.hbm  are required 2 more lines
hbwin.hbc
hbct.hbc

...to build all the tests.

Regards 
Zoran

Pritpal Bedi

unread,
Feb 10, 2021, 11:01:26 PM2/10/21
to QtContribs
Hi Zoran

I added this line here and it works fine. I believe glossybutton was submitted by someone earlier than I implemented __hbqtAppWidget(). So add this line in your sources just after creating the application widget.

   WITH OBJECT oBtn := QToolButton( oWnd )
      :setGeometry( 100, 135, 100, 30 )
      :setToolButtonStyle( Qt_ToolButtonTextOnly )
      :setText( "press" )
      :connect( "clicked()", {|| udf_test() } )
      :connect( QEvent_Paint, { | oEvent, oPainter | udf_paint( oEvent, oPainter, oBtn ) } )
   END WITH
   __hbqtAppWidget( oWnd )
   oWnd:show()


Pritpal Bedi
a student of software analysis & concepts

Reply all
Reply to author
Forward
0 new messages