user_mail07
18th April 2007, 00:44
unable to drawButton using Q3Button
CMenuButtons::EnableButtons( int pIndex )
{
1. // QButton *menuButton;
=============//Replaced Line no 1. QButton with QAbstractButton in Qt 4==================
1. // QAbstractButton *menuButton;
2. int i;
3. for (i = 0; i < menuButton; i++)
{
4. menuButton = tButtonGroup->find( button[ index ] );
5. if ( menuButton != NULL )
{
if ( pIndex )
{
menuButton->show();
}
else
{
menuButton->hide();
}
}
}
}
As mentioned in documentation , QAbstractButton has no equivalent for the Q3Button::drawButton(QPainter *) virtual function. I am just confused Where i need to call drawButton( ) function to draw button. After porting code to Qt 4 , I am not able to draw button at all.
but if I replace with QButton with Q3Button I am getting error at Line 4
saying error C2440: '=' : cannot convert from 'QAbstractButton *' to 'Q3Button .
CMenuButtons::EnableButtons( int pIndex )
{
1. // QButton *menuButton;
=============//Replaced Line no 1. QButton with QAbstractButton in Qt 4==================
1. // QAbstractButton *menuButton;
2. int i;
3. for (i = 0; i < menuButton; i++)
{
4. menuButton = tButtonGroup->find( button[ index ] );
5. if ( menuButton != NULL )
{
if ( pIndex )
{
menuButton->show();
}
else
{
menuButton->hide();
}
}
}
}
As mentioned in documentation , QAbstractButton has no equivalent for the Q3Button::drawButton(QPainter *) virtual function. I am just confused Where i need to call drawButton( ) function to draw button. After porting code to Qt 4 , I am not able to draw button at all.
but if I replace with QButton with Q3Button I am getting error at Line 4
saying error C2440: '=' : cannot convert from 'QAbstractButton *' to 'Q3Button .