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


C++ qmlInfo函数代码示例

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


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

示例1: childItems

/*!
    \internal
*/
void QDeclarativeGeoMapItemBase::afterChildrenChanged()
{
    QList<QQuickItem *> kids = childItems();
    if (kids.size() > 0) {
        bool printedWarning = false;
        foreach (QQuickItem *i, kids) {
            if (i->flags() & QQuickItem::ItemHasContents
                    && !qobject_cast<QDeclarativeGeoMapMouseArea *>(i)) {
                if (!printedWarning) {
                    qmlInfo(this) << "Geographic map items do not support child items";
                    printedWarning = true;
                }

                qmlInfo(i) << "deleting this child";
                i->deleteLater();
            }
        }
    }
开发者ID:agunnarsson,项目名称:qtlocation,代码行数:21,代码来源:qdeclarativegeomapitembase.cpp

示例2: qmlInfo

bool QSGAnchorsPrivate::checkVAnchorValid(QSGAnchorLine anchor) const
{
    if (!anchor.item) {
        qmlInfo(item) << QSGAnchors::tr("Cannot anchor to a null item.");
        return false;
    } else if (anchor.anchorLine & QSGAnchorLine::Horizontal_Mask) {
        qmlInfo(item) << QSGAnchors::tr("Cannot anchor a vertical edge to a horizontal edge.");
        return false;
    } else if (anchor.item != item->parentItem() && anchor.item->parentItem() != item->parentItem()){
        qmlInfo(item) << QSGAnchors::tr("Cannot anchor to an item that isn't a parent or sibling.");
        return false;
    } else if (anchor.item == item){
        qmlInfo(item) << QSGAnchors::tr("Cannot anchor item to self.");
        return false;
    }

    return true;
}
开发者ID:yinyunqiao,项目名称:qtdeclarative,代码行数:18,代码来源:qsganchors.cpp

示例3: qmlInfo

QDeclarativeGeoRoute *QDeclarativeGeoRouteModel::get(int index)
{
    if (index < 0 || index >= routes_.count()) {
        qmlInfo(this) << QStringLiteral("Error, invalid index for get():")
                      << index;
        return 0;
    }
    return routes_.at(index);
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:9,代码来源:qdeclarativegeoroutemodel.cpp

示例4: list

/*!
    \qmlmethod ListModel::insert(int index, jsobject dict)

    Adds a new item to the list model at position \a index, with the
    values in \a dict.

    \code
        fruitModel.insert(2, {"cost": 5.95, "name":"Pizza"})
    \endcode

    The \a index must be to an existing item in the list, or one past
    the end of the list (equivalent to append).

    \sa set() append()
*/
void QDeclarativeListModel::insert(int index, const QScriptValue& valuemap)
{
    if (!valuemap.isObject() || valuemap.isArray()) {
        qmlInfo(this) << tr("insert: value is not an object");
        return;
    }

    if (index < 0 || index > count()) {
        qmlInfo(this) << tr("insert: index %1 out of range").arg(index);
        return;
    }

    bool ok = m_flat ?  m_flat->insert(index, valuemap) : m_nested->insert(index, valuemap);
    if (ok && !inWorkerThread()) {
        emit itemsInserted(index, 1);
        emit countChanged();
    }
}
开发者ID:BGmot,项目名称:Qt,代码行数:33,代码来源:qdeclarativelistmodel.cpp

示例5: set

/*!
    \qmlmethod ListModel::append(jsobject dict)

    Adds a new item to the end of the list model, with the
    values in \a dict.

    \code
        fruitModel.append({"cost": 5.95, "name":"Pizza"})
    \endcode

    \sa set() remove()
*/
void QDeclarativeListModel::append(const QScriptValue& valuemap)
{
    if (!valuemap.isObject() || valuemap.isArray()) {
        qmlInfo(this) << tr("append: value is not an object");
        return;
    }

    insert(count(), valuemap);
}
开发者ID:BGmot,项目名称:Qt,代码行数:21,代码来源:qdeclarativelistmodel.cpp

示例6: update

void QDeclarativeGraphicsGeoMap::pan(int dx, int dy)
{
    if (mapData_) {
        mapData_->pan(dx, dy);
        update();
    } else {
        qmlInfo(this) << tr("Map plugin is not set, cannot pan.");
    }
}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:9,代码来源:qdeclarativegraphicsgeomap.cpp

示例7: qmlInfo

void DefaultWidgetContainer::setLayout(QLayout *layout)
{
  if (m_widget->layout()) {
    qmlInfo(m_widget) << "Cannot add a second layout";
    return;
  }

  m_widget->setLayout(layout);
}
开发者ID:seem-sky,项目名称:DeclarativeWidgets,代码行数:9,代码来源:defaultwidgetcontainer.cpp

示例8: Q_D

/*!    
    Takes a screen shot of \link target\endlink, and returns true if the screen shot is successfully saved 
    to \link fileName\endlink.
*/
bool QchScreenShot::grab() {
    Q_D(QchScreenShot);
    d->pixmap = QPixmap();
    
    QObject *obj = target();
    
    if (obj) {
        if (obj->isWidgetType()) {
            QWidget *widget = qobject_cast<QWidget*>(obj);
            
            if (widget) {
                d->pixmap = QPixmap::grabWidget(widget, targetX(), targetY(), targetWidth(), targetHeight());
            }
        }
        else if (QGraphicsObject *go = qobject_cast<QGraphicsObject*>(obj)) {
            QRect rect = go->boundingRect().toRect();
            rect.moveLeft(qMax(0, targetX()));
            rect.moveTop(qMax(0, targetY()));
            rect.setWidth(qBound(1, targetWidth(), rect.width()));
            rect.setHeight(qBound(1, targetHeight(), rect.height()));
            
            QStyleOptionGraphicsItem styleOption;
            styleOption.rect = rect;
            
            d->pixmap = QPixmap(rect.size());
            d->pixmap.fill(Qt::transparent);
            
            QPainter painter(&d->pixmap);
            go->paint(&painter, &styleOption);
        }
        else {
            qmlInfo(this) << tr("Target must be a visual item.");
            return false;
        }
    }
    else {
        d->pixmap = QPixmap::grabWindow(QApplication::desktop()->winId(), targetX(), targetY(), targetWidth(),
                                        targetHeight());
    }

    if (!d->pixmap.isNull()) {
        QString name = d->getFileName();

        if (!name.isEmpty()) {
            setFileName(name);

            if ((width() > 0) && (height() > 0)) {
                d->pixmap = d->pixmap.scaled(width(), height(), Qt::IgnoreAspectRatio,
                                             smooth() ? Qt::SmoothTransformation : Qt::FastTransformation);
            }

            return d->pixmap.save(name);
        }
    }

    return false;
}
开发者ID:marxoft,项目名称:qt-components-hildon,代码行数:61,代码来源:qchscreenshot.cpp

示例9: Q_Q

void QDeclarativeStateGroupPrivate::setCurrentStateInternal(const QString &state, 
                                                   bool ignoreTrans)
{
    Q_Q(QDeclarativeStateGroup);
    if (!componentComplete) {
        currentState = state;
        return;
    }

    if (applyingState) {
        qmlInfo(q) << "Can't apply a state change as part of a state definition.";
        return;
    }

    applyingState = true;

    QDeclarativeTransition *transition = (ignoreTrans || ignoreTrans) ? 0 : findTransition(currentState, state);
    if (stateChangeDebug()) {
        qWarning() << this << "Changing state.  From" << currentState << ". To" << state;
        if (transition)
            qWarning() << "   using transition" << transition->fromState() 
                       << transition->toState();
    }

    QDeclarativeState *oldState = 0;
    if (!currentState.isEmpty()) {
        for (int ii = 0; ii < states.count(); ++ii) {
            if (states.at(ii)->name() == currentState) {
                oldState = states.at(ii);
                break;
            }
        }
    }

    currentState = state;
    emit q->stateChanged(currentState);

    QDeclarativeState *newState = 0;
    for (int ii = 0; ii < states.count(); ++ii) {
        if (states.at(ii)->name() == currentState) {
            newState = states.at(ii);
            break;
        }
    }

    if (oldState == 0 || newState == 0) {
        if (!nullState) { nullState = new QDeclarativeState; QDeclarative_setParent_noEvent(nullState, q); }
        if (!oldState) oldState = nullState;
        if (!newState) newState = nullState;
    }

    newState->apply(q, transition, oldState);
    applyingState = false;
    if (!transition)
        static_cast<QDeclarativeStatePrivate*>(QObjectPrivate::get(newState))->complete();
}
开发者ID:mortenelund,项目名称:qt,代码行数:56,代码来源:qdeclarativestategroup.cpp

示例10: qmlInfo

void QDeclarativePolylineMapItem::removeCoordinate(const QGeoCoordinate &coordinate)
{
    int index = path_.lastIndexOf(coordinate);

    if (index == -1) {
        qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, COORD_NOT_BELONG_TO).arg("PolylineMapItem");
        return;
    }

    if (path_.count() < index + 1) {
        qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, COORD_NOT_BELONG_TO).arg("PolylineMapItem");
        return;
    }
    path_.removeAt(index);

    geometry_.markSourceDirty();
    updateMapItem();
    emit pathChanged();
}
开发者ID:amccarthy,项目名称:qtlocation,代码行数:19,代码来源:qdeclarativepolylinemapitem.cpp

