MetaObject
⋔ Inheritance diagram
graph TD
1473299784768["core.MetaObject"]
140713234304496["builtins.object"]
140713234304496 --> 1473299784768
🛈 DocStrings
Contains meta-information about Qt objects.
Source code in prettyqt\core\metaobject.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 |
|
connect_signals(source_qobject: core.QObject, fn_or_qobject: Callable | core.QObject, only_notifiers: bool = False) -> list[core.QMetaObject.Connection]
Connect all signals of a given qobject.
Either connect all signals to a function or connect each signal to the corresponding signal of the receiver.
Source code in prettyqt\core\metaobject.py
copy(qobject: T, forward_signals: bool = True) -> T
Create a copy of given QObject.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qobject |
T
|
QObject to create a copied instance for. |
required |
forward_signals |
bool
|
Whether to connect all signals from qobject to the new instance. |
True
|
Source code in prettyqt\core\metaobject.py
copy_properties_to(source: core.QObject, target: core.QObject)
classmethod
Sets all properties of target to value of source.
Only sets properties which exist for both QObjects.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source |
QObject
|
Source QObject |
required |
target |
QObject
|
Target QObject |
required |
Source code in prettyqt\core\metaobject.py
get_all_super_classes() -> list[MetaObject]
get_class_info(include_super: bool = True) -> dict[str, str]
Get MetaObject class info.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
include_super |
bool
|
Whether to include class info from parent classes. |
True
|
Source code in prettyqt\core\metaobject.py
get_constructor(index: int | str) -> core.MetaMethod
Get ctor MetaMethod based on index or name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index |
int | str
|
index or constructor name |
required |
Source code in prettyqt\core\metaobject.py
get_constructors() -> list[core.MetaMethod]
get_enum(index: int | str) -> core.MetaEnum
Get MetaEnum based on index or name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index |
int | str
|
index or Enum name |
required |
Source code in prettyqt\core\metaobject.py
get_enums(include_super: bool = True) -> list[core.MetaEnum]
Get all MetaEnums based on given criteria.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
include_super |
bool
|
Whether to include Enums from parent classes. |
True
|
Source code in prettyqt\core\metaobject.py
get_meta_type() -> core.MetaType
get_method(index: int | str) -> core.MetaMethod
Get MetaMethod based on index or name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index |
int | str
|
index or method name |
required |
Source code in prettyqt\core\metaobject.py
get_methods(include_super: bool = True, type_filter: core.metamethod.MethodTypeStr | None = None, filter_internal: bool = True) -> list[core.MetaMethod]
Get all MetaMethods based on given criteria.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
include_super |
bool
|
Whether to include Methods from parent classes |
True
|
type_filter |
MethodTypeStr | None
|
Method type to filter for. |
None
|
filter_internal |
bool
|
Filter Qt-internal methods |
True
|
Source code in prettyqt\core\metaobject.py
get_name() -> str
get_plain_methods(include_super: bool = True) -> list[core.MetaMethod]
Get all plain MetaMethods based on given criteria.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
include_super |
bool
|
Whether to include plain methods from parent classes |
True
|
Source code in prettyqt\core\metaobject.py
get_properties(include_super: bool = True, only_writable: bool = False, only_stored: bool = False, only_bindable: bool = False, only_designable: bool = False, only_final: bool = False, only_required: bool = False, only_enum_type: bool = False, only_flag_type: bool = False, only_with_notifiers: bool = False, only_with_type_name: str = '') -> list[core.MetaProperty]
Get all MetaProperties based on given criteria.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
include_super |
bool
|
Whether to include properties from parent classes, |
True
|
only_writable |
bool
|
Whether to filter for writable properties. |
False
|
only_stored |
bool
|
Whether to filter for stored properties. |
False
|
only_bindable |
bool
|
Whether to filter for bindable properties. |
False
|
only_designable |
bool
|
Whether to filter for designable properties. |
False
|
only_final |
bool
|
Whether to filter for final properties. |
False
|
only_required |
bool
|
Whether to filter for required properties. |
False
|
only_enum_type |
bool
|
Whether to filter for Enum type properties. |
False
|
only_flag_type |
bool
|
Whether to filter for Flag_type properties. |
False
|
only_with_notifiers |
bool
|
Whether to filter for properties with notifier. |
False
|
only_with_type_name |
str
|
Only include properties with given give name as type. |
''
|
Source code in prettyqt\core\metaobject.py
get_property(index: int | str) -> core.MetaProperty
Get MetaProperty based on index or name.
Only returns non-dynamic properties.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index |
int | str
|
index or property name |
required |
Source code in prettyqt\core\metaobject.py
get_property_class_affiliations() -> dict[str, list[core.MetaProperty]]
Get a mapping of class -> property affiliations.
Source code in prettyqt\core\metaobject.py
get_property_values(qobject: core.QObject, cast_types: bool = False) -> dict[str, Any]
Get a dictionary containing all MetaProperties values from given qobject.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qobject |
QObject
|
QObject to get properties from |
required |
cast_types |
bool
|
Whether to cast types to PrettyQt classes. |
False
|
Source code in prettyqt\core\metaobject.py
get_signals(include_super: bool = True, only_notifiers: bool = False) -> list[core.MetaMethod]
Get all signal MetaMethods based on given criteria.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
include_super |
bool
|
Whether to include Signals from parent classes |
True
|
only_notifiers |
bool
|
Whether to filter for property notifier signals |
False
|
Source code in prettyqt\core\metaobject.py
get_slots(include_super: bool = True) -> list[core.MetaMethod]
Get all slot MetaMethods based on given criteria.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
include_super |
bool
|
Whether to include Slots from parent classes |
True
|
Source code in prettyqt\core\metaobject.py
get_super_class() -> MetaObject | None
get_user_property() -> core.MetaProperty | None
has_property(name: str)
Check if a property with given name exists.
Only checks for non-dynamic properties.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
property name |
required |