本文整理汇总了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 );
}
}
示例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;
}
示例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);
}
示例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()));
}
示例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);
}
}
示例6: contentFullyVisible
bool MPositionIndicatorViewPrivate::contentFullyVisible() const
{
Q_Q(const MPositionIndicatorView);
const QSizeF rangeSize = q->model()->range().size();
return rangeSize.isNull();
}