示例11: qmlInfo

/*!
    \internal
*/
void QDeclarativePlaceIcon::pluginReady()
{
    QGeoServiceProvider *serviceProvider = m_plugin->sharedGeoServiceProvider();
    QPlaceManager *placeManager = serviceProvider->placeManager();
    if (!placeManager || serviceProvider->error() != QGeoServiceProvider::NoError) {
        qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, PLUGIN_ERROR)
                         .arg(m_plugin->name()).arg(serviceProvider->errorString());
        return;
    }
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:13,代码来源:qdeclarativeplaceicon.cpp

示例12: qmlInfo

void DeclarativeDBusAdaptor::componentComplete()
{
    QDBusConnection conn = DeclarativeDBus::connection(m_bus);

    // Register service name only if it has been set.
    if (!m_service.isEmpty()) {
        if (!conn.registerService(m_service)) {
            qmlInfo(this) << "Failed to register service" << m_service;
            qmlInfo(this) << conn.lastError().message();
        }
    }

    // It is still valid to publish an object on the bus without first registering a service name,
    // a remote process would have to connect directly to the DBus address.
    if (!conn.registerVirtualObject(m_path, this)) {
        qmlInfo(this) << "Failed to register object" << m_path;
        qmlInfo(this) << conn.lastError().message();
    }
}
开发者ID:jlehtoranta,项目名称:nemo-qml-plugin-dbus,代码行数:19,代码来源:declarativedbusadaptor.cpp

