Hi Pritpal,
yes it's very strange because I have already used with QVboxLayout and works fine.
Anyway, today I have rebuilt the program (removed the working directory -.cpp, .o, .c, etc.) and works fine; I have played with several parameters and never got a crash. Very strange.
This is the snippet code; remember: I'm using HQL layer (class inheritance), for this reason you will see objects/methods start with HQL prefix. L3W prefix are my facilities.
A little brief: on this form there are 6 widtges on 3 rows; every row has a hqlLabel (QLabel) and an input field (hqlInputText(), hqlInputNumeric(), but they are QLineEdit) then it has a hqlToolBar (QToolbar). The form has a central widget (hqlWidget is QWidget) with a layout (hqlGridLayout or QGridLayout)
WITH OBJECT ::oWindow := hqlChildWindow( NIL, ::parentWindow() )
:setAttribute( Qt_WA_DeleteOnClose )
:setMinimumSize( l3wSys:get( "Form:MinQSize" ) )
:setCentralWidget( hqlWidget( NIL, ::oWindow ) )
:setGeometry( :style:alignedRect( Qt_LeftToRight, Qt_AlignCenter, :size(), :parentWidget:geometry() ) )
:hqlSetIcon( ":pgmico" )
:hqlCaption := cTitle
:hqlOnActivate( { || ::__onActivate() } )
:hqlOnClose( { || ::__onClose() } )
WITH OBJECT hqlToolBar()
:setIconSize( l3wSys:get( "BarButQSize" ) )
:hqlClosable := .F.
:hqlAddButton( NIL, NIL, { || ::oWindow:hqlRelease() }, L3wSys:get("Button:Exit_Icon"), hqlTran( "l3wmtrn", L3wSys:get("Button:Exit_ToolTip")), NIL, NIL, .F., .T. )
:hqlAddButton( "btsave", NIL, { || ::__saveRecord() }, L3wSys:get("Button:RecSave_Icon"), hqlTran( "l3wmtrn", L3wSys:get("Button:RecSave_ToolTip")), NIL, NIL, .F., .F. )
END WITH
WITH OBJECT :centralWidget()
:setLayout( hqlGridLayout() )
WITH OBJECT hqlLabel()
:hqlAddMeToLayout( :parent:layout(), 0, 0 )
:setAlignment( hb_BitOr( Qt_AlignRight, Qt_AlignVCenter ) )
:hqlCaption := hqlTran( "thisapp", "Code" )
END WITH
WITH OBJECT hqlInputText( "prgcodice" )
:hqlAddMeToLayout( :parent:layout(), 0, 1 )
:setSizePolicy( QSizePolicy_Maximum, QSizePolicy_Maximum )
:setPlaceholderText( hqlTran( "thisapp", "a valid code" ) )
:hqlInputMask( ::oModelData:prgcodice:inputMask() )
:hqlValid( { || ::__Valid_prgcodice() } )
:hqlOnTabPressed( { || ::__tryToManage() } )
END WITH
:layout:addItem( QSpacerItem( 0, 0, QSizePolicy_Minimum, QSizePolicy_Maximum ), 1, 0, 0, 3, Qt_AlignCenter )
WITH OBJECT hqlLabel()
:hqlAddMeToLayout( :parent:layout(), 2, 0 )
:setAlignment( hb_BitOr( Qt_AlignRight, Qt_AlignVCenter ) )
:hqlCaption := hqlTran( "thisapp", "Description" )
END WITH
WITH OBJECT hqlInputText( "prgdescri" )
:hqlAddMeToLayout( :parent:layout(), 2, 1 )
:setSizePolicy( QSizePolicy_Maximum, QSizePolicy_Maximum )
:setMinimumWidth( 200 )
:setMaxLength( ::oModelData:prgdescri:Length() )
:hqlValid( { || ::__Valid_prgdescri() } )
:hqlEnabled( .F. )
END WITH
:layout:addItem( QSpacerItem( 0, 0, QSizePolicy_Minimum, QSizePolicy_Maximum ), 3, 0, 0, 3, Qt_AlignCenter )
WITH OBJECT hqlLabel()
:hqlAddMeToLayout( :parent:layout(), 4, 0 )
:setAlignment( hb_BitOr( Qt_AlignRight, Qt_AlignVCenter ) )
:hqlCaption := hqlTran( "thisapp", "Value" )
END WITH
WITH OBJECT hqlInputNumeric( "prgnumero" )
:hqlAddMeToLayout( :parent:layout(), 4, 1 )
:setSizePolicy( QSizePolicy_Maximum, QSizePolicy_Maximum )
:hqlValid( { || ::__Valid_prgnumero() } )
:hqlInputMask( ::oModelData:prgnumero:inputMask() )
:hqlEnabled( .F. )
END WITH
I have bolded the code but as I wrote, now works fine after rebuilding the program. I not able to replicate previous error: I don't know.
I will continue to investigate with different parameters.
I'm sorry to waste your time.
Luigi