本文整理汇总了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();
}
}
}
示例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;
}
示例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);
}
示例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();
}
}
示例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);
}
示例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.");
}
}
示例7: qmlInfo
void DefaultWidgetContainer::setLayout(QLayout *layout)
{
if (m_widget->layout()) {
qmlInfo(m_widget) << "Cannot add a second layout";
return;
}
m_widget->setLayout(layout);
}
示例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;
}
示例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();
}
示例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();
}
示例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;
}
}
示例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();
}
}
示例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());
}
示例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());
}
}
示例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);
}
}