⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qsqlpropertymap.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
字号:
'\" t.TH QSqlPropertyMap 3qt "9 December 2002" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQSqlPropertyMap \- Used to map widgets to SQL fields.SH SYNOPSIS\fC#include <qsqlpropertymap.h>\fR.PP.SS "Public Members".in +1c.ti -1c.BI "\fBQSqlPropertyMap\fR ()".br.ti -1c.BI "virtual \fB~QSqlPropertyMap\fR ()".br.ti -1c.BI "QVariant \fBproperty\fR ( QWidget * widget )".br.ti -1c.BI "virtual void \fBsetProperty\fR ( QWidget * widget, const QVariant & value )".br.ti -1c.BI "void \fBinsert\fR ( const QString & classname, const QString & property )".br.ti -1c.BI "void \fBremove\fR ( const QString & classname )".br.in -1c.SS "Static Public Members".in +1c.ti -1c.BI "QSqlPropertyMap * \fBdefaultMap\fR ()".br.ti -1c.BI "void \fBinstallDefaultMap\fR ( QSqlPropertyMap * map )".br.in -1c.SH DESCRIPTIONThe QSqlPropertyMap class is used to map widgets to SQL fields..PPThe SQL module uses Qt object properties to insert and extract values from editor widgets..PPThis class is used to map editors to SQL fields. This works by associating SQL editor class names to the properties used to insert and extract values to/from the editor..PPFor example, a QLineEdit can be used to edit text strings and other data types in QDataTables or QSqlForms. Several properties are defined in QLineEdit, but only the \fItext\fR property is used to insert and extract text from a QLineEdit. Both QDataTable and QSqlForm use the global QSqlPropertyMap for inserting and extracting values to and from an editor widget. The global property map defines several common widgets and properties that are suitable for many applications. You can add and remove widget properties to suit your specific needs..PPIf you want to use custom editors with your QDataTable or QSqlForm, you must install your own QSqlPropertyMap for that table or form. Example:.PP.nf.br    QSqlPropertyMap *myMap  = new QSqlPropertyMap();.br    QSqlForm        *myForm = new QSqlForm( this );.br    MyEditor myEditor( this );.br.br    // Set the QSqlForm's record buffer to the update buffer of.br    // a pre-existing QSqlCursor called 'cur'..br    myForm->setRecord( cur->primeUpdate() );.br.br    // Install the customized map.br    myMap->insert( "MyEditor", "content" );.br    myForm->installPropertyMap( myMap ); // myForm now owns myMap.br    ....br    // Insert a field into the form that uses a myEditor to edit the.br    // field 'somefield'.br    myForm->insert( &myEditor, "somefield" );.br.br    // Update myEditor with the value from the mapped database field.br    myForm->readFields();.br    ....br    // Let the user edit the form.br    ....br    // Update the database fields with the values in the form.br    myForm->writeFields();.br    ....br.fi.PPYou can also replace the global QSqlPropertyMap that is used by default. (Bear in mind that QSqlPropertyMap takes ownership of the new default map.).PP.nf.br    QSqlPropertyMap *myMap = new QSqlPropertyMap;.br.br    myMap->insert( "MyEditor", "content" );.br    QSqlPropertyMap::installDefaultMap( myMap );.br    ....br.fi.PPSee also QDataTable, QSqlForm, QSqlEditorFactory, and Database Classes..SH MEMBER FUNCTION DOCUMENTATION.SH "QSqlPropertyMap::QSqlPropertyMap ()"Constructs a QSqlPropertyMap..PPThe default property mappings used by Qt widgets are: <center>.nf.TSl - l. Widgets Property QCheckBox checked QComboBox, QListBox currentItem QDateEdit date QDateTimeEdit dateTime QTextBrowser source QButton, QDial, QLabel, QLineEdit, QMultiLineEdit, QPushButton, QRadioButton, QTextEdit, text QTimeEdit time QLCDNumber, QScrollBar QSlider, QSpinBox.TE.fi</center>.SH "QSqlPropertyMap::~QSqlPropertyMap ()\fC [virtual]\fR"Destroys the QSqlPropertyMap..PPNote that if the QSqlPropertyMap is installed with installPropertyMap() the object it was installed into, e.g. the QSqlForm, takes ownership and will delete the QSqlPropertyMap when necessary..SH "QSqlPropertyMap * QSqlPropertyMap::defaultMap ()\fC [static]\fR"Returns the application global QSqlPropertyMap..SH "void QSqlPropertyMap::insert ( const QString & classname, const QString & property )"Insert a new classname/property pair, which is used for custom SQL field editors. There \fImust\fR be a \fCQ_PROPERTY\fR clause in the \fIclassname\fR class declaration for the \fIproperty\fR..PPExample: sql/overview/custom1/main.cpp..SH "void QSqlPropertyMap::installDefaultMap ( QSqlPropertyMap * map )\fC [static]\fR"Replaces the global default property map with \fImap\fR. All QDataTable and QSqlForm instantiations will use this new map for inserting and extracting values to and from editors. \fIQSqlPropertyMap takes ownership of &#92;a map, and destroys it when it is no longer needed.\fR.SH "QVariant QSqlPropertyMap::property ( QWidget * widget )"Returns the mapped property of \fIwidget\fR as a QVariant..SH "void QSqlPropertyMap::remove ( const QString & classname )"Removes \fIclassname\fR from the map..SH "void QSqlPropertyMap::setProperty ( QWidget * widget, const QVariant & value )\fC [virtual]\fR"Sets the property of \fIwidget\fR to \fIvalue\fR..SH "SEE ALSO".BR http://doc.trolltech.com/qsqlpropertymap.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qsqlpropertymap.3qt) and the Qtversion (3.1.1).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -