分类: C/C++
2009-05-12 13:07:03
void myProgressBar::paintEvent( *pe) { Q_UNUSED(pe); pb_rect = this->geometry(); pb_color; m_shadow; gradcolorH1; gradcolorH2; int value; int max; int margin = 0; int altezza_nor; max = this->maximum(); value = this->value(); altezza_nor = (value*pb_rect.height())/max; painter(this); painter.setRenderHint(::Antialiasing); m_shadow = (19, 79, 236); pb_color = (139, 213, 252); gradcolorH1 = m_shadow; gradcolorH2 = pb_color; //outline painter.setPen(((Qt::black), pb_rect.width())); outline; outline.addRoundRect(0, 0, pb_rect.width(), pb_rect.height(), 0, 0); painter.setOpacity(1); painter.drawPath(outline); // gradient gradient(margin, pb_rect.height() - altezza_nor + margin, pb_rect.width() - margin, pb_rect.height() -margin); gradient.setColorAt(0.0, pb_color); gradient.setColorAt(1.0, m_shadow); brush(gradient); painter.setBrush(brush); painter.setPen(((pb_color), 5.0)); painter.setOpacity(1); painter.drawRoundRect(margin, pb_rect.height() - altezza_nor + margin, pb_rect.width() - margin, pb_rect.height() -margin,0,0);//pb_rect.height() - 2, 0, 0); // gradient gradientH(0, (pb_rect.height() - altezza_nor)/2, pb_rect.width(), (pb_rect.height() - altezza_nor)/2); gradientH.setColorAt(0.0, gradcolorH1); gradientH.setColorAt(0.2, gradcolorH2); gradientH.setColorAt(0.8, gradcolorH2); gradientH.setColorAt(1.0, gradcolorH1); brushH(gradientH); painter.setBrush(brushH); painter.setOpacity(0.3); painter.drawRoundRect(margin, pb_rect.height() - altezza_nor, pb_rect.width() - margin, pb_rect.height() -margin,0,0);//pb_rect.height() - 2, 0, 0); }
chinaunix网友2009-05-12 21:43:56
C:\Documents and Settings\Administrator>nslookup www.qtcn.org Server: gjjline.bta.net.cn Address: 202.106.0.20 Non-authoritative answer: Name: www.qtcn.org Address: 122.200.80.171