All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Brief description of class still missing. More...
#include <PaintProgress.h>
Signals | |
void | repaint () |
Public Member Functions | |
const QRect & | boundingRect () const |
bool | isActive () const |
QString | message () const |
void | paint (QPainter &p, int w, int h) |
PaintProgress (QObject *parent=0) | |
void | setActive (bool a) |
Protected Member Functions | |
virtual void | paint (QString caption, int value, int maximum) |
Brief description of class still missing.
Full description of class still missing
SciFigs::PaintProgress::PaintProgress | ( | QObject * | parent = 0 | ) |
: QObject(parent) { _active=false; _updateRect.setWidth(1); // Init the size of rectangle. If not initialized, the _updateRect.setHeight(1); // update triggered by GraphContent::paintProgress() // is never achieved. }
const QRect& SciFigs::PaintProgress::boundingRect | ( | ) | const [inline] |
Referenced by SciFigs::GraphContent::setProgressEnd().
{return _updateRect;}
bool SciFigs::PaintProgress::isActive | ( | ) | const [inline] |
{return _active;}
QString SciFigs::PaintProgress::message | ( | ) | const [inline] |
{return _msg;}
void SciFigs::PaintProgress::paint | ( | QPainter & | p, |
int | w, | ||
int | h | ||
) |
{ // Called only from gui thread, _msg and _updateRect are only touched by main thread. QFont f=p.font(); f.setPointSize(8); p.setFont(f); QRect r=p.boundingRect(0, 0, w, h, Qt::TextWordWrap, _msg); int x=w/2-r.width()/2; int y=h/2-r.height()/2; p.setOpacity(0.7); p.setBrush(QBrush( Qt::white, Qt::SolidPattern) ); p.setPen(Qt::NoPen); _updateRect.setTop(y-2); _updateRect.setLeft(x-2); _updateRect.setWidth(r.width()+4); _updateRect.setHeight(r.height()+4); p.drawRect(_updateRect); p.setOpacity(1.0); p.setPen(Qt::SolidLine); p.drawText(x, y, r.width(), r.height(), Qt::TextWordWrap, _msg); }
void SciFigs::PaintProgress::paint | ( | QString | caption, |
int | value, | ||
int | maximum | ||
) | [protected, virtual] |
Only one function that can be called outside the main gui thread
Implements QGpCoreTools::AbstractProgress.
References repaint(), and QGpCoreTools::AbstractProgress::valueString().
{ if(caption.isEmpty()) { _msg=valueString(value, maximum); } else { _msg=caption +"\n"+valueString(value, maximum); } emit repaint(); }
void SciFigs::PaintProgress::repaint | ( | ) | [signal] |
Referenced by paint().
void SciFigs::PaintProgress::setActive | ( | bool | a | ) | [inline] |
Referenced by SciFigs::GraphContent::setProgressEnd().
{_active=a;}