Beispiel #1
0
QSize Slider::sizeHint() const
  	{
      int w = _sliderSize.width() + scaleWidth();
 	return orient == Qt::Vertical ? QSize(w, 200) : QSize(200, w);
      }
//----------------------------------------------------------
void ofRectangle::scale(const ofPoint& s) {
    scaleWidth(s.x);
    scaleHeight(s.y);
}
//----------------------------------------------------------
void ofRectangle::scale(float s) {
    scaleWidth(s);
    scaleHeight(s);
}
//----------------------------------------------------------
void ofRectangle::scale(float sX, float sY) {
    scaleWidth(sX);
    scaleHeight(sY);
}
Beispiel #5
0
//------------------------------------------------------------
//
//.F    ScaleDraw::maxWidth
//      Return the maximum width of the scale for a specified QPainter
//
//.u    Syntax
//.f    int ScaleDraw::maxWidth(QPainter *p, int penWidth)
//
//.u    Parameters
//.p    const QFontMetrics& fm -- font metrics used for calculations
//      bool worst -- if TRUE, assume the worst possible case. If FALSE,
//                      calculate the real maximum width, which is more
//                      CPU intensive.
//      int penWidth -- the width of the pen that will be used to draw the scale
//
//------------------------------------------------------------
int ScaleDraw::maxWidth(const QFontMetrics& fm, bool worst, int penWidth) const
{
    return maxLabelWidth(fm,worst) + scaleWidth(penWidth);
}