I tried to connect function with either buttons Ok and Cancel but no success. I used
oWnd:buttonBox:Cancel:connect ("clicked()", { || Fcncl () }).
This signal is emitted when a button inside the button box is clicked. The specific button that was pressed is specified by button.
In Qt documentation I found this:This signal is emitted when a button inside the button box is clicked. The specific button that was pressed is specified by button.
In clicked slot I must specify QAbstractButton * button but how ?
First I started with oWnd:oDialogButtonBox:connect( "clicked(QAbstractButton*)", { |oButton| ManageButton( oButton ) } ) command.Program was aware of ManageButton function.In ManageButton function I did test what button is clicked with IF oButton==QDialogButton_Ok. But whenever I click on either of standard buttons I got Windows error that say “TESTGUI.EXE stops execution ...” and execution crashed.
................
void CProgOptions::on_buttonBox_clicked(QAbstractButton
*button)
{
if(button==
buttonBox->button(QDialogButtonBox::Reset) )
{
HERE GOES SOME
CODE
}
}
..............
According to this in ManageButtons I did button test with
IF oButton==buttonBox:button(QDialogButton_Ok)
but with same crashing (precisely, message is “TESTGUI.EXE has stopped working”).
Some examples on Internet suggested to try with:
IF buttonBox:standardButton(oButton)==QDialogButtonBox_Apply or with
IF buttonBox:buttonRole(oButton)==QDialogButtonBox_AcceptRole
In all my tries program crashes. When I do not use clicked slot, program do not crash.
I am aware that I do not have enough knowledge about HbQt.
Please, can you tell me what do I must read to learn wrapper functions for QT in Harbour.
Now I use QGroupBox instead QdialogButtonBox.
Regards,
Dordije.
void CProgOptions::on_buttonBox_clicked(QAbstractButton *button)
{
if(button== buttonBox->button(QDialogButtonBox::Reset) ){
HERE GOES SOME CODE
}
}
IF oButton==buttonBox:button(QDialogButton_Ok)
IF buttonBox:buttonRole(oButton)==QDialogButtonBox_AcceptRole
Please, can you tell me what do I must read to learn wrapper functions for QT in Harbour.
Now I use QGroupBox instead QdialogButtonBox.