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


C++ QSizeF::isNull方法代码示例

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


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

示例1: fitFontSizeToGeometry

static qreal fitFontSizeToGeometry( const QString& text, const QFont& font, const QRectF& geometry, const TextAttributes& ta )
{
    QFont f = font;
    const qreal origResult = f.pointSizeF();
    qreal result = origResult;
    const QSizeF mySize = geometry.size();
    if ( mySize.isNull() )
        return result;

    const QString t = text;
    QFontMetrics fm( f );
    while ( true )
    {
        const QSizeF textSize = rotatedRect( fm.boundingRect( t ), ta.rotation() ).normalized().size();

        if ( textSize.height() <= mySize.height() && textSize.width() <= mySize.width() )
            return result;

        result -= 0.5;
        if ( result <= 0.0 )
            return origResult;
        f.setPointSizeF( result );
        fm = QFontMetrics( f );
    }
}
开发者ID:KDE,项目名称:kdiagram,代码行数:25,代码来源:KChartRadarDiagram.cpp

示例2:

static PyObject *slot_QSizeF___repr__(PyObject *sipSelf)
{
    QSizeF *sipCpp = reinterpret_cast<QSizeF *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_QSizeF));

    if (!sipCpp)
        return 0;


    {
        {
            PyObject * sipRes = 0;

#line 116 "C:\\Users\\marcus\\Downloads\\PyQt-gpl-5.4\\PyQt-gpl-5.4\\sip/QtCore/qsize.sip"
        if (sipCpp->isNull())
        {
        #if PY_MAJOR_VERSION >= 3
            sipRes = PyUnicode_FromString("PyQt5.QtCore.QSizeF()");
        #else
            sipRes = PyString_FromString("PyQt5.QtCore.QSizeF()");
        #endif
        }
        else
        {
            PyObject *w = PyFloat_FromDouble(sipCpp->width());
            PyObject *h = PyFloat_FromDouble(sipCpp->height());
        
            if (w && h)
            {
        #if PY_MAJOR_VERSION >= 3
                sipRes = PyUnicode_FromFormat("PyQt5.QtCore.QSizeF(%R, %R)", w, h);
        #else
                sipRes = PyString_FromString("PyQt5.QtCore.QSizeF(");
                PyString_ConcatAndDel(&sipRes, PyObject_Repr(w));
                PyString_ConcatAndDel(&sipRes, PyString_FromString(", "));
                PyString_ConcatAndDel(&sipRes, PyObject_Repr(h));
                PyString_ConcatAndDel(&sipRes, PyString_FromString(")"));
        #endif
            }
        
            Py_XDECREF(w);
            Py_XDECREF(h);
        }
#line 872 "C:\\Users\\marcus\\Downloads\\PyQt-gpl-5.4\\PyQt-gpl-5.4\\QtCore/sipQtCoreQSizeF.cpp"

            return sipRes;
        }
    }

    return 0;
}
开发者ID:rff255,项目名称:python-qt5,代码行数:50,代码来源:sipQtCoreQSizeF.cpp

示例3: setSize

void ArtisticTextShape::setSize( const QSizeF &newSize )
{
    QSizeF oldSize = size();
    if ( !oldSize.isNull() ) {
        qreal zoomX = newSize.width() / oldSize.width();
        qreal zoomY = newSize.height() / oldSize.height();
        QTransform matrix( zoomX, 0, 0, zoomY, 0, 0 );

        update();
        applyTransformation( matrix );
        update();
    }
    KoShape::setSize(newSize);
}
开发者ID:abhishekmurthy,项目名称:Calligra,代码行数:14,代码来源:ArtisticTextShape.cpp

示例4: valueToString

QString KPropertySizeFDelegate::valueToString(const QVariant& value, const QLocale &locale) const
{
    const QSizeF s(value.toSizeF());
    if (s.isNull()) {
        if (locale.language() == QLocale::C) {
            return QString();
        }
        return QObject::tr("None", "Null value");
    }
    if (locale.language() == QLocale::C) {
        return QString::fromLatin1("%1x%2").arg(s.width()).arg(s.height());
    }
    return QObject::tr("%1x%2", "Size")
        .arg(locale.toString(s.width()))
        .arg(locale.toString(s.height()));
}
开发者ID:KDE,项目名称:kproperty,代码行数:16,代码来源:sizefedit.cpp

示例5: PyBool_FromLong

static PyObject *meth_QSizeF_isNull(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        QSizeF *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QSizeF, &sipCpp))
        {
            bool sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->isNull();
            Py_END_ALLOW_THREADS

            return PyBool_FromLong(sipRes);
        }
    }
开发者ID:ClydeMojura,项目名称:android-python27,代码行数:18,代码来源:sipQtCoreQSizeF.cpp

示例6: contentFullyVisible

bool MPositionIndicatorViewPrivate::contentFullyVisible() const
{
    Q_Q(const MPositionIndicatorView);
    const QSizeF rangeSize = q->model()->range().size();
    return rangeSize.isNull();
}
开发者ID:dudochkin-victor,项目名称:libgogootouch,代码行数:6,代码来源:mpositionindicatorview.cpp


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