

Definition at line 36 of file qprogressbar.cpp.
Public Member Functions | |
| QProgressBarPrivate () | |
| void | init () |
| QStyleOptionProgressBarV2 | getStyleOption () const |
| int | bound (int val) const |
| bool | repaintRequired () const |
Public Attributes | |
| int | minimum |
| int | maximum |
| int | value |
| Qt::Alignment | alignment |
| uint | textVisible: 1 |
| int | lastPaintedValue |
| Qt::Orientation | orientation |
| bool | invertedAppearance |
| QProgressBar::Direction | textDirection |
| QString | format |
| QProgressBarPrivate::QProgressBarPrivate | ( | ) |
Definition at line 58 of file qprogressbar.cpp.
00059 : minimum(0), maximum(100), value(-1), alignment(Qt::AlignLeft), textVisible(true), 00060 lastPaintedValue(-1), orientation(Qt::Horizontal), invertedAppearance(false), 00061 textDirection(QProgressBar::TopToBottom), format(QLatin1String("%p%")) 00062 { 00063 }
| void QProgressBarPrivate::init | ( | ) |
Definition at line 65 of file qprogressbar.cpp.
References QSizePolicy::Expanding, QSizePolicy::Fixed, orientation, QSizePolicy::transpose(), Qt::Vertical, and Qt::WA_WState_OwnSizePolicy.
00066 { 00067 Q_Q(QProgressBar); 00068 QSizePolicy sp(QSizePolicy::Expanding, QSizePolicy::Fixed); 00069 if (orientation == Qt::Vertical) 00070 sp.transpose(); 00071 q->setSizePolicy(sp); 00072 q->setAttribute(Qt::WA_WState_OwnSizePolicy, false); 00073 }
Here is the call graph for this function:

| QStyleOptionProgressBarV2 QProgressBarPrivate::getStyleOption | ( | ) | const |
Definition at line 75 of file qprogressbar.cpp.
References alignment, QStyleOptionProgressBarV2::bottomToTop, QProgressBar::BottomToTop, QStyleOption::init(), invertedAppearance, QStyleOptionProgressBarV2::invertedAppearance, maximum, QStyleOptionProgressBar::maximum, minimum, QStyleOptionProgressBar::minimum, orientation, QStyleOptionProgressBarV2::orientation, QStyleOptionProgressBar::progress, QStyleOptionProgressBar::text, QStyleOptionProgressBar::textAlignment, textDirection, textVisible, QStyleOptionProgressBar::textVisible, and value.
Referenced by repaintRequired().
00076 { 00077 QStyleOptionProgressBarV2 opt; 00078 opt.init(q_func()); 00079 00080 opt.minimum = minimum; 00081 opt.maximum = maximum; 00082 opt.progress = value; 00083 opt.textAlignment = alignment; 00084 opt.textVisible = textVisible; 00085 opt.text = q_func()->text(); 00086 opt.orientation = orientation; 00087 opt.invertedAppearance = invertedAppearance; 00088 opt.bottomToTop = (textDirection == QProgressBar::BottomToTop); 00089 00090 return opt; 00091 }
Here is the call graph for this function:

| int QProgressBarPrivate::bound | ( | int | val | ) | const [inline] |
| bool QProgressBarPrivate::repaintRequired | ( | ) | const |
Definition at line 93 of file qprogressbar.cpp.
References getStyleOption(), lastPaintedValue, maximum, minimum, QStyle::PM_ProgressBarChunkWidth, QStyle::SE_ProgressBarGroove, textVisible, value, and QRect::width().
00094 { 00095 Q_Q(const QProgressBar); 00096 if (value == lastPaintedValue) 00097 return false; 00098 00099 int valueDifference = qAbs(value - lastPaintedValue); 00100 00101 // Check if the text needs to be repainted 00102 if ((value == minimum || value == maximum) 00103 || (textVisible && valueDifference >= qAbs((maximum - minimum) / 100))) 00104 return true; 00105 00106 // Check if the bar needs to be repainted 00107 QStyleOptionProgressBarV2 opt = getStyleOption(); 00108 int cw = q->style()->pixelMetric(QStyle::PM_ProgressBarChunkWidth, &opt, q); 00109 QRect groove = q->style()->subElementRect(QStyle::SE_ProgressBarGroove, &opt, q); 00110 // This expression is basically 00111 // (valueDifference / (maximum - minimum) > cw / groove.width()) 00112 // transformed to avoid integer division. 00113 return (valueDifference * groove.width() > cw * (maximum - minimum)); 00114 }
Here is the call graph for this function:

Definition at line 43 of file qprogressbar.cpp.
Referenced by bound(), getStyleOption(), and repaintRequired().
Definition at line 44 of file qprogressbar.cpp.
Referenced by bound(), getStyleOption(), and repaintRequired().
Definition at line 45 of file qprogressbar.cpp.
Referenced by getStyleOption(), and repaintRequired().
| Qt::Alignment QProgressBarPrivate::alignment |
Definition at line 47 of file qprogressbar.cpp.
Referenced by getStyleOption(), and repaintRequired().
Definition at line 52 of file qprogressbar.cpp.
1.5.1