QVariant QueryResultValueItem::data(qint32 column, qint32 role) const { if (role == Qt::DisplayRole) return toQVariant(m_value.value()); else return QVariant(); }
void EPropertySheet::addProperty ( const char* categoryName, const char* propName, EPropertyVar* propVar ) { QStandardItem* categoryItem = getCategory ( categoryName ); int curRow = 0; if ( !categoryItem ) { curRow = mTreeModel->rowCount(); mTreeModel->setRowCount ( curRow + 1 ); categoryItem = new QStandardItem ( categoryName ); mTreeModel->setItem ( curRow, 0, categoryItem ); categoryItem->setEditable ( false ); mTreeView->expand ( categoryItem->index() ); } QList<QStandardItem*> lists; EPropertySheetTreeItem* item = new EPropertySheetTreeItem ( propName ); item->setBackground ( QBrush ( Qt::lightGray ) ); item->setEditable ( false ); lists.push_back ( item ); item = new EPropertySheetTreeItem(); item->SetExtraData ( propVar ); QVariant var; toQVariant ( propVar->mProp, var ); item->setData ( var, Qt::EditRole ); //item->setWhatsThis("WhatsThis"); //item->setStatusTip("StatusTip"); item->setToolTip("ToolTip"); //item->setData ( Qt::EditRole ,var); lists.push_back ( item ); categoryItem->appendRow ( lists ); }
void Controller::saveShares () { sf::FileSharing::FileShareInfoVec shares; { SF_SCHNEE_LOCK; shares = mModel->fileSharing()->shared(); } QSettings settings; settings.beginGroup("share"); settings.beginWriteArray("shares", shares.size()); for (size_t i = 0; i < shares.size(); i++) { settings.setArrayIndex((int)i); const sf::FileSharing::FileShareInfo & info = shares[i]; settings.setValue("shareName", qtString(info.shareName)); settings.setValue("path", qtString (info.path.toString())); settings.setValue("fileName", qtString (info.fileName)); settings.setValue("forAll", info.forAll); settings.setValue("whom", toQVariant(info.whom)); } settings.endArray(); settings.endGroup(); }
request.properties = reqlist; request.completed = [&cbFunction](AsyncRangePropertyReply* reply) { if(!reply->success) { DebugOut(DebugOut::Error)<<"bluemoney get history call failed"<<endl; return; } if(cbFunction.isCallable()) { QVariantList list; for(auto val : reply->values) { list.append(toQVariant(val)); } QJSValue val = cbFunction.engine()->toScriptValue<QVariantList>(list); cbFunction.call(QJSValueList()<<val); } delete reply; }; routingEngine->getRangePropertyAsync(request); } void BluemonkeySink::createCustomProperty(QString name, QJSValue defaultValue, int zone)