VW_DLL_MEMBER size_t VW_CALLING_CONV VW_HashSpaceStatic(const char16_t * s, const char16_t * h) { std::wstring_convert<std::codecvt_utf8<char16_t>, char16_t> convert; std::string sa(convert.to_bytes(s)); std::string ha(convert.to_bytes(h)); return VW_HashSpaceStaticA(sa.c_str(), ha.c_str()); }
void tst1() { ast_manager m; reg_decl_plugins(m); sort_ref s( m.mk_uninterpreted_sort(symbol("S")), m); func_decl_ref g( m.mk_func_decl(symbol("g"), s, s), m); func_decl_ref h( m.mk_func_decl(symbol("h"), s, s), m); sort * domain[2] = {s, s}; func_decl_ref f( m.mk_func_decl(symbol("f"), 2, domain, s), m); app_ref a( m.mk_const(symbol("a"), s), m); app_ref b( m.mk_const(symbol("b"), s), m); expr_ref x( m.mk_var(0, s), m); expr_ref y( m.mk_var(1, s), m); app_ref gx( m.mk_app(g, x), m); app_ref fgx_x( m.mk_app(f, gx.get(), x.get()), m); app_ref ha( m.mk_app(h, a.get()), m); app_ref gha( m.mk_app(g, ha.get()), m); app_ref fgha_ha( m.mk_app(f, gha.get(), ha.get()), m); tst_match(m, fgx_x, fgha_ha); app_ref fgha_gha( m.mk_app(f, gha.get(), gha.get()), m); tst_match(m, fgx_x, fgha_gha); app_ref fxy( m.mk_app(f, x.get(), y.get()), m); app_ref fyx( m.mk_app(f, y.get(), x.get()), m); tst_match(m, fxy, fyx); app_ref fygx( m.mk_app(f, y.get(), gx.get()), m); tst_match(m, fxy, fygx); tst_match(m, fygx, fxy); }
int main(int argc, char **argv) { int *g = ha(); printf("%d\n", *g); return 0; }
bool PageHeapTest() { palHeapAllocator ha("heap allocator"); int r; r = ha.Create((palPageAllocator*)g_PageAllocator); palAssertBreak(r == 0); ha.Destroy(); return true; }
bool StaticHeapTest() { palHeapAllocator ha("heap allocator"); int r; r = ha.Create(&g_buffer[0], MB(2)); palAssertBreak(r == 0); ha.Destroy(); return true; }
void UserInformation::update(const MumbleProto::UserStats &msg) { bRequested = false; bool showcon = false; ClientUser *cu = ClientUser::get(uiSession); if (cu) setWindowTitle(cu->qsName); if (msg.certificates_size() > 0) { showcon = true; qlCerts.clear(); for (int i=0;i<msg.certificates_size(); ++i) { const std::string &s = msg.certificates(i); QList<QSslCertificate> certs = QSslCertificate::fromData(QByteArray(s.data(), s.length()), QSsl::Der); qlCerts <<certs; } if (! qlCerts.isEmpty()) { qpbCertificate->setEnabled(true); const QSslCertificate &cert = qlCerts.last(); const QMultiMap<QSsl::AlternateNameEntryType, QString> &alts = cert.alternateSubjectNames(); if (alts.contains(QSsl::EmailEntry)) qlCertificate->setText(QStringList(alts.values(QSsl::EmailEntry)).join(tr(", "))); else qlCertificate->setText(decode_utf8_qssl_string(cert.subjectInfo(QSslCertificate::CommonName))); if (msg.strong_certificate()) { QFont f = qfCertificateFont; f.setBold(true); qlCertificate->setFont(f); } else { qlCertificate->setFont(qfCertificateFont); } } else { qpbCertificate->setEnabled(false); qlCertificate->setText(QString()); } } if (msg.has_address()) { showcon = true; HostAddress ha(msg.address()); qlAddress->setText(ha.toString()); } if (msg.has_version()) { showcon = true; const MumbleProto::Version &mpv = msg.version(); unsigned int v = mpv.version(); unsigned int major = (v >> 16) & 0xFFFF; unsigned int minor = (v >> 8) & 0xFF; unsigned int patch = (v & 0xFF); qlVersion->setText(tr("%1.%2.%3 (%4)").arg(major).arg(minor).arg(patch).arg(u8(mpv.release()))); qlOS->setText(tr("%1 (%2)").arg(u8(mpv.os())).arg(u8(mpv.os_version()))); }
double Mount::getHourAngle() { dms lst = KStarsData::Instance()->geo()->GSTtoLST( KStarsData::Instance()->clock()->utc().gst() ); dms ha( lst.Degrees() - telescopeCoord.ra().Degrees() ); double HA = ha.Hours(); if ( HA > 12.0 ) return (24 - HA); else return HA; }
void testVariant2() { QVariant var; QVariant var3; QHostAddress ha("127.0.0.1"); qVariantSetValue(var, ha); var3 = var; var3 = var; var3 = var; var3 = var; QHostAddress ha1 = var.value<QHostAddress>(); }
int main(int argc, char **argv) { int i; int modulus = 7; for (i = 1; i < argc; i++) { unsigned int v; unsigned int v_mod; v = ha(argv[i]); v_mod = v % modulus; printf("%s: 0x%08x (mod %d = 0x%08x) = %u (mod %d = %u)\n", argv[i], v, modulus, v_mod, v, modulus, v_mod); } }
bool QStreamSrv::start(quint16 port) { if(running) return false; bool ok; QHostAddress ha(QHostAddress::Any); ok = TcpServer.listen(ha,port); if(!ok) { //printf("Can't create server\n"); return false; } connect(&TcpServer,SIGNAL(newConnection()),this,SLOT(newConnection())); running=true; return true; }
int run_qt( int argc, char** argv, void (*tick)(void) ) { should_quit = 0; HaskellEventGlue heg; QApplication app( argc, argv ); QObject::connect( &app, SIGNAL(aboutToQuit()) , &heg, SLOT(aboutToQuit()) ); QTimer timer; timer.setSingleShot( false ); timer.setInterval( 5000 ); HaskellAction ha( NULL, tick ); QObject::connect( &timer, SIGNAL(timeout()) , &ha, SLOT(trigger()) ); timer.start(); heg.ready(); if ( should_quit ) { return -1; } return app.exec(); }
void Mount::updateTelescopeCoords() { double ra, dec; if (currentTelescope && currentTelescope->getEqCoords(&ra, &dec)) { telescopeCoord.setRA(ra); telescopeCoord.setDec(dec); telescopeCoord.EquatorialToHorizontal(KStarsData::Instance()->lst(), KStarsData::Instance()->geo()->lat()); raOUT->setText(telescopeCoord.ra().toHMSString()); decOUT->setText(telescopeCoord.dec().toDMSString()); azOUT->setText(telescopeCoord.az().toDMSString()); altOUT->setText(telescopeCoord.alt().toDMSString()); dms lst = KStarsData::Instance()->geo()->GSTtoLST( KStarsData::Instance()->clock()->utc().gst() ); dms ha( lst.Degrees() - telescopeCoord.ra().Degrees() ); QChar sgn('+'); if ( ha.Hours() > 12.0 ) { ha.setH( 24.0 - ha.Hours() ); sgn = '-'; } haOUT->setText( QString("%1%2").arg(sgn).arg( ha.toHMSString() ) ); lstOUT->setText(lst.toHMSString()); double currentAlt = telescopeCoord.altRefracted().Degrees(); if (minAltLimit->isEnabled() && ( currentAlt < minAltLimit->value() || currentAlt > maxAltLimit->value())) { if (currentAlt < minAltLimit->value()) { // Only stop if current altitude is less than last altitude indicate worse situation if (currentAlt < lastAlt && (abortDispatch == -1 || (currentTelescope->isInMotion()/* && ++abortDispatch > ABORT_DISPATCH_LIMIT*/))) { appendLogText(i18n("Telescope altitude is below minimum altitude limit of %1. Aborting motion...", QString::number(minAltLimit->value(), 'g', 3))); currentTelescope->Abort(); //KNotification::event( QLatin1String( "OperationFailed" )); KNotification::beep(); abortDispatch++; } } else { // Only stop if current altitude is higher than last altitude indicate worse situation if (currentAlt > lastAlt && (abortDispatch == -1 || (currentTelescope->isInMotion()/* && ++abortDispatch > ABORT_DISPATCH_LIMIT*/))) { appendLogText(i18n("Telescope altitude is above maximum altitude limit of %1. Aborting motion...", QString::number(maxAltLimit->value(), 'g', 3))); currentTelescope->Abort(); //KNotification::event( QLatin1String( "OperationFailed" )); KNotification::beep(); abortDispatch++; } } } else abortDispatch = -1; lastAlt = currentAlt; newCoords(raOUT->text(), decOUT->text(), azOUT->text(), altOUT->text()); newStatus(currentTelescope->getStatus()); if (currentTelescope->isConnected()) QTimer::singleShot(UPDATE_DELAY, this, SLOT(updateTelescopeCoords())); } }
void DetailsTable::createCoordinatesTable(SkyObject *obj, const KStarsDateTime &ut, GeoLocation *geo) { clearContents(); QTextCursor cursor = m_Document->rootFrame()->firstCursorPosition(); // Set column width constraints QVector<QTextLength> constraints; constraints << QTextLength(QTextLength::PercentageLength, 25) << QTextLength(QTextLength::PercentageLength, 25) << QTextLength(QTextLength::PercentageLength, 25) << QTextLength(QTextLength::PercentageLength, 25); m_TableFormat.setColumnWidthConstraints(constraints); // Insert table & row containing table name QTextTable *table = cursor.insertTable(4, 4, m_TableFormat); table->mergeCells(0, 0, 1, 4); QTextBlockFormat centered; centered.setAlignment(Qt::AlignCenter); table->cellAt(0, 0).firstCursorPosition().setBlockFormat(centered); table->cellAt(0, 0).firstCursorPosition().insertText(i18n("Coordinates"), m_TableTitleCharFormat); //Coordinates Section: //Don't use KLocale::formatNumber() for the epoch string, //because we don't want a thousands-place separator! QString sEpoch = QString::number(ut.epoch(), 'f', 1); //Replace the decimal point with localized decimal symbol sEpoch.replace('.', KGlobal::locale()->decimalSymbol()); table->cellAt(1, 0).firstCursorPosition().insertText(i18n("RA (%1):", sEpoch), m_ItemNameCharFormat); table->cellAt(1, 0).firstCursorPosition().setBlockFormat(centered); table->cellAt(1, 1).firstCursorPosition().insertText(obj->ra().toHMSString(), m_ItemValueCharFormat); table->cellAt(2, 0).firstCursorPosition().insertText(i18n("Dec (%1):", sEpoch), m_ItemNameCharFormat); table->cellAt(2, 0).firstCursorPosition().setBlockFormat(centered); table->cellAt(2, 1).firstCursorPosition().insertText(obj->dec().toDMSString(), m_ItemValueCharFormat); table->cellAt(3, 0).firstCursorPosition().insertText(i18n("Hour angle:"), m_ItemNameCharFormat); table->cellAt(3, 0).firstCursorPosition().setBlockFormat(centered); //Hour Angle can be negative, but dms HMS expressions cannot. //Here's a kludgy workaround: dms lst = geo->GSTtoLST(ut.gst()); dms ha(lst.Degrees() - obj->ra().Degrees()); QChar sgn('+'); if(ha.Hours() > 12.0) { ha.setH(24.0 - ha.Hours()); sgn = '-'; } table->cellAt(3, 1).firstCursorPosition().insertText(QString("%1%2").arg(sgn).arg(ha.toHMSString()), m_ItemValueCharFormat); table->cellAt(1, 2).firstCursorPosition().insertText(i18n("Azimuth:"), m_ItemNameCharFormat); table->cellAt(1, 2).firstCursorPosition().setBlockFormat(centered); table->cellAt(1, 3).firstCursorPosition().insertText(obj->az().toDMSString(), m_ItemValueCharFormat); table->cellAt(2, 2).firstCursorPosition().insertText(i18n("Altitude:"), m_ItemNameCharFormat); table->cellAt(2, 2).firstCursorPosition().setBlockFormat(centered); dms a; if(Options::useAltAz()) { a = obj->alt(); } else { a = obj->altRefracted(); } table->cellAt(2, 3).firstCursorPosition().insertText(a.toDMSString(), m_ItemValueCharFormat); table->cellAt(3, 2).firstCursorPosition().insertText(i18n("Airmass:"), m_ItemNameCharFormat); table->cellAt(3, 2).firstCursorPosition().setBlockFormat(centered); //Airmass is approximated as the secant of the zenith distance, //equivalent to 1./sin(Alt). Beware of Inf at Alt=0! QString aMassStr; if(obj->alt().Degrees() > 0.0) { aMassStr = KGlobal::locale()->formatNumber(1./sin(obj->alt().radians() ), 2); } else { aMassStr = "--"; } table->cellAt(3, 3).firstCursorPosition().insertText(aMassStr, m_ItemValueCharFormat); // Restore the position and other time-dependent parameters obj->recomputeCoords(ut, geo); }
void UserInformation::update(const MumbleProto::UserStats &msg) { bRequested = false; bool showcon = false; ClientUser *cu = ClientUser::get(uiSession); if (cu) setWindowTitle(cu->qsName); if (msg.certificates_size() > 0) { showcon = true; qlCerts.clear(); for (int i=0;i<msg.certificates_size(); ++i) { const std::string &s = msg.certificates(i); QList<QSslCertificate> certs = QSslCertificate::fromData(QByteArray(s.data(), s.length()), QSsl::Der); qlCerts <<certs; } if (! qlCerts.isEmpty()) { qpbCertificate->setEnabled(true); const QSslCertificate &cert = qlCerts.last(); const QMultiMap<QSsl::AlternateNameEntryType, QString> &alts = cert.alternateSubjectNames(); if (alts.contains(QSsl::EmailEntry)) qlCertificate->setText(QStringList(alts.values(QSsl::EmailEntry)).join(tr(", "))); else qlCertificate->setText(decode_utf8_qssl_string(cert.subjectInfo(QSslCertificate::CommonName))); if (msg.strong_certificate()) { QFont f = qfCertificateFont; f.setBold(true); qlCertificate->setFont(f); } else { qlCertificate->setFont(qfCertificateFont); } } else { qpbCertificate->setEnabled(false); qlCertificate->setText(QString()); } } if (msg.has_address()) { showcon = true; HostAddress ha(msg.address()); qlAddress->setText(ha.toString()); } if (msg.has_version()) { showcon = true; const MumbleProto::Version &mpv = msg.version(); qlVersion->setText(tr("%1 (%2)").arg(MumbleVersion::toString(mpv.version())).arg(u8(mpv.release()))); qlOS->setText(tr("%1 (%2)").arg(u8(mpv.os())).arg(u8(mpv.os_version()))); } if (msg.celt_versions_size() > 0) { QStringList qsl; for (int i=0;i<msg.celt_versions_size(); ++i) { int v = msg.celt_versions(i); CELTCodec *cc = g.qmCodecs.value(v); if (cc) qsl << cc->version(); else qsl << QString::number(v, 16); } qlCELT->setText(qsl.join(tr(", "))); } if (msg.has_opus()) { qlOpus->setText(msg.opus() ? tr("Supported") : tr("Not Supported")); } if (showcon) qgbConnection->setVisible(true); qlTCPCount->setText(QString::number(msg.tcp_packets())); qlUDPCount->setText(QString::number(msg.udp_packets())); qlTCPAvg->setText(QString::number(msg.tcp_ping_avg(), 'f', 2)); qlUDPAvg->setText(QString::number(msg.udp_ping_avg(), 'f', 2)); qlTCPVar->setText(QString::number(msg.tcp_ping_var() > 0.0f ? sqrtf(msg.tcp_ping_var()) : 0.0f, 'f', 2)); qlUDPVar->setText(QString::number(msg.udp_ping_var() > 0.0f ? sqrtf(msg.udp_ping_var()) : 0.0f, 'f', 2)); if (msg.has_from_client() && msg.has_from_server()) { qgbUDP->setVisible(true); const MumbleProto::UserStats_Stats &from = msg.from_client(); qlFromGood->setText(QString::number(from.good())); qlFromLate->setText(QString::number(from.late())); qlFromLost->setText(QString::number(from.lost())); qlFromResync->setText(QString::number(from.resync())); const MumbleProto::UserStats_Stats &to = msg.from_server(); qlToGood->setText(QString::number(to.good())); qlToLate->setText(QString::number(to.late())); qlToLost->setText(QString::number(to.lost())); qlToResync->setText(QString::number(to.resync())); quint32 allFromPackets = from.good() + from.late() + from.lost(); qlFromLatePercent->setText(QString::number(allFromPackets > 0 ? from.late() * 100.0f / allFromPackets : 0.f, 'f', 2)); qlFromLostPercent->setText(QString::number(allFromPackets > 0 ? from.lost() * 100.0f / allFromPackets : 0.f, 'f', 2)); quint32 allToPackets = to.good() + to.late() + to.lost(); qlToLatePercent->setText(QString::number(allToPackets > 0 ? to.late() * 100.0f / allToPackets : 0.f, 'f', 2)); qlToLostPercent->setText(QString::number(allToPackets > 0 ? to.lost() * 100.0f / allToPackets : 0.f, 'f', 2)); } else { qgbUDP->setVisible(false); } if (msg.has_onlinesecs()) { if (msg.has_idlesecs()) qlTime->setText(tr("%1 online (%2 idle)").arg(secsToString(msg.onlinesecs()), secsToString(msg.idlesecs()))); else qlTime->setText(tr("%1 online").arg(secsToString(msg.onlinesecs()))); } if (msg.has_bandwidth()) { qlBandwidth->setVisible(true); qliBandwidth->setVisible(true); qlBandwidth->setText(tr("%1 kbit/s").arg(msg.bandwidth() / 125.0f, 0, 'f', 1)); } else { qlBandwidth->setVisible(false); qliBandwidth->setVisible(false); qlBandwidth->setText(QString()); } }
int main(int argc, char* argv[]) { if (argc != EXPECTED_ARGC) { std::cout << "ERROR: Expected " << EXPECTED_ARGC-1 << " arguments, got " << argc-1 << std::endl; std::cout << "Usage is: zcta.exe [processed data file] [output file]" << std::endl; return 1; } std::cout << "Setting up custom memory allocation... " << std::endl; initGMPMemoryFunctions(); std::cout << "Testing the math (sanity check on GMP)... " <<std::endl; test_atan2(); testHorizontalPointComparator(); testHorizontalLineComparator(); testVerticalPointComparator(); testVerticalLineComparator(); try { boost::unordered_set<ZCTA> zctas; boost::unordered_set<ZCTASegment> segments; boost::timer t1; std::cout << "Reading and reconstituting data from " << argv[DATA_FILE_INDEX] << std::endl; { std::ifstream data(argv[DATA_FILE_INDEX]); boost::unordered_map<ZCTA, std::vector<LineSegment> > blob; data >> blob; for (boost::unordered_map<ZCTA, std::vector<LineSegment> >::const_iterator i = blob.cbegin(); i != blob.cend(); ++i) { zctas.insert(i->first); const std::vector<LineSegment>& vec = i->second; for (int j = 0; j < vec.size(); j++) segments.insert(ZCTASegment(vec[j], i->first)); } } std::cout << "Loaded data in " << t1.elapsed() << std::endl; std::cout << zctas.size() << " ZCTAs with " << segments.size() << " segments" << std::endl; #ifdef REMOVE_HH_ZCTAS t1.restart(); { std::vector<boost::unordered_set<ZCTA>::iterator> iters; for (boost::unordered_set<ZCTA>::iterator i = zctas.begin(); i != zctas.end(); i++) if (i->id().find("HH") != std::string::npos) iters.push_back(i); for (int i = 0; i < iters.size(); i++) zctas.erase(iters[i]); } { std::vector<boost::unordered_set<ZCTASegment>::iterator> iters; for (boost::unordered_set<ZCTASegment>::iterator i = segments.begin(); i != segments.end(); i++) if (i->zcta().id().find("HH") != std::string::npos) iters.push_back(i); for (int i = 0; i < iters.size(); i++) segments.erase(iters[i]); } std::cout << "Removed HH ZCTAs in " << t1.elapsed() << std::endl; std::cout << zctas.size() << " ZCTAs with " << segments.size() << " segments" << std::endl; #endif AdjacencySet hadj; HorizontalAlgorithm ha(segments, ADJACENCY_TOLERANCE, &hadj); t1.restart(); ha(); std::cout << "Computed with horizontal sweep line in " << t1.elapsed() << ": " << hadj.size() << " adjacencies" << std::endl; AdjacencySet vadj; VerticalAlgorithm va(segments, ADJACENCY_TOLERANCE, &vadj); t1.restart(); va(); std::cout << "Computed with vertical sweep line in " << t1.elapsed() << ": " << vadj.size() << " adjacencies" << std::endl; t1.restart(); vadj.merge(hadj); std::cout << "Merged adjacency sets in " << t1.elapsed() << std::endl; std::cout << "Total adjacencies: " << vadj.size() << std::endl; std::cout << "Writing output to " << argv[OUTPUT_FILE_INDEX] << std::endl; print(argv[OUTPUT_FILE_INDEX], zctas, vadj); } catch(std::exception& e) { std::cout << e.what() << std::endl; } return 0; }
VW_DLL_MEMBER size_t VW_CALLING_CONV VW_HashFeatureStatic(const char16_t * s, unsigned long u, const char16_t * h, unsigned int num_bits) { std::wstring_convert<std::codecvt_utf8<char16_t>, char16_t> convert; std::string sa(convert.to_bytes(s)); std::string ha(convert.to_bytes(h)); return VW_HashFeatureStaticA(sa.c_str(), u, ha.c_str(), num_bits); }
void h_test() { ha(h1); hb(h1); }
QQuickStateOperation::ActionList QQuickParentChange::actions() { Q_D(QQuickParentChange); if (!d->target || !d->parent) return ActionList(); ActionList actions; QQuickAction a; a.event = this; actions << a; if (d->xString.isValid()) { bool ok = false; qreal x = d->xString.value.numberLiteral(&ok); if (ok) { QQuickAction xa(d->target, QLatin1String("x"), x); actions << xa; } else { QQmlBinding *newBinding = new QQmlBinding(d->xString.value, d->target, qmlContext(this)); QQmlProperty property(d->target, QLatin1String("x")); newBinding->setTarget(property); QQuickAction xa; xa.property = property; xa.toBinding = QQmlAbstractBinding::getPointer(newBinding); xa.fromValue = xa.property.read(); xa.deletableToBinding = true; actions << xa; } } if (d->yString.isValid()) { bool ok = false; qreal y = d->yString.value.numberLiteral(&ok); if (ok) { QQuickAction ya(d->target, QLatin1String("y"), y); actions << ya; } else { QQmlBinding *newBinding = new QQmlBinding(d->yString.value, d->target, qmlContext(this)); QQmlProperty property(d->target, QLatin1String("y")); newBinding->setTarget(property); QQuickAction ya; ya.property = property; ya.toBinding = QQmlAbstractBinding::getPointer(newBinding); ya.fromValue = ya.property.read(); ya.deletableToBinding = true; actions << ya; } } if (d->scaleString.isValid()) { bool ok = false; qreal scale = d->scaleString.value.numberLiteral(&ok); if (ok) { QQuickAction sa(d->target, QLatin1String("scale"), scale); actions << sa; } else { QQmlBinding *newBinding = new QQmlBinding(d->scaleString.value, d->target, qmlContext(this)); QQmlProperty property(d->target, QLatin1String("scale")); newBinding->setTarget(property); QQuickAction sa; sa.property = property; sa.toBinding = QQmlAbstractBinding::getPointer(newBinding); sa.fromValue = sa.property.read(); sa.deletableToBinding = true; actions << sa; } } if (d->rotationString.isValid()) { bool ok = false; qreal rotation = d->rotationString.value.numberLiteral(&ok); if (ok) { QQuickAction ra(d->target, QLatin1String("rotation"), rotation); actions << ra; } else { QQmlBinding *newBinding = new QQmlBinding(d->rotationString.value, d->target, qmlContext(this)); QQmlProperty property(d->target, QLatin1String("rotation")); newBinding->setTarget(property); QQuickAction ra; ra.property = property; ra.toBinding = QQmlAbstractBinding::getPointer(newBinding); ra.fromValue = ra.property.read(); ra.deletableToBinding = true; actions << ra; } } if (d->widthString.isValid()) { bool ok = false; qreal width = d->widthString.value.numberLiteral(&ok); if (ok) { QQuickAction wa(d->target, QLatin1String("width"), width); actions << wa; } else { QQmlBinding *newBinding = new QQmlBinding(d->widthString.value, d->target, qmlContext(this)); QQmlProperty property(d->target, QLatin1String("width")); newBinding->setTarget(property); QQuickAction wa; wa.property = property; wa.toBinding = QQmlAbstractBinding::getPointer(newBinding); wa.fromValue = wa.property.read(); wa.deletableToBinding = true; actions << wa; } } if (d->heightString.isValid()) { bool ok = false; qreal height = d->heightString.value.numberLiteral(&ok); if (ok) { QQuickAction ha(d->target, QLatin1String("height"), height); actions << ha; } else { QQmlBinding *newBinding = new QQmlBinding(d->heightString.value, d->target, qmlContext(this)); QQmlProperty property(d->target, QLatin1String("height")); newBinding->setTarget(property); QQuickAction ha; ha.property = property; ha.toBinding = QQmlAbstractBinding::getPointer(newBinding); ha.fromValue = ha.property.read(); ha.deletableToBinding = true; actions << ha; } } return actions; }