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


C++ QSpacerItem类代码示例

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


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

示例1: alignment

Qt::Alignment QSpacerItemProto::alignment() const
{
  QSpacerItem *item = qscriptvalue_cast<QSpacerItem*>(thisObject());
  if (item)
    return item->alignment();
  return (Qt::Alignment)0;
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:7,代码来源:qspaceritemproto.cpp

示例2:

QSpacerItem *QSpacerItemProto::spacerItem()
{
  QSpacerItem *item = qscriptvalue_cast<QSpacerItem*>(thisObject());
  if (item)
    return item->spacerItem();
  return 0;
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:7,代码来源:qspaceritemproto.cpp

示例3: expandingDirections

Qt::Orientations QSpacerItemProto::expandingDirections() const
{
  QSpacerItem *item = qscriptvalue_cast<QSpacerItem*>(thisObject());
  if (item)
    return item->expandingDirections();
  return (Qt::Orientations)0;
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:7,代码来源:qspaceritemproto.cpp

示例4: sizeHint

QSize QSpacerItemProto::sizeHint() const
{
  QSpacerItem *item = qscriptvalue_cast<QSpacerItem*>(thisObject());
  if (item)
    return item->sizeHint();
  return QSize();
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:7,代码来源:qspaceritemproto.cpp

示例5: minimumHeightForWidth

int QSpacerItemProto::minimumHeightForWidth(int w) const
{
  QSpacerItem *item = qscriptvalue_cast<QSpacerItem*>(thisObject());
  if (item)
    return item->minimumHeightForWidth(w);
  return 0;
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:7,代码来源:qspaceritemproto.cpp

示例6: setAlignment

void QSpacerItemProto::setAlignment(Qt::Alignment alignment)
{
  if (DEBUG) qDebug("QSpacerItemProto::setAlignment(%d)", (int)alignment);
  QSpacerItem *item = qscriptvalue_cast<QSpacerItem*>(thisObject());
  if (item)
    item->setAlignment(alignment);
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:7,代码来源:qspaceritemproto.cpp

示例7: isEmpty

bool QSpacerItemProto::isEmpty() const
{
  QSpacerItem *item = qscriptvalue_cast<QSpacerItem*>(thisObject());
  if (item)
    return item->isEmpty();
  return false;
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:7,代码来源:qspaceritemproto.cpp

示例8: hasHeightForWidth

bool QSpacerItemProto::hasHeightForWidth() const
{
  QSpacerItem *item = qscriptvalue_cast<QSpacerItem*>(thisObject());
  if (item)
    return item->hasHeightForWidth();
  return false;
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:7,代码来源:qspaceritemproto.cpp

示例9: geometry

QRect QSpacerItemProto::geometry() const
{
  QSpacerItem *item = qscriptvalue_cast<QSpacerItem*>(thisObject());
  if (item)
    return item->geometry();
  return QRect();
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:7,代码来源:qspaceritemproto.cpp

示例10: Py_INCREF

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

    {
        int a0;
        int a1;
        QSizePolicy::Policy a2 = QSizePolicy::Minimum;
        QSizePolicy::Policy a3 = QSizePolicy::Minimum;
        QSpacerItem *sipCpp;

        static const char *sipKwdList[] = {
            NULL,
            NULL,
            sipName_hPolicy,
            sipName_vPolicy,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, NULL, "Bii|EE", &sipSelf, sipType_QSpacerItem, &sipCpp, &a0, &a1, sipType_QSizePolicy_Policy, &a2, sipType_QSizePolicy_Policy, &a3))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->changeSize(a0,a1,a2,a3);
            Py_END_ALLOW_THREADS

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_QSpacerItem, sipName_changeSize, NULL);

    return NULL;
}
开发者ID:ClydeMojura,项目名称:android-python27,代码行数:34,代码来源:sipQtGuiQSpacerItem.cpp

示例11: sipIsDerived

static PyObject *meth_QSpacerItem_sizeHint(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;
    bool sipSelfWasArg = (!sipSelf || sipIsDerived((sipSimpleWrapper *)sipSelf));

    {
        QSpacerItem *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QSpacerItem, &sipCpp))
        {
            QSize *sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = new QSize((sipSelfWasArg ? sipCpp->QSpacerItem::sizeHint() : sipCpp->sizeHint()));
            Py_END_ALLOW_THREADS

            return sipConvertFromNewType(sipRes,sipType_QSize,NULL);
        }
    }
开发者ID:ClydeMojura,项目名称:android-python27,代码行数:19,代码来源:sipQtGuiQSpacerItem.cpp

示例12: QString

QString LayoutDumper::getLayoutItemInfo(QLayoutItem* item)
{
    QWidgetItem* wi = dynamic_cast<QWidgetItem*>(item);
    QSpacerItem* si = dynamic_cast<QSpacerItem*>(item);
    if (wi) {
        if (wi->widget()) {
            return QString("%1 [alignment: %2]")
                    .arg(getWidgetInfo(*wi->widget()))
                    .arg(toString(wi->alignment()));
        }
    } else if (si) {
        QSize hint = si->sizeHint();
        QLayout* layout = si->layout();
        return QString("QSpacerItem: sizeHint (%1 x %2), policy %3, "
                       "constraint %4, alignment %5")
                .arg(hint.width())
                .arg(hint.height())
                .arg(toString(si->sizePolicy()))
                .arg(layout ? toString(layout->sizeConstraint())
                            : "[no layout]")
                .arg(si->alignment());
    }
    return "";
}
开发者ID:RudolfCardinal,项目名称:camcops,代码行数:24,代码来源:layoutdumper.cpp

示例13: Q_D

/*!
    Sets the direction of this layout to \a direction.
*/
void QBoxLayout::setDirection(Direction direction)
{
    Q_D(QBoxLayout);
    if (d->dir == direction)
        return;
    if (horz(d->dir) != horz(direction)) {
        //swap around the spacers (the "magic" bits)
        //#### a bit yucky, knows too much.
        //#### probably best to add access functions to spacerItem
        //#### or even a QSpacerItem::flip()
        for (int i = 0; i < d->list.size(); ++i) {
            QBoxLayoutItem *box = d->list.at(i);
            if (box->magic) {
                QSpacerItem *sp = box->item->spacerItem();
                if (sp) {
                    if (sp->expandingDirections() == Qt::Orientations(0) /*No Direction*/) {
                        //spacing or strut
                        QSize s = sp->sizeHint();
                        sp->changeSize(s.height(), s.width(),
                            horz(direction) ? QSizePolicy::Fixed:QSizePolicy::Minimum,
                            horz(direction) ? QSizePolicy::Minimum:QSizePolicy::Fixed);

                    } else {
                        //stretch
                        if (horz(direction))
                            sp->changeSize(0, 0, QSizePolicy::Expanding,
                                            QSizePolicy::Minimum);
                        else
                            sp->changeSize(0, 0, QSizePolicy::Minimum,
                                            QSizePolicy::Expanding);
                    }
                }
            }
        }
    }
    d->dir = direction;
    invalidate();
}
开发者ID:FilipBE,项目名称:qtextended,代码行数:41,代码来源:qboxlayout.cpp

示例14: invalidate

void QSpacerItemProto::invalidate()
{
  QSpacerItem *item = qscriptvalue_cast<QSpacerItem*>(thisObject());
  if (item)
    item->invalidate();
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:6,代码来源:qspaceritemproto.cpp

示例15: setGeometry

void QSpacerItemProto::setGeometry(const QRect &r)
{
  QSpacerItem *item = qscriptvalue_cast<QSpacerItem*>(thisObject());
  if (item)
    item->setGeometry(r);
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:6,代码来源:qspaceritemproto.cpp


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