当前位置: 首页>>代码示例>>C++>>正文


C++ QTextFormat::property方法代码示例

本文整理汇总了C++中QTextFormat::property方法的典型用法代码示例。如果您正苦于以下问题:C++ QTextFormat::property方法的具体用法?C++ QTextFormat::property怎么用?C++ QTextFormat::property使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QTextFormat的用法示例。


在下文中一共展示了QTextFormat::property方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: drawObject

//![1]
void SvgTextObject::drawObject(QPainter *painter, const QRectF &rect,
                               QTextDocument * /*doc*/, int /*posInDocument*/,
                               const QTextFormat &format)
{
    QImage bufferedImage = qVariantValue<QImage>(format.property(Window::SvgData));

    painter->drawImage(rect, bufferedImage);
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:9,代码来源:svgtextobject.cpp

示例2: drawObject

void CaretInterface::drawObject(QPainter *painter, const QRectF &rect, QTextDocument *, int, const QTextFormat &format)
 {         
     painter->setRenderHint(QPainter::Antialiasing, true);
     int c = format.property(Color).toInt();     
     QColor color(c & 0xff, (c & 0xff00) / 0x100, (c & 0xff0000) / 0x10000);
     QString text = format.property(Text).toString();
     painter->setFont(m_font);
     // painter->fillRect(rect, QBrush(color));
     painter->setBrush(QBrush(color));
     painter->setPen(QPen(Qt::NoPen));
     QRectF r2( rect.x(), rect.y() + 2, rect.width(), rect.height() + 2);
     painter->drawRoundedRect(r2, 3, 3);
     painter->setPen(QPen(Qt::white));
     QRectF r( rect.x() + 2, rect.y() + 3, rect.width() - 4, rect.height() - 2);
     painter->drawText(r, text);
     painter->setRenderHint(QPainter::Antialiasing, false);
 }
开发者ID:Narsil,项目名称:QWave,代码行数:17,代码来源:caret.cpp

示例3: QPoint

void
WidgetTextObject::drawObject(QPainter *painter, const QRectF &rect, QTextDocument * /*doc*/, int /*posInDocument*/, const QTextFormat &format)
{
    QWidget* widget = qVariantValue<QWidget*>(format.property( 1 ));
    widget->render( painter, QPoint( 0, 0 ));

    //Adjusted to allow for the margin
    QRect contentsRect = rect.toRect().adjusted(0, 0, -kMargin.width(), -kMargin.height());
    m_widgetRects[widget] = contentsRect;
}
开发者ID:Erkan-Yilmaz,项目名称:lastfm-desktop,代码行数:10,代码来源:WidgetTextObject.cpp

示例4: intrinsicSize

//![0]
QSizeF SvgTextObject::intrinsicSize(QTextDocument * /*doc*/, int /*posInDocument*/,
                                    const QTextFormat &format)
{
    QImage bufferedImage = qVariantValue<QImage>(format.property(Window::SvgData));
    QSize size = bufferedImage.size();
    
    if (size.height() > 25)
        size *= 25.0 / (double) size.height();

    return QSizeF(size);
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:12,代码来源:svgtextobject.cpp

示例5: formatDifference

QTextFormat HtmlExporter::formatDifference( const QTextFormat &from, const QTextFormat &to )
{
    //kDebug();

    QTextFormat diff = to;

    const QMap<int, QVariant> props = to.properties();
    for ( QMap<int, QVariant>::ConstIterator it = props.begin(), end = props.end();
            it != end; ++it )
        if ( it.value() == from.property( it.key() ) )
            diff.clearProperty( it.key() );

    return diff;
}
开发者ID:mtux,项目名称:bilbo,代码行数:14,代码来源:htmlexporter.cpp

示例6: QSizeF

QSizeF
WidgetTextObject::intrinsicSize(QTextDocument*, int /*posInDocument*/, const QTextFormat& format)
{
    QWidget* widget = qVariantValue<QWidget*>(format.property(1));
    return QSizeF( widget->size() + kMargin );
}
开发者ID:Erkan-Yilmaz,项目名称:lastfm-desktop,代码行数:6,代码来源:WidgetTextObject.cpp

示例7: intrinsicSize

QSizeF CaretInterface::intrinsicSize(QTextDocument *, int,
                                     const QTextFormat &format)
 {
     return format.property(Size).toSizeF();
 }
开发者ID:Narsil,项目名称:QWave,代码行数:5,代码来源:caret.cpp


注:本文中的QTextFormat::property方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。