void MainWindow2::drumMove(){ ui->label_12->move(QPoint(ui->label_12->x() -1,25)); ui->label_15->move(QPoint(ui->label_15->x() -1,25)); ui->label_16->move(QPoint(ui->label_16->x() -1,25)); ui->label_17->move(QPoint(ui->label_17->x() -1,25)); setPlace(); }
Float2In1OutView::Float2In1OutView(Float2In1Out * comp, eViewType viewType, const QString & text, const char * name) : CompView(comp, viewType, name) { setPlace(QRect(0, 0, 5*gridX, 5*gridY)); enableRotation(true); if (viewType == SHEET_VIEW) { ComponentLayoutSimple * layout = new ComponentLayoutSimple(this); Q_CHECK_PTR(layout); layout->setMinSize(3, 5); layout->getLeft()->addSpace(1); layout->getLeft()->addConnector(comp->getInputA()); layout->getLeft()->addConnector(comp->getInputB()); layout->getRight()->addStretch(2); layout->getRight()->addConnector(comp->getOutputConnector()); layout->getRight()->addStretch(2); if (!text.isEmpty()) { new ComponentLayoutBlockContentText(layout->getBlock(), text); } } }
Boolean7SegmentView::Boolean7SegmentView(Boolean7Segment * comp, eViewType viewType) : CompViewSize(comp,viewType) { if (viewType == SHEET_VIEW) { setPlace(QRect(0, 0, 5*gridX, 6*gridY)); setMinSize(5*gridX,6*gridY); enableConnectorSpacingTop(false); enableConnectorSpacingBottom(false); // enableConnectorSpacingLeft(false); enableConnectorSpacingRight(false); } else { setPlace(QRect(0, 0, 4*gridX, 6*gridY)); setMinSize(4*gridX,6*gridY); } }
BooleanLedView::BooleanLedView(Component * comp, eViewType viewType, const char * name) : CompViewSize(comp, viewType, name) { if (viewType == SHEET_VIEW) { setPlace(QRect(0, 0, 4*gridX, 3*gridY)); enableRotation(true); setMinSize(4*gridX,3*gridY); enableConnectorSpacingTop(false); enableConnectorSpacingBottom(false); // enableConnectorSpacingLeft(false); enableConnectorSpacingRight(false); } else { setPlace(QRect(0, 0, 3*gridX, 3*gridY)); setMinSize(3*gridX,3*gridY); } }
DataRecorderView::DataRecorderView(Component * comp, eViewType viewType, const char * name) : CompView(comp,viewType,name) { setPlace(QRect(0, 0, 6*gridX, 5*gridY)); enableRotation(true); enableConnectorSpacingTop(false); enableConnectorSpacingRight(false); enableConnectorSpacingBottom(false); // enableConnectorSpacingLeft(false); }
void DetailsReply::getCategoriesForPlaceFinished() { QJsonDbRequest *request = qobject_cast<QJsonDbRequest *>(sender()); Q_ASSERT(request); QList<QJsonObject> results = request->takeResults(); QPlace p = place(); p.setCategories(JsonDb::convertJsonObjectsToCategories(results, m_engine)); setPlace(p); triggerDone(); }
Alien::Alien(Game &g){ setPlace(ZERO, ZERO, SCENE_MIN - SCENE_MAX + ALIENHOME); /*for(i = 0; i< ALIEN_PARTICLES; i++){ explosion[i] = particles(); }*/ speed = Point3f(); game = &g; setSize(4*baseRad, 4*baseRad, 4*baseRad); }
Classement& Classement::operator =(const Classement &Source) { if(this != &Source) { setId(Source.getId()); setPlace(Source.getPlace()); setTemps(Source.getTemps()); setVoilier(Source.getVoilier()); } return *this; }
// Initializes this landmark from the given landmark void QDeclarativeLandmark::setLandmark(const QLandmark& landmark) { // Elaborate but makes sure appropriate signals are sent // (this function is called when landmark updates). setPlace(landmark); // viewport, address, coordinate etc. setName(landmark.name()); setPhoneNumber(landmark.phoneNumber()); setDescription(landmark.description()); setRadius(landmark.radius()); setIconSource(landmark.iconUrl()); setUrl(landmark.url()); m_landmark = landmark; }
ConvertBoolFloatView::ConvertBoolFloatView(ConvertBoolFloat * comp, eViewType viewType, const char * name) : CompView(comp, viewType, name) { setPlace(QRect(0, 0, 5*gridX, 3*gridY)); enableConnectorSpacingTop(false); enableConnectorSpacingBottom(false); // enableConnectorSpacingLeft(false); // enableConnectorSpacingRight(false); enableRotation(true); getComponent()->getInput()->setGridPos(0,1); getComponent()->getOutput()->setGridPos(4,1); }
QDeclarativePlace::QDeclarativePlace(const QPlace &src, QDeclarativeGeoServiceProvider *plugin, QObject *parent) : QObject(parent), m_location(0), m_ratings(0), m_supplier(0), m_icon(0), m_reviewModel(0), m_imageModel(0), m_editorialModel(0), m_extendedAttributes(new QQmlPropertyMap(this)), m_contactDetails(new QDeclarativeContactDetails(this)), m_reply(0), m_plugin(plugin), m_complete(false), m_favorite(0), m_status(QDeclarativePlace::Ready) { Q_ASSERT(plugin); connect(m_contactDetails, SIGNAL(valueChanged(QString,QVariant)), this, SLOT(contactsModified(QString,QVariant))); setPlace(src); }
void DetailsReply::getPlaceFinished() { QJsonDbRequest *request = qobject_cast<QJsonDbRequest *>(sender()); Q_ASSERT(request); QList<QJsonObject> results = request->takeResults(); if (results.isEmpty()) { triggerDone(QPlaceReply::PlaceDoesNotExistError, QStringLiteral("Specified place does not exist")); return; } else { QJsonObject placeJson = results.takeFirst(); setPlace(JsonDb::convertJsonObjectToPlace(placeJson, m_engine)); QStringList categoryUuids = placeJson.value(JsonDb::CategoryUuids).toVariant().toStringList(); if (!categoryUuids.isEmpty()) db()->getCategories(categoryUuids, this, SLOT(getCategoriesForPlaceFinished())); else //don't need to retrieve categores so return the details triggerDone(); } }
QT_USE_NAMESPACE /*! \qmltype Place \instantiates QDeclarativePlace \inqmlmodule QtLocation \ingroup qml-QtLocation5-places \ingroup qml-QtLocation5-places-data \since Qt Location 5.0 \brief The Place type represents a location that is a position of interest. The Place type represents a physical location with additional metadata describing that location. Contrasted with \l Location, \l Address, and \l {coordinate} type which are used to describe where a location is. The basic properties of a Place are its \l name and \l location. Place objects are typically obtained from a search model and will generally only have their basic properties set. The \l detailsFetched property can be used to test if further property values need to be fetched from the \l Plugin. This can be done by invoking the \l getDetails() method. Progress of the fetching operation can be monitored with the \l status property, which will be set to Place.Fetching when the details are being fetched. The Place type has many properties holding information about the location. Details on how to contact the place are available from the \l contactDetails property. Convenience properties for obtaining the primary \l {primaryPhone}{phone}, \l {primaryFax}{fax}, \l {primaryEmail}{email} and \l {primaryWebsite}{website} are also available. Each place is assigned zero or more \l categories. Categories are typically used when searching for a particular kind of place, such as a restaurant or hotel. Some places have a \l ratings object, which gives an indication of the quality of the place. Place metadata is provided by a \l supplier who may require that an \l attribution message be displayed to the user when the place details are viewed. Places have an associated \l icon which can be used to represent a place on a map or to decorate a delegate in a view. Places may have additional rich content associated with them. The currently supported rich content include editorial descriptions, reviews and images. These are exposed as a set of models for retrieving the content. Editorial descriptions of the place are available from the \l editorialModel property. Reviews of the place are available from the \l reviewModel property. A gallery of pictures of the place can be accessed using the \l imageModel property. Places may have additional attributes which are not covered in the formal API. The \l extendedAttributes property provides access to these. The type of extended attributes available is specific to each \l Plugin. A Place is almost always tied to a \l plugin. The \l plugin property must be set before it is possible to call \l save(), \l remove() or \l getDetails(). The \l reviewModel, \l imageModel and \l editorialModel are only valid then the \l plugin property is set. \section2 Saving a Place If the \l Plugin supports it, the Place type can be used to save a place. First create a new Place and set its properties: \snippet declarative/places.qml Place savePlace def Then invoke the \l save() method: \snippet declarative/places.qml Place savePlace The \l status property will change to Place.Saving and then to Place.Ready if the save was successful or to Place.Error if an error occurs. If the \l placeId property is set, the backend will update an existing place otherwise it will create a new place. On success the \l placeId property will be updated with the identifier of the newly saved place. \section3 Caveats \input place-caveats.qdocinc \section3 Saving Between Plugins When saving places between plugins, there are a few things to be aware of. Some fields of a place such as the id, categories and icons are plugin specific entities. For example the categories in one manager may not be recognised in another. Therefore trying to save a place directly from one plugin to another is not possible. It is generally recommended that saving across plugins be handled as saving \l {Favorites}{favorites} as explained in the Favorites section. However there is another approach which is to create a new place, set its (destination) plugin and then use the \l copyFrom() method to copy the details of the original place. Using \l copyFrom() only copies data that is supported by the destination plugin, plugin specific data such as the place identifier is not copied over. Once the copy is done, the place is in a suitable state to be saved. The following snippet provides an example of saving a place to a different plugin using the \l copyFrom method: \snippet declarative/places.qml Place save to different plugin \section2 Removing a Place To remove a place, ensure that a Place object with a valid \l placeId property exists and call its \l remove() method. The \l status property will change to Place.Removing and then to Place.Ready if the save was successful or to Place.Error if an error occurs. \section2 Favorites The Places API supports the concept of favorites. Favorites are generally implemented by using two plugins, the first plugin is typically a read-only source of places (origin plugin) and a second read/write plugin (destination plugin) is used to store places from the origin as favorites. Each Place has a favorite property which is intended to contain the corresponding place from the destination plugin (the place itself is sourced from the origin plugin). Because both the original place and favorite instances are available, the developer can choose which properties to show to the user. For example the favorite may have a modified name which should be displayed rather than the original name. \snippet declarative/places.qml Place favorite The following demonstrates how to save a new favorite instance. A call is made to create/initialize the favorite instance and then the instance is saved. \snippet declarative/places.qml Place saveFavorite The following demonstrates favorite removal: \snippet declarative/places.qml Place removeFavorite 1 \dots \snippet declarative/places.qml Place removeFavorite 2 The PlaceSearchModel has a favoritesPlugin property. If the property is set, any places found during a search are checked against the favoritesPlugin to see if there is a corresponding favorite place. If so, the favorite property of the Place is set, otherwise the favorite property is remains null. \sa PlaceSearchModel */ QDeclarativePlace::QDeclarativePlace(QObject *parent) : QObject(parent), m_location(0), m_ratings(0), m_supplier(0), m_icon(0), m_reviewModel(0), m_imageModel(0), m_editorialModel(0), m_extendedAttributes(new QQmlPropertyMap(this)), m_contactDetails(new QDeclarativeContactDetails(this)), m_reply(0), m_plugin(0), m_complete(false), m_favorite(0), m_status(QDeclarativePlace::Ready) { connect(m_contactDetails, SIGNAL(valueChanged(QString,QVariant)), this, SLOT(contactsModified(QString,QVariant))); setPlace(QPlace()); }