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


C++ QDataStream::setFloatingPointPrecision方法代码示例

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


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

示例1: readRecord


//.........这里部分代码省略.........
	    quint32 x, y;
	    stream >> x >> y;
	    mOutput->moveToEx( x, y );
            //kDebug(33100) << "xx EMR_MOVETOEX" << x << y;
	}
	break;
        case EMR_SETMETARGN:
        {
            // Takes no arguments
            mOutput->setMetaRgn();
        }
        break;
    case EMR_INTERSECTCLIPRECT:
    {
        QRect clip;
        stream >> clip;
        //kDebug(33100) << "EMR_INTERSECTCLIPRECT" << clip;
    }
    break;
    case EMR_SAVEDC:
    {
        mOutput->saveDC();
    }
    break;
    case EMR_RESTOREDC:
    {
        qint32 savedDC;
        stream >> savedDC;
        mOutput->restoreDC( savedDC );
    }
    break;
    case EMR_SETWORLDTRANSFORM:
	{
            stream.setFloatingPointPrecision(QDataStream::SinglePrecision);
	    float M11, M12, M21, M22, Dx, Dy;
	    stream >> M11;
	    stream >> M12;
	    stream >> M21;
	    stream >> M22;
	    stream >> Dx;
	    stream >> Dy;
            //kDebug(31000) << "Set world transform" << M11 << M12 << M21 << M22 << Dx << Dy;
	    mOutput->setWorldTransform( M11, M12, M21, M22, Dx, Dy );
	}
	break;
    case EMR_MODIFYWORLDTRANSFORM:
	{
            stream.setFloatingPointPrecision(QDataStream::SinglePrecision);
	    float M11, M12, M21, M22, Dx, Dy;
	    stream >> M11;
	    stream >> M12;
	    stream >> M21;
	    stream >> M22;
	    stream >> Dx;
	    stream >> Dy;
            //kDebug(31000) << "stream position after the matrix: " << stream.device()->pos();
	    quint32 ModifyWorldTransformMode;
	    stream >> ModifyWorldTransformMode;
	    mOutput->modifyWorldTransform( ModifyWorldTransformMode, M11, M12,
					   M21, M22, Dx, Dy );
	}
	break;
    case EMR_SELECTOBJECT:
	quint32 ihObject;
	stream >> ihObject;
	mOutput->selectObject( ihObject );
开发者ID:KDE,项目名称:calligra-history,代码行数:67,代码来源:EmfParser.cpp

示例2: QTransform

BitBltRecord::BitBltRecord( QDataStream &stream, quint32 recordSize )
    : m_bitmap(0)
{
    //kDebug(31000) << "stream position at the start: " << stream.device()->pos();
    //kDebug(31000) << "record size: " << recordSize;

    stream >> m_bounds;

    stream >> m_xDest;          // x, y of upper left corner of the destination.
    stream >> m_yDest;
    stream >> m_cxDest;         // width, height of the rectangle in logical coords.
    stream >> m_cyDest;
    //kDebug(31000) << "Destination" << m_xDest << m_yDest << m_cxDest << m_cyDest;

    stream >> m_BitBltRasterOperation;
    //kDebug(31000) << "bitblt raster operation:" << hex << m_BitBltRasterOperation << dec;

    stream >> m_xSrc;           // x, y of the source
    stream >> m_ySrc;
    //kDebug(31000) << "Source" << m_xSrc << m_ySrc;

    //kDebug(31000) << "position before the matrix: " << stream.device()->pos();
    stream.setFloatingPointPrecision(QDataStream::SinglePrecision);
    float M11, M12, M21, M22, Dx, Dy;
    stream >> M11;              // Transformation matrix
    stream >> M12;
    stream >> M21;
    stream >> M22;
    stream >> Dx;
    stream >> Dy;
    m_XFormSrc = QTransform( M11, M12, M21, M22, Dx, Dy );
    //kDebug(31000) << "Matrix" << m_XFormSrc;
    //kDebug(31000) << "position after the matrix: " << stream.device()->pos();

    stream >> m_red >> m_green >> m_blue >> m_reserved;
    //kDebug(31000) << "Background color" << m_red << m_green << m_blue << m_reserved;
    //kDebug(31000) << "position after background color: " << stream.device()->pos();

    stream >> m_UsageSrc;
    //kDebug(31000) << "Color table interpretation" << m_UsageSrc;

    stream >> m_offBmiSrc;      // Offset to start of bitmap header from start of record
    stream >> m_cbBmiSrc;       // Size of source bitmap header
    stream >> m_offBitsSrc;     // Offset to source bitmap from start of record
    stream >> m_cbBitsSrc;      // Size of source bitmap
#if 0
    kDebug(31000) << "header offset:" << m_offBmiSrc;
    kDebug(31000) << "header size:  " << m_cbBmiSrc;
    kDebug(31000) << "bitmap offset:" << m_offBitsSrc;
    kDebug(31000) << "bitmap size:  " << m_cbBitsSrc;
#endif

    //kDebug(31000) << "stream position before the image: " << stream.device()->pos();
    if (m_cbBmiSrc > 0) {
        m_bitmap = new Bitmap( stream, recordSize, 8 + 23 * 4, // header + 23 ints
                               m_offBmiSrc, m_cbBmiSrc,
                               m_offBitsSrc, m_cbBitsSrc );
    }

    //kDebug(31000) << "stream position at the end: " << stream.device()->pos();
}
开发者ID:abhishekmurthy,项目名称:Calligra,代码行数:61,代码来源:EmfRecords.cpp


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