Qt
- 4 ответа
- 0 вопросов
5
Вклад в тег
QObject::connect(UIManager::GetInstance()->GetProjectTree(),
SIGNAL(ProjectTree::AddedSolutionByUser(QString&)),
SolutionManager::GetInstance(),
SLOT(SolutionManager::AddNewSolutionByUser(QString&)));
<QObject::connect(UIManager::GetInstance()->GetProjectTree(),
SIGNAL(AddedSolutionByUser(QString&)),
SolutionManager::GetInstance(),
SLOT(AddNewSolutionByUser(QString&)));
/*----------------------------------------------------------*/
QPushButton#buttonMoveUp{
background-image: url(:/style/images/upfocusnormal.png);
background-position: center;
border: none;
width: 30px;
height: 30px;
}
QPushButton#buttonMoveUp::hover {
background-image:url(:/style/images/upfocuspressed.png);
}
QPushButton#buttonMoveUp::pressed {
background-image:url(:/style/images/upfocuspressed.png);
}
QPushButton#buttonMoveUp::!enabled {
background-image:url(:/style/images/upnormal.png);
}
/*----------------------------------------------------------*/
//---------------------------------------------------------------
void Button::paintEvent( QPaintEvent *ev )
{
QPainter painter(this);
QStyleOptionButton option;
initStyleOption(&option);
.....
}
//---------------------------------------------------------------
const QString Button::getIconSource( QStyleOption& option ) const
{
//draw icon
QString iconSource = getIconNormal();
//hover
if( option.state & QStyle::State_MouseOver)
{
iconSource = getIconHover();
}
//pressed
if( option.state & QStyle::State_Sunken )
{
iconSource = getIconPressed();
}
//checked
if( option.state & QStyle::State_On )
{
iconSource = getIconChecked();
}
//disabled
if( !(option.state & QStyle::State_Enabled) )
{
if( !getIconDisabled().isEmpty() )
{
iconSource = getIconDisabled();
}
}
return iconSource;
}