示例#1
0
/*!
    Replaces the global default property map with \a map. All
    Q3DataTable and Q3SqlForm instantiations will use this new map for
    inserting and extracting values to and from editors.
    \e{Q3SqlPropertyMap takes ownership of \a map, and destroys it
    when it is no longer needed.}
*/
void Q3SqlPropertyMap::installDefaultMap(Q3SqlPropertyMap * map)
{
    if(map == 0) return;

    if(defaultmap != 0){
        qsql_cleanup_property_map.remove(&defaultmap);
        delete defaultmap;
    }
    defaultmap = map;
    qsql_cleanup_property_map.add(&defaultmap);
}
示例#2
0
void Q3EditorFactory::installDefaultFactory(Q3EditorFactory * factory)
{
    if(factory == 0 || factory == defaultfactory) return;

    if(defaultfactory != 0){
        q_cleanup_editor_factory.remove(&defaultfactory);
        delete defaultfactory;
    }
    defaultfactory = factory;
    q_cleanup_editor_factory.add(&defaultfactory);
}