Esempio n. 1
0
 QImage *createImage(const QMatrix &matrix) const
 {
     if (type == TextButton::SIDEBAR || type == TextButton::PANEL)
         return createRoundButtonBackground(matrix);
     else
         return createArrowBackground(matrix);
 }
Esempio n. 2
0
void QmaxButton::refreshButton()
{
    QRect scaledRect;
    scaledRect = matrix.mapRect(QRect(0,0,this->logicalSize.width(),this->logicalSize.height()));
    pixImage = QImage(scaledRect.width(),scaledRect.height(),QImage::Format_ARGB32_Premultiplied);
    pixImage.fill(QColor(0,0,0,0).rgba());
    QPainter painter(&pixImage);
    painter.initFrom(this);
    if(m_nType == 0 || m_nType == 1 || m_nType == 5)
        createButton(painter);
    else if(m_nType ==2 )
        createSideButton(painter);
    else if(m_nType ==3 ){
        createArrowBackground(painter);
    }
    else if(m_nType ==4 )
        createArrowBackground(painter);

    update();

}