Adjusted to use new QStringVariantMap type.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/2/head
Michele Calgaro 5 years ago
parent 8e3ec3023b
commit 09f45583d9
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -128,10 +128,10 @@ QVariant QSqlExtension::boundValue( int pos ) const
return values[ index[ pos ] ].value; return values[ index[ pos ] ].value;
} }
QMap<QString, QVariant> QSqlExtension::boundValues() const QStringVariantMap QSqlExtension::boundValues() const
{ {
QMap<QString, QSqlParam>::ConstIterator it; QMap<QString, QSqlParam>::ConstIterator it;
QMap<QString, QVariant> m; QStringVariantMap m;
if ( bindm == BindByName ) { if ( bindm == BindByName ) {
for ( it = values.begin(); it != values.end(); ++it ) for ( it = values.begin(); it != values.end(); ++it )
m.insert( it.key(), it.data().value ); m.insert( it.key(), it.data().value );

@ -102,7 +102,7 @@ public:
virtual QVariant parameterValue( int pos ); virtual QVariant parameterValue( int pos );
QVariant boundValue( const QString& holder ) const; QVariant boundValue( const QString& holder ) const;
QVariant boundValue( int pos ) const; QVariant boundValue( int pos ) const;
QMap<QString, QVariant> boundValues() const; QStringVariantMap boundValues() const;
void clear(); void clear();
void clearValues(); void clearValues();
void clearIndex(); void clearIndex();

@ -1173,8 +1173,8 @@ QVariant QSqlQuery::boundValue( int pos ) const
QSqlQuery query; QSqlQuery query;
... ...
// Examine the bound values - bound using named binding // Examine the bound values - bound using named binding
QMap<QString, QVariant>::ConstIterator it; QStringVariantMap::ConstIterator it;
QMap<QString, QVariant> vals = query.boundValues(); QStringVariantMap vals = query.boundValues();
for ( it = vals.begin(); it != vals.end(); ++it ) for ( it = vals.begin(); it != vals.end(); ++it )
qWarning( "Placeholder: " + it.key() + ", Value: " + (*it).toString() ); qWarning( "Placeholder: " + it.key() + ", Value: " + (*it).toString() );
... ...
@ -1189,10 +1189,10 @@ QVariant QSqlQuery::boundValue( int pos ) const
\endcode \endcode
*/ */
QMap<QString,QVariant> QSqlQuery::boundValues() const QStringVariantMap QSqlQuery::boundValues() const
{ {
if ( !d->sqlResult || !d->sqlResult->extension() ) if ( !d->sqlResult || !d->sqlResult->extension() )
return QMap<QString,QVariant>(); return QStringVariantMap();
return d->sqlResult->extension()->boundValues(); return d->sqlResult->extension()->boundValues();
} }

@ -114,7 +114,7 @@ public:
void addBindValue( const QVariant& val, QSql::ParameterType type ); void addBindValue( const QVariant& val, QSql::ParameterType type );
QVariant boundValue( const QString& placeholder ) const; QVariant boundValue( const QString& placeholder ) const;
QVariant boundValue( int pos ) const; QVariant boundValue( int pos ) const;
QMap<QString, QVariant> boundValues() const; QStringVariantMap boundValues() const;
QString executedQuery() const; QString executedQuery() const;
protected: protected:

@ -64,7 +64,7 @@ class MetaDataBaseRecord
public: public:
QObject *object; QObject *object;
QStringList changedProperties; QStringList changedProperties;
QMap<QString,QVariant> fakeProperties; QStringVariantMap fakeProperties;
QMap<QString, QString> propertyComments; QMap<QString, QString> propertyComments;
int spacing, margin; int spacing, margin;
QString resizeMode; QString resizeMode;
@ -272,14 +272,14 @@ QVariant MetaDataBase::fakeProperty( QObject * o, const QString &property)
o, o->name(), o->className() ); o, o->name(), o->className() );
return QVariant(); return QVariant();
} }
QMap<QString, QVariant>::Iterator it = r->fakeProperties.find( property ); QStringVariantMap::Iterator it = r->fakeProperties.find( property );
if ( it != r->fakeProperties.end() ) if ( it != r->fakeProperties.end() )
return r->fakeProperties[property]; return r->fakeProperties[property];
return WidgetFactory::defaultValue( o, property ); return WidgetFactory::defaultValue( o, property );
} }
QMap<QString,QVariant>* MetaDataBase::fakeProperties( QObject* o ) QStringVariantMap* MetaDataBase::fakeProperties( QObject* o )
{ {
setupDataBase(); setupDataBase();
MetaDataBaseRecord *r = db->find( (void*)o ); MetaDataBaseRecord *r = db->find( (void*)o );

@ -162,7 +162,7 @@ public:
static void setFakeProperty( QObject *o, const QString &property, const QVariant& value ); static void setFakeProperty( QObject *o, const QString &property, const QVariant& value );
static QVariant fakeProperty( QObject * o, const QString &property ); static QVariant fakeProperty( QObject * o, const QString &property );
static QMap<QString,QVariant>* fakeProperties( QObject* o ); static QStringVariantMap* fakeProperties( QObject* o );
static void setSpacing( QObject *o, int spacing ); static void setSpacing( QObject *o, int spacing );
static int spacing( QObject *o ); static int spacing( QObject *o );

@ -1501,8 +1501,8 @@ void Resource::saveObjectProperties( QObject *w, QTextStream &ts, int indent )
} }
if ( w->isWidgetType() && MetaDataBase::fakeProperties( w ) ) { if ( w->isWidgetType() && MetaDataBase::fakeProperties( w ) ) {
QMap<QString, QVariant>* fakeProperties = MetaDataBase::fakeProperties( w ); QStringVariantMap* fakeProperties = MetaDataBase::fakeProperties( w );
for ( QMap<QString, QVariant>::Iterator fake = fakeProperties->begin(); for ( QStringVariantMap::Iterator fake = fakeProperties->begin();
fake != fakeProperties->end(); ++fake ) { fake != fakeProperties->end(); ++fake ) {
if ( MetaDataBase::isPropertyChanged( w, fake.key() ) ) { if ( MetaDataBase::isPropertyChanged( w, fake.key() ) ) {
if ( w->inherits("CustomWidget") ) { if ( w->inherits("CustomWidget") ) {

Loading…
Cancel
Save