本文整理汇总了C++中QSizeF::rheight方法的典型用法代码示例。如果您正苦于以下问题:C++ QSizeF::rheight方法的具体用法?C++ QSizeF::rheight怎么用?C++ QSizeF::rheight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSizeF
的用法示例。
在下文中一共展示了QSizeF::rheight方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getMaxSize
QSizeF ContentWindowController::getMaxSize() const
{
QSizeF maxSize = getMaxContentSize();
maxSize.rwidth() *= _contentWindow->getZoomRect().size().width();
maxSize.rheight() *= _contentWindow->getZoomRect().size().height();
return maxSize;
}
示例2: updateGeometry
/**
* Reimplemented from UMLWidget::updateGeometry to calculate
* minimum size for activity widget.
*/
void ActivityWidget::updateGeometry()
{
TextItemGroup *grp = textItemGroupAt(ActivityWidget::TextGroupIndex);
QSizeF minSize = grp->minimumSize();
switch(m_activityType) {
case Invok:
minSize.rheight() += 40; // FIXME: Magic number
break;
case Initial:
case Final:
case End:
case Branch:
minSize = QSizeF(20, 20);
break;
case Param:
case Normal:
break; // Nothing to add.
}
setMinimumSize(minSize);
UMLWidget::updateGeometry();
}
示例3: updateGeometry
/**
* Reimplemented from UMLWidget::updateGeometry to calculate
* minimum size for signal widget based on the current signal type.
*/
void SignalWidget::updateGeometry()
{
QSizeF minSize = textItemGroupAt(GroupIndex)->minimumSize();
if (minSize.width() < SignalWidget::MinimumSize.width()) {
minSize.setWidth(SignalWidget::MinimumSize.width());
}
if (m_signalType == SignalWidget::Accept) {
// We need 1/3rd part for the '>' shape.(hollow or convex)
minSize.rwidth() += minSize.width() / 3 + margin();
}
else if (m_signalType == SignalWidget::Send) {
// Add one third for the '>' shape.
minSize.rwidth() += minSize.width() / 3 + margin();
}
else if (m_signalType == SignalWidget::Time) {
// In case of SignalWidget::Time add minimum height to
// calculated as the text appears below drawing.
minSize.rheight() += SignalWidget::MinimumSize.height();
}
setMinimumSize(minSize);
UMLWidget::updateGeometry();
}
示例4: applyBorder
QImage GLImageDrawable::applyBorder(const QImage& sourceImg)
{
if(renderBorder() &&
m_borderWidth > 0.001)
{
QSizeF originalSizeWithBorder = sourceImg.size();
double x = m_borderWidth * 2;
originalSizeWithBorder.rwidth() += x;
originalSizeWithBorder.rheight() += x;
QImage cache(originalSizeWithBorder.toSize(),QImage::Format_ARGB32_Premultiplied);
memset(cache.scanLine(0),0,cache.byteCount());
QPainter p(&cache);
int bw = (int)(m_borderWidth / 2);
p.drawImage(bw,bw,sourceImg); //drawImage(bw,bw,sourceImg);
p.setPen(QPen(m_borderColor,m_borderWidth));
p.drawRect(sourceImg.rect().adjusted(bw,bw,bw,bw)); //QRectF(sourceImg.rect()).adjusted(-bw,-bw,bw,bw));
m_imageWithBorder = cache;
return cache;
}
if(!m_imageWithBorder.isNull())
m_imageWithBorder = QImage();
return sourceImg;
}
示例5: on_acceptButton_clicked
void ResolutionCalculator::on_acceptButton_clicked()
{
if ((hRes>0) && (vRes>0)) {
QSizeF s = image->data()->getTransformedSizeData(ImageDataStore::PixelSize);
s.rwidth() *= hRes;
s.rheight() *= vRes;
image->data()->setTransformedSizeData(ImageDataStore::PhysicalSize, s);
}
rulers.clear();
}
示例6:
void QgsDiagramRendererV2::convertSizeToMapUnits( QSizeF& size, const QgsRenderContext& context ) const
{
if ( !size.isValid() )
{
return;
}
double pixelToMap = context.scaleFactor() * context.mapToPixel().mapUnitsPerPixel();
size.rwidth() *= pixelToMap;
size.rheight() *= pixelToMap;
}
示例7: paperRect
QRect QtopiaPrintEngine::paperRect() const
{
QSizeF s = qt_paperSizeToQSizeF(d_func()->paperSize);
s.rwidth() = MM(s.width());
s.rheight() = MM(s.height());
int w = qRound(s.width()*d_func()->resolution/72.);
int h = qRound(s.height()*d_func()->resolution/72.);
if (d_func()->orientation == QPrinter::Portrait)
return QRect(0, 0, w, h);
else
return QRect(0, 0, h, w);
}
示例8: paintMarker
void AbstractDiagram::paintMarker( QPainter* painter,
const DataValueAttributes& a,
const QModelIndex& index,
const QPointF& pos )
{
if ( !checkInvariants() || !a.isVisible() ) return;
const MarkerAttributes ma = a.markerAttributes();
if ( !ma.isVisible() ) return;
const PainterSaver painterSaver( painter );
QSizeF maSize = ma.markerSize();
const qreal diagramWidth = d->diagramSize.width();
const qreal diagramHeight = d->diagramSize.height();
switch( ma.markerSizeMode() ) {
case MarkerAttributes::AbsoluteSize:
// Unscaled, i.e. without the painter's "zoom"
maSize.rwidth() /= painter->matrix().m11();
maSize.rheight() /= painter->matrix().m22();
break;
case MarkerAttributes::AbsoluteSizeScaled:
// Keep maSize as is. It is specified directly in pixels and desired
// to be effected by the painter's "zoom".
break;
case MarkerAttributes::RelativeToDiagramWidth:
maSize *= diagramWidth;
break;
case MarkerAttributes::RelativeToDiagramHeight:
maSize *= diagramHeight;
break;
case MarkerAttributes::RelativeToDiagramWidthHeightMin:
maSize *= qMin( diagramWidth, diagramHeight );
break;
}
QBrush indexBrush( brush( index ) );
QPen indexPen( ma.pen() );
if ( ma.markerColor().isValid() )
indexBrush.setColor( ma.markerColor() );
paintMarker( painter, ma, indexBrush, indexPen, pos, maSize );
// workaround: BC cannot be changed, otherwise we would pass the
// index down to next-lower paintMarker function. So far, we
// basically save a circle of radius maSize at pos in the
// reverseMapper. This means that ^^^ this version of paintMarker
// needs to be called to reverse-map the marker.
d->reverseMapper.addCircle( index.row(), index.column(), pos, 2 * maSize );
}
示例9: dpiPaintDevice
void QgsDiagramRendererV2::convertSizeToMapUnits( QSizeF& size, const QgsRenderContext& context ) const
{
if ( !size.isValid() )
{
return;
}
int dpi = dpiPaintDevice( context.constPainter() );
if ( dpi < 0 )
{
return;
}
double pixelToMap = dpi / 25.4 * context.mapToPixel().mapUnitsPerPixel();
size.rwidth() *= pixelToMap;
size.rheight() *= pixelToMap;
}
示例10: sizeMapUnits
QSizeF QgsDiagramRenderer::sizeMapUnits( const QgsFeature& feature, const QgsRenderContext& c ) const
{
QgsDiagramSettings s;
if ( !diagramSettings( feature, c, s ) )
{
return QSizeF();
}
QSizeF size = diagramSize( feature, c );
if ( size.isValid() )
{
double width = QgsSymbolLayerUtils::convertToMapUnits( c, size.width(), s.sizeType, s.sizeScale );
size.rheight() *= width / size.width();
size.setWidth( width );
}
return size;
}
示例11: cellSize
QSizeF QuickGridDefinition::cellSize(QRectF rect, int row, int column, int rowSpan, int columnSpan)
{
QSizeF
size;
for(int end = qMin(row + rowSpan, rowCount()); row < end; row++)
{
size.rheight() += rowWeight(row) * rect.height();
}
for(int end = qMin(column + columnSpan, columnCount()); column < end; column++)
{
size.rwidth() += columnWeight(column) * rect.width();
}
return size;
}
示例12: combineSize
static inline void combineSize(QSizeF &result, const QSizeF &fallbackSize)
{
combineHints(result.rwidth(), fallbackSize.width());
combineHints(result.rheight(), fallbackSize.height());
}