示例13: qmlInfo

void QDeclarativeGraphicsGeoMap::removeMapObject(QDeclarativeGeoMapObject *object)
{
    if (!mapData_)
        qmlInfo(this) << tr("Map plugin is not set, map object cannot be removed.");
    if (!mapData_ || !object || !objectMap_.contains(object->mapObject()))
        return;
    objectMap_.remove(object->mapObject());
    mapObjects_.removeOne(object);
    mapData_->removeMapObject(object->mapObject());
}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:10,代码来源:qdeclarativegraphicsgeomap.cpp

示例14: Q_D

void QQuickStateChangeScript::execute(Reason)
{
    Q_D(QQuickStateChangeScript);
    if (!d->script.isEmpty()) {
        QQmlExpression expr(d->script);
        expr.evaluate();
        if (expr.hasError())
            qmlInfo(this, expr.error());
    }
}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:10,代码来源:qquickstatechangescript.cpp

示例15: extendedScrollArea

void ScrollAreaWidgetContainer::addWidget(QWidget *widget)
{
  QScrollArea *scrollArea = extendedScrollArea();

  if (scrollArea->widget()) {
    qmlInfo(scrollArea) << "Can not add multiple Widgets to ScrollArea";
  } else {
    scrollArea->setWidget(widget);
  }
}
开发者ID:KDAB,项目名称:DeclarativeWidgets,代码行数:10,代码来源:scrollareawidgetcontainer.cpp


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