response_handle_type timed_sync_send(message_priority mp, const actor& dest, const duration& rtime, Ts&&... xs) { static_assert(sizeof...(Ts) > 0, "no message to send"); return {dptr()->timed_sync_send_impl(mp, dest, rtime, std::forward<Ts>(xs)...), dptr()}; }
/*! * \property QItemModelSurfaceDataProxy::autoColumnCategories * * \brief Whether column categories are generated automatically. * * When set to \c true, the mapping ignores any explicitly set column categories * and overwrites them with automatically generated ones whenever the * data from the model is resolved. Defaults to \c{true}. */ void QItemModelSurfaceDataProxy::setAutoColumnCategories(bool enable) { if (dptr()->m_autoColumnCategories != enable) { dptr()->m_autoColumnCategories = enable; emit autoColumnCategoriesChanged(enable); } }
/*! * Constructs QItemModelSurfaceDataProxy with \a itemModel and optional \a parent. Proxy doesn't take * ownership of the \a itemModel, as typically item models are owned by other controls. */ QItemModelSurfaceDataProxy::QItemModelSurfaceDataProxy(QAbstractItemModel *itemModel, QObject *parent) : QSurfaceDataProxy(new QItemModelSurfaceDataProxyPrivate(this), parent) { dptr()->m_itemModelHandler->setItemModel(itemModel); dptr()->connectItemModelHandler(); }
/*! * \property QItemModelSurfaceDataProxy::zPosRolePattern * * \brief Whether a search and replace is done on the value mapped by the z * position role before it is used as an item position value. * * This property specifies the regular expression to find the portion of the * mapped value to replace and the zPosRoleReplace property contains the * replacement string. * * \sa zPosRole, zPosRoleReplace */ void QItemModelSurfaceDataProxy::setZPosRolePattern(const QRegExp &pattern) { if (dptr()->m_zPosRolePattern != pattern) { dptr()->m_zPosRolePattern = pattern; emit zPosRolePatternChanged(pattern); } }
/*! * \property QItemModelSurfaceDataProxy::columnCategories * * \brief The column categories for the mapping. */ void QItemModelSurfaceDataProxy::setColumnCategories(const QStringList &categories) { if (dptr()->m_columnCategories != categories) { dptr()->m_columnCategories = categories; emit columnCategoriesChanged(); } }
/*! * \property QItemModelSurfaceDataProxy::zPosRole * * \brief The item model role to map to the Z position. * * If this role is not defined, rowRole is used to determine the Z-coordinate * value of resolved \l{QSurfaceDataItem} objects. */ void QItemModelSurfaceDataProxy::setZPosRole(const QString &role) { if (dptr()->m_zPosRole != role) { dptr()->m_zPosRole = role; emit zPosRoleChanged(role); } }
void QItemModelSurfaceDataProxy::setMultiMatchBehavior(QItemModelSurfaceDataProxy::MultiMatchBehavior behavior) { if (dptr()->m_multiMatchBehavior != behavior) { dptr()->m_multiMatchBehavior = behavior; emit multiMatchBehaviorChanged(behavior); } }
/*! * \property QItemModelSurfaceDataProxy::columnRole * * \brief The item model role to map to the column category. * * In addition to defining which column the data belongs to, the value indicated by the column * role is also set as the X-coordinate value of QSurfaceDataItem when model data is resolved, * unless a separate x position role is also defined. */ void QItemModelSurfaceDataProxy::setColumnRole(const QString &role) { if (dptr()->m_columnRole != role) { dptr()->m_columnRole = role; emit columnRoleChanged(role); } }
/*! * \property QItemModelSurfaceDataProxy::yPosRoleReplace * * \brief The replace content to be used in conjunction with an y position role * pattern. * * Defaults to an empty string. For more information on how the search and * replace using regular expressions works, see the * QString::replace(const QRegExp &rx, const QString &after) * function documentation. * * \sa yPosRole, yPosRolePattern */ void QItemModelSurfaceDataProxy::setYPosRoleReplace(const QString &replace) { if (dptr()->m_yPosRoleReplace != replace) { dptr()->m_yPosRoleReplace = replace; emit yPosRoleReplaceChanged(replace); } }
response_handle_type timed_sync_send_tuple(const actor& dest, const duration& rtime, message what) { return {dptr()->timed_sync_send_tuple_impl( message_priority::normal, dest, rtime, std::move(what)), dptr()}; }
/*! * \property QItemModelSurfaceDataProxy::useModelCategories * * \brief Whether row and column roles and categories are used for mapping. * * When set to \c true, the mapping ignores row and column roles and categories, and uses * the rows and columns from the model instead. Defaults to \c{false}. */ void QItemModelSurfaceDataProxy::setUseModelCategories(bool enable) { if (dptr()->m_useModelCategories != enable) { dptr()->m_useModelCategories = enable; emit useModelCategoriesChanged(enable); } }
/*! * Takes ownership of the array \a newArray. Clears the existing array if the * new array differs from it. If the arrays are the same, this function * just triggers the arrayReset() signal. * * Passing a null array deletes the old array and creates a new empty array. */ void QScatterDataProxy::resetArray(QScatterDataArray *newArray) { if (dptr()->m_dataArray != newArray) dptr()->resetArray(newArray); emit arrayReset(); emit itemCountChanged(itemCount()); }
/*! * Removes the number of items specified by \a removeCount starting at the * position \a index. Attempting to remove items past the end of * the array does nothing. */ void QScatterDataProxy::removeItems(int index, int removeCount) { if (index >= dptr()->m_dataArray->size()) return; dptr()->removeItems(index, removeCount); emit itemsRemoved(index, removeCount); emit itemCountChanged(itemCount()); }
/*! \property QCustom3DLabel::text * * \brief The text for the label. * * Rich text is not supported. */ void QCustom3DLabel::setText(const QString &text) { if (dptr()->m_text != text) { dptr()->m_text = text; dptr()->handleTextureChange(); emit textChanged(text); emit dptr()->needUpdate(); } }
/*! \property QCustom3DLabel::facingCamera * * \brief Whether the label will always face the camera. * * Defaults to \c{false}. If set to \c{true}, rotation() * has no effect. */ void QCustom3DLabel::setFacingCamera(bool enabled) { if (dptr()->m_facingCamera != enabled) { dptr()->m_facingCamera = enabled; dptr()->m_facingCameraDirty = true; emit facingCameraChanged(enabled); emit dptr()->needUpdate(); } }
/*! \property QCustom3DLabel::font * * \brief The font to be used for the label. * * Defaults to \c{QFont("Arial", 20)}. Special formatting * (for example, outlined) is not supported. */ void QCustom3DLabel::setFont(const QFont &font) { if (dptr()->m_font != font) { dptr()->m_font = font; dptr()->handleTextureChange(); emit fontChanged(font); emit dptr()->needUpdate(); } }
/*! * Constructs QItemModelSurfaceDataProxy with \a itemModel and optional \a parent. Proxy doesn't take * ownership of the \a itemModel, as typically item models are owned by other controls. * The yPosRole role is set to \a yPosRole. * This constructor is meant to be used with models that have data properly sorted * in rows and columns already, so it also sets useModelCategories property to \c true. */ QItemModelSurfaceDataProxy::QItemModelSurfaceDataProxy(QAbstractItemModel *itemModel, const QString &yPosRole, QObject *parent) : QSurfaceDataProxy(new QItemModelSurfaceDataProxyPrivate(this), parent) { dptr()->m_itemModelHandler->setItemModel(itemModel); dptr()->m_yPosRole = yPosRole; dptr()->m_useModelCategories = true; dptr()->connectItemModelHandler(); }
/*! \property QCustom3DLabel::backgroundEnabled * * \brief Whether the label background is enabled. * * If set to \c{false}, backgroundColor() has no effect. Defaults * to \c{true}. */ void QCustom3DLabel::setBackgroundEnabled(bool enabled) { if (dptr()->m_background != enabled) { dptr()->m_background = enabled; dptr()->m_customVisuals = true; dptr()->handleTextureChange(); emit backgroundEnabledChanged(enabled); emit dptr()->needUpdate(); } }
/*! \property QCustom3DLabel::borderEnabled * * \brief Whether label borders are enabled. * * Defaults to \c{true}. */ void QCustom3DLabel::setBorderEnabled(bool enabled) { if (dptr()->m_borders != enabled) { dptr()->m_borders = enabled; dptr()->m_customVisuals = true; dptr()->handleTextureChange(); emit borderEnabledChanged(enabled); emit dptr()->needUpdate(); } }
/*! \property QCustom3DLabel::backgroundColor * * \brief The color for the label background, if enabled. * * Defaults to \c{Qt::gray}. * * \sa backgroundEnabled */ void QCustom3DLabel::setBackgroundColor(const QColor &color) { if (dptr()->m_bgrColor != color) { dptr()->m_bgrColor = color; dptr()->m_customVisuals = true; dptr()->handleTextureChange(); emit backgroundColorChanged(color); emit dptr()->needUpdate(); } }
response_handle< Subtype, typename detail::deduce_output_type< detail::type_list<Rs...>, detail::type_list<Ts...>>::type, ResponseHandleTag> sync_send_impl(message_priority prio, const typed_actor<Rs...>& dest, detail::type_list<Ts...> token, message&& what) { check_typed_input(dest, token); return {dptr()->sync_send_tuple_impl(prio, dest, std::move(what)), dptr()}; }
bool cleanup(error&& fail_state, execution_unit* ptr) override { auto me = dptr()->ctrl(); for (auto& subscription : subscriptions_) subscription->unsubscribe(me); subscriptions_.clear(); return Base::cleanup(std::move(fail_state), ptr); }
/*! * Adds the items specified by \a items to the end of the array. * * Returns the index of the first added item. */ int QScatterDataProxy::addItems(const QScatterDataArray &items) { int addIndex = dptr()->addItems(items); emit itemsAdded(addIndex, items.size()); emit itemCountChanged(itemCount()); return addIndex; }
/// Causes this actor to subscribe to the group `what`. /// The group will be unsubscribed if the actor finishes execution. void join(const group& what) { CAF_LOG_TRACE(CAF_ARG(what)); if (what == invalid_group) return; if (what->subscribe(dptr()->ctrl())) subscriptions_.emplace(what); }
/*! * Adds the item \a item to the end of the array. * * Returns the index of the added item. */ int QScatterDataProxy::addItem(const QScatterDataItem &item) { int addIndex = dptr()->addItem(item); emit itemsAdded(addIndex, 1); emit itemCountChanged(itemCount()); return addIndex; }
typename std::enable_if< !std::is_same<keep_behavior_t, typename std::decay<T0>::type>::value >::type become(T0&& x0, T1&& x1, Ts&&... xs) { behavior_type bhvr{std::forward<T0>(x0), std::forward<T1>(x1), std::forward<Ts>(xs)...}; dptr()->do_become(std::move(bhvr.unbox()), true); }
TEST(SMARTPOINTER, simplestorage) { double remember = 15.2; { double* test = new double[1]; test[0] = remember; spointer<double> dptr(test); EXPECT_EQ(dptr.use_count(), 1); dcontain::binode<spointer<double> > holder(dptr); EXPECT_EQ(dptr.use_count(), 2); } }
response_handle<Subtype, typename detail::deduce_output_type< detail::type_list<Sigs...>, detail::type_list< typename detail::implicit_conversions< typename std::decay<Ts>::type >::type...> >::type, HandleTag> sync_send(message_priority mp, const typed_actor<Sigs...>& dest, Ts&&... xs) { static_assert(sizeof...(Ts) > 0, "no message to send"); using token = detail::type_list< typename detail::implicit_conversions< typename std::decay<Ts>::type >::type...>; token tk; check_typed_input(dest, tk); return {dptr()->sync_send_impl(mp, dest, std::forward<Ts>(xs)...), dptr()}; }
TEST(SMARTPOINTER, complexstorage) { double remember = 15.2; list::queue<spointer<double> > q; { double* test = new double[1]; test[0] = remember; spointer<double> dptr(test); q.push_front(dptr); } spointer<double> nptr = q.pop_back(); EXPECT_EQ(*nptr, remember); }
void Obstacle::on_removeFromScene() { delete node_; node_ = 0; for (std::vector<dGeomID>::iterator gptr(geom_.begin()), gend(geom_.end()); gptr != gend; ++gptr) { dSpaceRemove(gStaticSpace, *gptr); dGeomDestroy(*gptr); } for (std::vector<dTriMeshDataID>::iterator dptr(tmd_.begin()), dend(tmd_.end()); dptr != dend; ++dptr) { dGeomTriMeshDataDestroy(*dptr); } }