<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # QDeclarativeProperty Class Reference ## [[QtDeclarative](index.htm) module] 該QDeclarativeProperty類文摘從QML創建的對象訪問屬性。[More...](#details) ### Types * `enum PropertyTypeCategory { InvalidCategory, List, Object, Normal }` * `enum Type { Invalid, Property, SignalProperty }` ### Methods * `__init__ (self)` * `__init__ (self, QObject)` * `__init__ (self, QObject, QDeclarativeContext)` * `__init__ (self, QObject, QDeclarativeEngine)` * `__init__ (self, QObject, QString)` * `__init__ (self, QObject, QString, QDeclarativeContext)` * `__init__ (self, QObject, QString, QDeclarativeEngine)` * `__init__ (self, QDeclarativeProperty)` * `bool connectNotifySignal (self, QObject?dest, SLOT()SLOT()?slot)` * `bool connectNotifySignal (self, callable?dest)` * `bool connectNotifySignal (self, QObject?dest, int?method)` * `bool hasNotifySignal (self)` * `int index (self)` * `bool isDesignable (self)` * `bool isProperty (self)` * `bool isResettable (self)` * `bool isSignalProperty (self)` * `bool isValid (self)` * `bool isWritable (self)` * `QMetaMethod method (self)` * `QString name (self)` * `bool needsNotifySignal (self)` * `QObject object (self)` * `QMetaProperty property (self)` * `int propertyType (self)` * `PropertyTypeCategory propertyTypeCategory (self)` * `str propertyTypeName (self)` * `QVariant read (self)` * `bool reset (self)` * `Type type (self)` * `bool write (self, QVariant)` ### Static Methods * `QVariant read (QObject, QString)` * `QVariant read (QObject, QString, QDeclarativeContext)` * `QVariant read (QObject, QString, QDeclarativeEngine)` * `bool write (QObject, QString, QVariant)` * `bool write (QObject, QString, QVariant, QDeclarativeContext)` * `bool write (QObject, QString, QVariant, QDeclarativeEngine)` ### Special Methods * `bool __eq__ (self, QDeclarativeProperty)` * `int __hash__ (self)` * `bool __ne__ (self, QDeclarativeProperty)` * * * ## Detailed Description 該QDeclarativeProperty類文摘從QML創建的對象訪問屬性。 由于QML使用Qt的元類型系統中所有現有的[QMetaObject](qmetaobject.html)類可以用來反思,并與QML創建的對象進行交互。然而,一些通過QML提供的新功能 - 如類型安全和附加屬性 - 是最容易通過簡化他們的一些自然的復雜性QDeclarativeProperty類中使用。 不像[QMetaProperty](qmetaproperty.html)它代表一個類類型的屬性, QDeclarativeProperty封裝在一個特定的對象實例的屬性。要讀取一個屬性值,程序員創建一個QDeclarativeProperty實例,并調用[read](qdeclarativeproperty.html#read)()方法。同樣寫一個屬性值[write](qdeclarativeproperty.html#write)()方法被使用。 例如,對于下面的QML代碼: ``` // MyItem.qml import QtQuick 1.0 [Text](index.htm) { text: "A bit of text" } ``` 該[Text](index.htm)對象的屬性可以用QDeclarativeProperty進行訪問,如下所示: ``` #include <QDeclarativeProperty> #include <QGraphicsObject> ... [QDeclarativeView](qdeclarativeview.html) view([QUrl](qurl.html).fromLocalFile("MyItem.qml")); QDeclarativeProperty property(view.rootObject(), "font.pixelSize"); qWarning() << "Current pixel size:" << property.read().toInt(); property.write(24); qWarning() << "Pixel size should now be 24:" << property.read().toInt(); ``` * * * ## Type Documentation ``` QDeclarativeProperty.PropertyTypeCategory ``` 此枚舉指定一個類別的QML屬性。 | Constant | Value | Description | | --- | --- | --- | | `QDeclarativeProperty.InvalidCategory` | `0` | 該屬性是無效的,或者是一個信號特性。 | | `QDeclarativeProperty.List` | `1` | 該屬性是一個[QDeclarativeListProperty](index.htm)列表屬性 | | `QDeclarativeProperty.Object` | `2` | 該屬性是一個[QObject](qobject.html)派生類型的指針 | | `QDeclarativeProperty.Normal` | `3` | 該屬性是一個正常的值屬性。 | ``` QDeclarativeProperty.Type ``` 此枚舉指定類型QML屬性。 | Constant | Value | Description | | --- | --- | --- | | `QDeclarativeProperty.Invalid` | `0` | 該屬性無效。 | | `QDeclarativeProperty.Property` | `1` | 該屬性是一個普通的Qt屬性。 | | `QDeclarativeProperty.SignalProperty` | `2` | 該屬性是一個信號特性。 | * * * ## Method Documentation ``` QDeclarativeProperty.__init__ (self) ``` 創建一個無效的[QDeclarativeProperty](qdeclarativeproperty.html)。 ``` QDeclarativeProperty.__init__ (self, QObject) ``` 創建[QDeclarativeProperty](qdeclarativeproperty.html)為默認屬性_obj_。如果沒有默認屬性,無效[QDeclarativeProperty](qdeclarativeproperty.html)將被創建。 ``` QDeclarativeProperty.__init__ (self, QObject, QDeclarativeContext) ``` 創建[QDeclarativeProperty](qdeclarativeproperty.html)為默認屬性_obj_使用[context](qdeclarativecontext.html) _ctxt_。如果沒有默認屬性,無效[QDeclarativeProperty](qdeclarativeproperty.html)將被創建。 ``` QDeclarativeProperty.__init__ (self, QObject, QDeclarativeEngine) ``` 創建[QDeclarativeProperty](qdeclarativeproperty.html)為默認屬性_obj_使用環境的實例,是由提供的QML組件_engine_。如果沒有默認屬性,無效[QDeclarativeProperty](qdeclarativeproperty.html)將被創建。 ``` QDeclarativeProperty.__init__ (self, QObject, QString) ``` 創建[QDeclarativeProperty](qdeclarativeproperty.html)該物業_name_的_obj_。 ``` QDeclarativeProperty.__init__ (self, QObject, QString, QDeclarativeContext) ``` 創建[QDeclarativeProperty](qdeclarativeproperty.html)該物業_name_的_obj_使用[context](qdeclarativecontext.html) _ctxt_。 創建[QDeclarativeProperty](qdeclarativeproperty.html)沒有上下文會使一些特性 - 像附加屬性 - 無法訪問。 ``` QDeclarativeProperty.__init__ (self, QObject, QString, QDeclarativeEngine) ``` 創建[QDeclarativeProperty](qdeclarativeproperty.html)該物業_name_的_obj_使用環境的實例,是由提供的QML組件_engine_。 ``` QDeclarativeProperty.__init__ (self, QDeclarativeProperty) ``` 創建副本_other_。 ``` bool QDeclarativeProperty.connectNotifySignal (self, QObject?dest, SLOT()SLOT()?slot) ``` 該屬性的改變通知信號連接到指定的_slot_的_dest_對象并返回True 。返回False,如果該元屬性并不代表定期Qt的屬性,或者如果它沒有改變通知信號,或者如果_dest_對象不具有指定的_slot_。 ``` bool QDeclarativeProperty.connectNotifySignal (self, callable?dest) ``` 該屬性的改變通知信號連接到指定的_method_的_dest_對象并返回True 。返回False,如果該元屬性并不代表定期Qt的屬性,或者如果它沒有改變通知信號,或者如果_dest_對象不具有指定的_method_。 ``` bool QDeclarativeProperty.connectNotifySignal (self, QObject?dest, int?method) ``` ``` bool QDeclarativeProperty.hasNotifySignal (self) ``` 如果屬性有改變通知信號,否則為False ,則返回True 。 ``` int QDeclarativeProperty.index (self) ``` 返回屬性的Qt的元對象的索引。 ``` bool QDeclarativeProperty.isDesignable (self) ``` 返回True,如果屬性是可設計的,否則為False 。 ``` bool QDeclarativeProperty.isProperty (self) ``` 返回True如果[QDeclarativeProperty](qdeclarativeproperty.html)代表一個普通的Qt屬性。 ``` bool QDeclarativeProperty.isResettable (self) ``` 返回True,如果屬性是可復位,否則為False 。 ``` bool QDeclarativeProperty.isSignalProperty (self) ``` 返回True如果[QDeclarativeProperty](qdeclarativeproperty.html)代表一個QML信號特性。 ``` bool QDeclarativeProperty.isValid (self) ``` 返回True如果[QDeclarativeProperty](qdeclarativeproperty.html)指的是一個有效的屬性,否則為False 。 ``` bool QDeclarativeProperty.isWritable (self) ``` 返回True,如果屬性是可寫的,否則為False 。 ``` QMetaMethod QDeclarativeProperty.method (self) ``` [](qmetamethod.html) [返回](qmetamethod.html)[QMetaMethod](qmetamethod.html)這個屬性,如果它是一個[SignalProperty](qdeclarativeproperty.html#Type-enum),否則返回一個無效的[QMetaMethod](qmetamethod.html)。 ``` QString QDeclarativeProperty.name (self) ``` 返回此QML屬性的名稱。 ``` bool QDeclarativeProperty.needsNotifySignal (self) ``` 如果該屬性需要改變通知信號綁定保持upto日期,否則返回False ,則返回True 。 某些屬性,如附加屬性或那些值永遠不會改變,不需要改變通知。 ``` QObject QDeclarativeProperty.object (self) ``` [](qobject.html) [返回](qobject.html)[QDeclarativeProperty](qdeclarativeproperty.html)的[QObject](qobject.html)。 ``` QMetaProperty QDeclarativeProperty.property (self) ``` [](qmetaproperty.html) [返回](qmetaproperty.html)[Qt property](qmetaproperty.html)與此QML屬性相關聯。 ``` int QDeclarativeProperty.propertyType (self) ``` 返回[QVariant](qvariant.html)類型的財產,或[QVariant.Invalid](qvariant.html#Type-enum)如果該屬性沒有[QVariant](qvariant.html)類型。 ``` PropertyTypeCategory QDeclarativeProperty.propertyTypeCategory (self) ``` [ 返回屬性類別。 ``` str QDeclarativeProperty.propertyTypeName (self) ``` 返回屬性的類型名稱,或者0,如果屬性沒有類型名稱。 ``` QVariant QDeclarativeProperty.read (self) ``` 返回的屬性值。 ``` QVariant QDeclarativeProperty.read (QObject, QString) ``` 返回_name_物業價值_object_。此方法等效于: ](qdeclarativeproperty.html#PropertyTypeCategory-enum) ``` QDeclarativeProperty p(object, name); p.read(); ``` ``` QVariant QDeclarativeProperty.read (QObject, QString, QDeclarativeContext) ``` 返回_name_物業價值_object_使用[context](qdeclarativecontext.html) _ctxt_。此方法等效于: ``` [QDeclarativeProperty](qdeclarativeproperty.html) p(object, name, context); p.read(); ``` ``` QVariant QDeclarativeProperty.read (QObject, QString, QDeclarativeEngine) ``` 返回_name_物業價值_object_使用環境的實例,是由提供的QML組件_engine_。 。此方法等效于: ``` [QDeclarativeProperty](qdeclarativeproperty.html) p(object, name, engine); p.read(); ``` ``` bool QDeclarativeProperty.reset (self) ``` 重置屬性,如果屬性是可復位返回True 。如果該屬性是無法確認,沒有任何反應并返回False 。 ``` Type QDeclarativeProperty.type (self) ``` [ 返回屬性的類型。 ``` bool QDeclarativeProperty.write (self, QVariant) ``` 屬性值設置為_value_并返回True 。返回False,如果該屬性不能被設置,因為_value_是錯誤的類型,例如。 ``` bool QDeclarativeProperty.write (QObject, QString, QVariant) ``` Writes _value_到_name_物業_object_。此方法等效于: ](qdeclarativeproperty.html#Type-enum) ``` QDeclarativeProperty p(object, name); p.write(value); ``` ``` bool QDeclarativeProperty.write (QObject, QString, QVariant, QDeclarativeContext) ``` Writes _value_到_name_物業_object_使用[context](qdeclarativecontext.html) _ctxt_。此方法等效于: ``` [QDeclarativeProperty](qdeclarativeproperty.html) p(object, name, ctxt); p.write(value); ``` ``` bool QDeclarativeProperty.write (QObject, QString, QVariant, QDeclarativeEngine) ``` Writes _value_到_name_物業_object_使用環境的實例,是由提供的QML組件_engine_。此方法等效于: ``` [QDeclarativeProperty](qdeclarativeproperty.html) p(object, name, engine); p.write(value); ``` ``` bool QDeclarativeProperty.__eq__ (self, QDeclarativeProperty) ``` ``` int QDeclarativeProperty.__hash__ (self) ``` ``` bool QDeclarativeProperty.__ne__ (self, QDeclarativeProperty) ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看