| 126 | |
| 127 | |
| 128 | void TextFloat::paintEvent( QPaintEvent * _pe ) |
| 129 | { |
| 130 | QStyleOption opt; |
| 131 | opt.init( this ); |
| 132 | QPainter p( this ); |
| 133 | p.fillRect( 0, 0, width(), height(), QColor( 0, 0, 0, 0 ) ); |
| 134 | |
| 135 | /* p.setPen( p.pen().brush().color() ); |
| 136 | p.setBrush( p.background() );*/ |
| 137 | |
| 138 | p.setFont( pointSize<8>( p.font() ) ); |
| 139 | |
| 140 | style()->drawPrimitive( QStyle::PE_Widget, &opt, &p, this ); |
| 141 | |
| 142 | /* p.drawRect( 0, 0, rect().right(), rect().bottom() );*/ |
| 143 | |
| 144 | if( m_title.isEmpty() ) |
| 145 | { |
| 146 | p.drawText( opt.rect, Qt::AlignCenter, m_text ); |
| 147 | } |
| 148 | else |
| 149 | { |
| 150 | int text_x = opt.rect.left() + 2; |
| 151 | int text_y = opt.rect.top() + 12; |
| 152 | if( m_pixmap.isNull() == false ) |
| 153 | { |
| 154 | p.drawPixmap( opt.rect.topLeft() + QPoint( 5, 5 ), m_pixmap ); |
| 155 | text_x += m_pixmap.width() + 8; |
| 156 | } |
| 157 | p.drawText( text_x, text_y + 16, m_text ); |
| 158 | QFont f = p.font(); |
| 159 | f.setBold( true ); |
| 160 | p.setFont( f ); |
| 161 | p.drawText( text_x, text_y, m_title ); |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | |
| 166 |
nothing calls this directly
no test coverage detected