components
AYON UI Qt components package.
This package provides reusable Qt widgets styled according to the AYON design system.
AYButton
Bases: StyleMixin, QPushButton
Source code in client/ayon_core/ui/components/buttons.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 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 | |
AYCheckBox
Bases: StyleMixin, QCheckBox
AYON styled checkbox widget.
Overrides Qt's stylesheet painting with AYONStyle custom rendering.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args | Positional arguments passed to QCheckBox. | () | |
**kwargs | Keyword arguments passed to QCheckBox. | {} |
Source code in client/ayon_core/ui/components/check_box.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 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 | |
toggle_progress property
Animated toggle position, 0.0 (unchecked) to 1.0 (checked).
hitButton(pos)
Clickable area matching what is actually painted.
Qt's default uses 'SE_CheckBoxClickRect' (left aligned indicator + text) which does not match the centered '[label toggle]' layout of right-indicator variants nor the button background.
Source code in client/ayon_core/ui/components/check_box.py
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | |
initStyleOption(option)
Initialize the style option with the default implementation, then override any properties needed for our custom painting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
option | QStyleOptionButton | The style option to initialize. | required |
Source code in client/ayon_core/ui/components/check_box.py
96 97 98 99 100 101 102 103 104 | |
is_animating()
Whether the toggle slider is currently animating.
Source code in client/ayon_core/ui/components/check_box.py
67 68 69 | |
paintEvent(arg__1)
Render the checkbox using the AYON custom style.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arg__1 | QPaintEvent | The paint event delivered by Qt. | required |
Source code in client/ayon_core/ui/components/check_box.py
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 | |
AYComboBox
Bases: StyleMixin, QComboBox
AYON-styled combo-box with icon, short-text, and inverted-colour support.
:class:AYComboBox wraps :class:QComboBox and adds:
-
Three display modes controlled by :class:
~ayon_core.ui.data_models.MenuSize: -
Full- shows the full item label (default). Short- shows the abbreviatedShortTextRolelabel.-
Icon- hides the text and shows only the item icon. -
Inverted colour mode - swaps the icon foreground/background colours so the icon appears on a coloured pill rather than a neutral background.
- Placeholder text support for an empty selection state.
- Custom model support: any model that exposes
ShortTextRoleandIconNameRoleattributes is accepted. Models without those attributes are flagged as incompatible; :meth:add_itemand :meth:update_itemswill raise :exc:RuntimeErrorwhen such a model is active.
The default model is :class:AYComboBoxModel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent | Optional[QWidget] | Optional parent widget. | None |
items | List[dict] | None | Initial list of item dictionaries. Each dict may contain:
| None |
size | MenuSize | str | Initial display mode. Accepts a :class: | Full |
height | int | Fixed maximum height in pixels (default | 30 |
placeholder | Optional[str] | Placeholder string shown when no item is selected. | None |
inverted | bool | When | False |
icon_size | int | Icon size in pixels (default | 20 |
show_chevron | bool | If False, the dropdown chevron (arrow) will not be drawn in the custom style. Default is False. | True |
**kwargs | Additional keyword arguments forwarded to :class: | {} |
Example
Basic usage with the built-in status list::
combo = AYComboBox(
parent=my_widget,
items=[...],
size=MenuSize.Short,
placeholder="Select status…",
)
combo.currentTextChanged.connect(on_status_changed)
Switching modes at runtime::
combo.set_size("icon")
combo.set_inverted(True)
Source code in client/ayon_core/ui/components/combo_box.py
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 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 | |
add_item(item)
Append a single item to the combo-box model.
Constructs a :class:QStandardItem from item, sets its foreground colour, background colour (from the current palette), icon, short text, and icon name, then appends it to the model.
Raises:
| Type | Description |
|---|---|
RuntimeError | If a custom incompatible model is currently set (see :meth: |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item | dict[str, str] | A dict with the following keys:
| required |
Source code in client/ayon_core/ui/components/combo_box.py
661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 | |
eventFilter(watched, event)
Commit clicks that begin inside the open popup.
QComboBox suppresses mouse releases for a short period after opening its popup. This prevents the opening click from selecting an item, but can also swallow a genuine fast second click. Tracking a new press inside the popup distinguishes those two cases.
Source code in client/ayon_core/ui/components/combo_box.py
501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 | |
hidePopup()
Hide the popup and clear any unfinished popup click.
Source code in client/ayon_core/ui/components/combo_box.py
550 551 552 553 | |
paintEvent(arg__1)
Render the combo-box using the AYON custom style.
Overrides the default :meth:QComboBox.paintEvent to:
- Draw the combo-box frame/control via the AYON style.
- Substitute placeholder text (rendered in
placeholderTextpalette colour) when no item is selected. -
Render the label according to the current :class:
~ayon_core.ui.data_models.MenuSizemode: -
Full→ item's full text. Short→ item'sShortTextRolevalue, or"< INCOMPATIBLE MODEL >"if the role is unavailable.Icon→ empty string (icon only).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arg__1 | QPaintEvent | The paint event delivered by Qt. | required |
Source code in client/ayon_core/ui/components/combo_box.py
809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 | |
setModel(model)
Set the item model and detect compatibility with AYComboBox roles.
If model is not an :class:AYComboBoxModel instance and it does not expose both ShortTextRole and IconNameRole attributes, it is marked as incompatible. In that state:
- :meth:
add_itemand :meth:update_itemswill raise :exc:RuntimeError. - Short mode falls back to
"< INCOMPATIBLE MODEL >"as the displayed text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model | QAbstractItemModel | The new item model to attach to the combo-box. | required |
Source code in client/ayon_core/ui/components/combo_box.py
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 | |
set_inverted(state)
Toggle the inverted colour mode and schedule a repaint.
In inverted mode the icon's normal colour is drawn using the item's background colour instead of its foreground colour, producing a coloured icon on a neutral background.
Inverted icons are generated lazily on first paint via :meth:_get_inverted_icon and cached in :attr:_inverted_icons. Calling this method triggers a repaint so the change is visible immediately.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state | bool |
| required |
Source code in client/ayon_core/ui/components/combo_box.py
734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 | |
set_size(size)
Change the display mode and repaint the widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size | MenuSize | str | New display mode. Accepts a :class: | required |
Source code in client/ayon_core/ui/components/combo_box.py
752 753 754 755 756 757 758 759 760 761 762 763 764 | |
sizeHint()
Return the preferred size for the combo-box.
Delegates to the AYON style's :meth:QStyle.sizeFromContents so that the hint respects the custom theme's metrics rather than the system default.
Returns:
| Type | Description |
|---|---|
QSize | The preferred :class: |
Source code in client/ayon_core/ui/components/combo_box.py
766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 | |
update_items(item_list=None)
Replace all items in the model with the provided list.
Clears the model and calls :meth:add_item for every entry in item_list. If item_list is None or empty the model is left unchanged.
Raises:
| Type | Description |
|---|---|
RuntimeError | If a custom incompatible model is currently set (see :meth: |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item_list | list[dict] | None | List of item dicts as accepted by :meth: | None |
Source code in client/ayon_core/ui/components/combo_box.py
713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 | |
AYFrame
Bases: StyleMixin, QFrame
Source code in client/ayon_core/ui/components/frame.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 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 | |
set_hovered(hovered)
Mark this frame as hovered via the row_state property.
Companion to :meth:set_selected: driven explicitly (see :class:RowHoverTracker) instead of relying on underMouse(), since an interactive QPushButton child sitting on top of the frame doesn't reliably cascade hover state to it.
Source code in client/ayon_core/ui/components/frame.py
84 85 86 87 88 89 90 91 92 93 94 95 | |
set_selected(selected)
Mark this frame as selected via the row_state property.
The frame drawer reads this to pick the current variant's selected style block (background, border, ...), so a whole frame can carry a highlight the way a single-row control would, instead of only an inner button doing so.
Source code in client/ayon_core/ui/components/frame.py
72 73 74 75 76 77 78 79 80 81 82 | |
AYLabel
Bases: StyleMixin, QLabel
Source code in client/ayon_core/ui/components/label.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 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 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 | |
hasHeightForWidth()
Return True when word-wrap is active so layouts call heightForWidth.
Returns:
| Type | Description |
|---|---|
bool | True if the label uses word-wrap and has text without an icon. |
Source code in client/ayon_core/ui/components/label.py
836 837 838 839 840 841 842 843 844 | |
heightForWidth(width)
Compute the height required to render the text wrapped to width.
Only meaningful when wordWrap is True and there is no icon; delegates to the base class otherwise.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width | int | Available width in pixels. | required |
Returns:
| Type | Description |
|---|---|
int | Required height in pixels. |
Source code in client/ayon_core/ui/components/label.py
846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 | |
minimumSizeHint()
Return the smallest useful size for this label.
QLabel reports its full text width, which for an eliding label defeats the elide - a layout could never make it narrower than the text it is meant to shorten. An eliding label only insists on its icon, padding and an ellipsis.
Returns:
| Type | Description |
|---|---|
QSize | The minimum widget size. |
Source code in client/ayon_core/ui/components/label.py
818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 | |
paintEvent(arg__1)
Override to support icon + text rendering.
Source code in client/ayon_core/ui/components/label.py
684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 | |
set_font(font)
Set the widget font and refresh geometry and painting.
Source code in client/ayon_core/ui/components/label.py
164 165 166 167 168 | |
set_icon_color(color)
Update the icon color and refresh the widget.
Resets contrast color cache so filled variants (e.g. Badge) and any palette-based contrast logic are recalculated with the new color.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
color | str | New hex color string e.g. '#44ee9f'. | required |
Source code in client/ayon_core/ui/components/label.py
882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 | |
set_palette(palette)
Set the widget palette and trigger a repaint.
Source code in client/ayon_core/ui/components/label.py
153 154 155 156 157 158 159 160 161 162 | |
sizeHint()
Compute a size hint driven by QLabel style data from the style JSON.
For variants with auto-size (e.g. badge / pill), the size is derived from font-metrics and the auto-size-padding factor. For variants with an explicit padding list (e.g. entity-label), the size is padded accordingly. When an icon is present the icon dimensions are added. When wordWrap is True and the widget already has a non-zero width, the height is recomputed from the wrapped text bounds at that width; otherwise the natural single-line size is returned and the layout refines the height via :meth:heightForWidth. In all other cases the base QLabel.sizeHint() is returned.
Returns:
| Type | Description |
|---|---|
QSize | The recommended widget size. |
Source code in client/ayon_core/ui/components/label.py
713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 | |
AYLineEdit
Bases: StyleMixin, QLineEdit
Custom styled line edit component.
Inherits from QLineEdit and uses the AYON style system for rendering. Paints its own background, border, and focus ring using ayon_style.json data, then calls super().paintEvent() to draw text, cursor, and selection on top.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent | QWidget | None | Parent widget. | None |
placeholder | str | Placeholder text to display when empty. | '' |
variant | QLineEditVariants | Visual style variant. | Default |
name_id | str | Object name for identification. | '' |
Source code in client/ayon_core/ui/components/line_edit.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 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 | |
ayon_palette property
Return the palette used for this widget.
initStyleOption(option)
Override the palette used by the style to paint the widget.
Source code in client/ayon_core/ui/components/line_edit.py
134 135 136 137 | |
paintEvent(event)
Paint background, border, and focus ring, then delegate text rendering.
Draws the styled background rectangle and border first using QPainter directly (no style or stylesheet involvement), then calls super().paintEvent() which renders the text, cursor, and selection highlight on top. Qt's PE_PanelLineEdit call inside that base implementation is intercepted by LineEditDrawer which returns immediately for AYLineEdit instances, so our background is preserved.
Source code in client/ayon_core/ui/components/line_edit.py
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 | |
sizeHint()
Override sizeHint to account for padding.
Source code in client/ayon_core/ui/components/line_edit.py
225 226 227 228 229 230 231 232 | |
variant_style(state=None)
Return the style dict for the current variant.
Source code in client/ayon_core/ui/components/line_edit.py
85 86 87 88 89 90 91 92 93 94 | |
AYMenu
Bases: QMenu
QMenu that paints and measures itself using the AYON style.
Replicates :meth:QMenu.paintEvent but routes every primitive and control draw call through :func:get_ayon_style, so the menu is painted consistently with the rest of the AYON UI.
The style is also assigned to the widget, because painting alone is not enough: Qt asks widget.style() for CT_MenuItem when it lays the rows out. Leaving that to whatever style the host application happens to install means rows are measured by one style and painted by another - AYON's own icon gutter and padding are never accounted for, and longer entries end up clipped inside a row that was sized for something else.
Source code in client/ayon_core/ui/components/option_action.py
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 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 | |
actionEvent(arg__1)
Keep the rows wide enough for how the AYON style paints them.
Qt does not measure the rows with the AYON style when a parent widget (or the application) has a stylesheet: the style of the menu is then wrapped in a QStyleSheetStyle that measures them using the stylesheet's QMenu::item rules. Those rows are narrower than what paintEvent paints, so the label runs into the submenu arrow. Qt has no hook to measure the rows ourselves, but it does stretch them to the minimum width of the menu.
Source code in client/ayon_core/ui/components/option_action.py
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 | |
paintEvent(arg__1)
Paint the menu using AYON's QStyle implementation.
Mirrors Qt's own QMenu::paintEvent order: 1. Draw the menu panel background (PE_PanelMenu). 2. Draw each visible action row (CE_MenuItem). 3. Draw the menu frame on top (PE_FrameMenu).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arg__1 | QPaintEvent | The paint event delivered by Qt. | required |
Source code in client/ayon_core/ui/components/option_action.py
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 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 | |
AYOptionBox
Bases: AYButton
Option box widget used as the right-hand button in an action row.
Emits :attr:clicked when the user presses this button. It is a standard :class:AYButton styled with the Optional_Action variant.
Source code in client/ayon_core/ui/components/option_action.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
is_hovered(global_pos)
Return whether a global cursor position is inside the button.
Source code in client/ayon_core/ui/components/option_action.py
53 54 55 56 57 58 | |
AYOptionalAction
Bases: QWidgetAction
Menu action with an optional right-hand option box button.
Subclasses :class:QtWidgets.QWidgetAction to embed a custom :class:AYOptionalActionWidget inside a standard QMenu.
Set use_option=True to show the option box and connect to :attr:option_clicked for the secondary action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label | str | Display text. | required |
icon_name | str | QIcon | None | Material symbol name, resolved icon, or | 'none' |
use_option | bool | Whether to show the option box button. | True |
parent | QWidget | None | Parent widget (typically the owning menu). | None |
Source code in client/ayon_core/ui/components/option_action.py
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 | |
createWidget(parent)
Instantiate and configure the custom action row widget.
Called by Qt when the action is added to a menu.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent | QWidget | The menu widget that will own the row widget. | required |
Returns:
| Type | Description |
|---|---|
QWidget | The newly created :class: |
Source code in client/ayon_core/ui/components/option_action.py
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | |
is_option_hovered(global_pos)
Return whether global_pos is inside the option-box region.
Source code in client/ayon_core/ui/components/option_action.py
317 318 319 320 321 322 323 | |
set_highlight(highlighted, global_pos=None)
Synchronize hover styling for legacy optional menus.
Source code in client/ayon_core/ui/components/option_action.py
308 309 310 311 312 313 314 315 | |
trigger_option()
Emit the secondary action and close its menu hierarchy.
Source code in client/ayon_core/ui/components/option_action.py
325 326 327 328 | |
AYOptionalActionWidget
Bases: QWidget
Self-painted menu row with main and option action hit regions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label | str | Display text for the action. | required |
icon_name | str | QIcon | Material symbol name or an already resolved icon. | 'none' |
use_option | bool | Whether to show the option action. | True |
parent | QWidget | None | Optional parent widget. | None |
Source code in client/ayon_core/ui/components/option_action.py
61 62 63 64 65 66 67 68 69 70 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 | |
set_highlight(highlighted, global_pos=None)
Update row and option-box hover from the owning menu.
Source code in client/ayon_core/ui/components/option_action.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | |
AYOptionalMenu
Bases: AYMenu
AYON-styled menu that supports optional-action widget rows.
Source code in client/ayon_core/ui/components/option_action.py
476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 | |
mouseMoveEvent(event)
Update option-box hover while preserving native menu behavior.
Source code in client/ayon_core/ui/components/option_action.py
492 493 494 495 496 497 498 499 500 501 502 | |
mouseReleaseEvent(event)
Handle option-box clicks and delegate main clicks to Qt.
Source code in client/ayon_core/ui/components/option_action.py
504 505 506 507 508 509 510 511 512 513 514 515 | |
AYProgressBar
Bases: StyleMixin, QWidget
Determinate and indeterminate progress bar in the AYON style.
The bar is empty while maximum is 0, and indeterminate (a sweeping chunk) while value or maximum is negative.
By default the percentage is drawn right of the track. Its space is reserved also while indeterminate, so the track does not change width when the text appears or disappears. Pass show_value=False for a bar without text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent | QWidget | None | Parent widget. | None |
maximum | int | Value that represents a full bar. | 0 |
variant | AYProgressBarVariants | Visual style variant. | Default |
show_value | bool | Whether the percentage is drawn next to the track. | True |
Signals
value_changed (int): Current value. maximum_changed (int): Current maximum.
Source code in client/ayon_core/ui/components/progress_bar.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 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 | |
is_animating()
True while the indeterminate sweep timer is running.
Source code in client/ayon_core/ui/components/progress_bar.py
146 147 148 | |
is_indeterminate()
True while the progress cannot be shown as a fraction.
Source code in client/ayon_core/ui/components/progress_bar.py
142 143 144 | |
maximum()
Return the value that represents a full bar.
Source code in client/ayon_core/ui/components/progress_bar.py
109 110 111 | |
minimumSizeHint()
Return the minimum size derived from the style height.
Source code in client/ayon_core/ui/components/progress_bar.py
336 337 338 339 340 341 | |
paintEvent(event)
Paint the track, the chunk, and the optional percentage.
Descriptive text, such as a caption, belongs to the owner.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event | QPaintEvent | The paint event; the whole widget is repainted. | required |
Source code in client/ayon_core/ui/components/progress_bar.py
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 | |
percentage()
Return the completion percentage in the 0.0-100.0 range.
Source code in client/ayon_core/ui/components/progress_bar.py
150 151 152 153 154 155 | |
set_maximum(value)
Set the full-bar value, negative makes the bar indeterminate.
Source code in client/ayon_core/ui/components/progress_bar.py
122 123 124 125 126 127 128 129 | |
set_show_value(show_value)
Set whether the percentage is drawn next to the track.
Source code in client/ayon_core/ui/components/progress_bar.py
167 168 169 170 171 172 173 | |
set_state(state)
Set the semantic state used to colour the chunk.
Source code in client/ayon_core/ui/components/progress_bar.py
135 136 137 138 139 140 | |
set_value(value)
Set the current value, negative makes the bar indeterminate.
Source code in client/ayon_core/ui/components/progress_bar.py
113 114 115 116 117 118 119 120 | |
show_value()
Return whether the percentage is drawn next to the track.
Source code in client/ayon_core/ui/components/progress_bar.py
163 164 165 | |
sizeHint()
Return the preferred size derived from the style height.
Source code in client/ayon_core/ui/components/progress_bar.py
328 329 330 331 332 333 334 | |
state()
Return the semantic state used to colour the chunk.
Source code in client/ayon_core/ui/components/progress_bar.py
131 132 133 | |
text()
Return the percentage text, empty while indeterminate.
Source code in client/ayon_core/ui/components/progress_bar.py
157 158 159 160 161 | |
value()
Return the current value.
Source code in client/ayon_core/ui/components/progress_bar.py
105 106 107 | |
AYSearchableComboBox
Bases: StyleMixin, QWidget
AYON-styled line-edit that opens a searchable dropdown on click.
The :class:AYLineEdit acts as the search input — typing filters the dropdown items in real-time with no second search field inside the popup.
This component is designed to be generic and extensible. Applications can customize row rendering with :meth:set_items_with_builder or access existing rows through :meth:get_rows.
Signals
item_selected: Emitted with the chosen item key string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
placeholder | str | Hint text shown when the field is empty. | 'Search...' |
parent | QWidget | None | Optional parent widget. | None |
Source code in client/ayon_core/ui/components/searchable_combo_box.py
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 | |
clear()
Clear the line-edit and reset the dropdown filter.
Source code in client/ayon_core/ui/components/searchable_combo_box.py
338 339 340 341 | |
get_rows()
Return the list of all item rows.
Returns:
| Type | Description |
|---|---|
list[tuple[str, str, 'QWidget']] | List of (key, label, row_widget) tuples for custom widget manipulation. |
Source code in client/ayon_core/ui/components/searchable_combo_box.py
282 283 284 285 286 287 288 289 | |
set_items(items)
Set the list of selectable items shown in the dropdown.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
items | list[dict[str, str] | str] | A list of dicts with | required |
Source code in client/ayon_core/ui/components/searchable_combo_box.py
273 274 275 276 277 278 279 280 | |
set_items_with_builder(items, row_builder=None)
Set items and optionally apply a custom row builder function.
This method provides a convenient way to customize row rendering without manually calling :meth:get_rows and iterating.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
items | list[dict[str, str] | str] | A list of dicts with | required |
row_builder | Optional callable that receives (row, entry) and adds custom widgets to the row. Called for each item that has metadata beyond basic key/label. | None |
Example::
def customize_row(row, entry):
if "extra_data" in entry:
label = AYLabel(entry["extra_data"], dim=True)
row.add_custom_widget(label)
items = [
{"key": "k1", "label": "Item 1", "extra_data": "Extra"},
{"key": "k2", "label": "Item 2", "extra_data": "More"},
]
combo.set_items_with_builder(items, row_builder=customize_row)
Source code in client/ayon_core/ui/components/searchable_combo_box.py
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 | |
AYSpinBox
Bases: StyleMixin, QSpinBox
Custom styled spin box component.
Inherits from QSpinBox and uses the AYON style system for rendering. Paints its own background, border, focus ring, and arrow buttons using ayon_style.json data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent | QWidget | None | Parent widget. | None |
variant | QSpinBoxVariants | Visual style variant. | Default |
name_id | str | Object name for identification. | '' |
minimum | int | Minimum value. | 0 |
maximum | int | Maximum value. | 99 |
value | int | Initial value. | 0 |
Source code in client/ayon_core/ui/components/spinbox.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 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 | |
ayon_palette property
Return the palette used for this widget.
initStyleOption(option)
Override the palette used by the style to paint the widget.
Source code in client/ayon_core/ui/components/spinbox.py
119 120 121 122 | |
paintEvent(event)
Paint background, border, focus ring, and arrow buttons.
Draws the styled background rectangle, border, and custom arrow buttons using QPainter directly, then calls super().paintEvent() which renders the text, cursor, and selection on top.
Source code in client/ayon_core/ui/components/spinbox.py
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 | |
sizeHint()
Override sizeHint to account for padding and buttons.
Source code in client/ayon_core/ui/components/spinbox.py
283 284 285 286 287 288 289 290 291 292 293 294 | |
variant_style(state=None)
Return the style dict for the current variant.
Source code in client/ayon_core/ui/components/spinbox.py
84 85 86 87 88 89 90 91 92 93 | |
AYTextEdit
Bases: StyleMixin, QTextEdit
AYON styled text edit widget.
Overrides Qt's stylesheet painting with AYONStyle custom rendering.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args | Positional arguments passed to QTextEdit. | () | |
**kwargs | Keyword arguments passed to QTextEdit. | {} |
Source code in client/ayon_core/ui/components/text_edit.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
__init__(*args, variant=Variants.Default, **kwargs)
Initialize AYTextEdit widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args | Positional arguments passed to QTextEdit. | () | |
variant | Variants | Text edit variant. | Default |
**kwargs | Keyword arguments passed to QTextEdit. | {} |
Source code in client/ayon_core/ui/components/text_edit.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
AYTreeView
Bases: StyleMixin, QTreeView
AYON-styled tree view.
Fully self-contained: uses AYONStyle for all painting, a custom item delegate that draws directly bypassing any parent QSS, and AYScrollBar instances for scrollbars.
The view shows an animated skeleton placeholder (AYSkeletonLoader) while its model is loading and has no rows to show yet. A model opts in by exposing a loading_changed = Signal(bool) signal and, optionally, an is_loading() -> bool method. The model is found automatically when set with setModel, also through proxy models. Loading state can be also set manually with set_loading.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent | QWidget | None | Optional parent widget. | None |
variant | QTreeViewVariants | Visual style variant controlling background colour and item-state colours. | Default |
Source code in client/ayon_core/ui/components/tree_view.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 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 | |
drawBranches(painter, rect, index)
Draw branch indicators with AYONStyle directly.
Bypasses self.style() because, when an application-level QSS is active, Qt wraps the widget's style in a QStyleSheetStyle proxy which would otherwise intercept PE_IndicatorBranch and apply QSS QTreeView::branch rules on top of (or instead of) ours.
Source code in client/ayon_core/ui/components/tree_view.py
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 | |
is_loading()
Whether the view is in loading state.
Returns:
| Name | Type | Description |
|---|---|---|
bool | bool | True if the view's data are loading. |
Source code in client/ayon_core/ui/components/tree_view.py
150 151 152 153 154 155 156 | |
mouseDoubleClickEvent(event)
Emit double_clicked signal on double-click.
Source code in client/ayon_core/ui/components/tree_view.py
344 345 346 347 | |
mousePressEvent(event)
Deselect all items when clicking in an empty area.
Source code in client/ayon_core/ui/components/tree_view.py
349 350 351 352 353 354 355 356 | |
paintEvent(event)
Draw the outer container background before the items.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event | QPaintEvent | The paint event. | required |
Source code in client/ayon_core/ui/components/tree_view.py
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | |
selectionChanged(selected, deselected)
Override to emit a public signal on selection change.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
selected | QItemSelection | Newly selected items. | required |
deselected | QItemSelection | Newly deselected items. | required |
Source code in client/ayon_core/ui/components/tree_view.py
358 359 360 361 362 363 364 365 366 367 368 369 370 | |
setModel(model)
Set model and connect to its loading state if it has one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model | QAbstractItemModel | None | Model to show, can be a proxy model. | required |
Source code in client/ayon_core/ui/components/tree_view.py
140 141 142 143 144 145 146 147 148 | |
set_loading(loading)
Show animated placeholder rows while data are loading.
The placeholder shows only when the model has no rows, a refresh of visible rows happens in place. Called automatically when the model has loading_changed signal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
loading | bool | Whether the model is loading data. | required |
Source code in client/ayon_core/ui/components/tree_view.py
158 159 160 161 162 163 164 165 166 167 168 169 | |
set_loading_delay(delay)
Delay before the loading placeholder appears.
Loads finishing sooner never show the placeholder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
delay | int | Delay in milliseconds. | required |
Source code in client/ayon_core/ui/components/tree_view.py
171 172 173 174 175 176 177 178 179 180 181 | |
AYViewEditor
Bases: QDialog
Modal editor for the metadata fields of a :class:View.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view | View | The :class: | required |
current_user | str | User identifier of the editor. Used to gate the studio scope when applicable. | '' |
allow_studio_scope | bool | Whether | False |
usernames_and_groups | dict[str, list] | None | Users and access groups offered in the "People with access" selector. | None |
allow_sharing | bool | Whether the "People with access" section is shown. When False the view's access is left unchanged. | True |
parent | QWidget | None | Optional parent widget. | None |
Source code in client/ayon_core/ui/components/views/view_editor.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 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 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 | |
Mode
Bases: IntEnum
Dialog mode: create or edit.
Source code in client/ayon_core/ui/components/views/view_editor.py
69 70 71 72 73 | |
delete_requested()
Whether the user requested deletion of the view.
Source code in client/ayon_core/ui/components/views/view_editor.py
608 609 610 | |
get_view()
Return the edited :class:View.
The original :attr:View.settings, :attr:View.id, :attr:View.view_type, :attr:View.owner, :attr:View.access, :attr:View.position and :attr:View.extra are kept intact; only the metadata edited in this dialog is mutated.
Returns:
| Type | Description |
|---|---|
View | The (mutated) original :class: |
Source code in client/ayon_core/ui/components/views/view_editor.py
612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 | |
mode()
Return the dialog mode: create or edit.
Source code in client/ayon_core/ui/components/views/view_editor.py
604 605 606 | |
AYViewSelector
Bases: AYButtonMenu
Icon button exposing the Views feature.
Public API:
- :meth:
set_view_type— switch the view-type identifier and reload. - :meth:
refresh— re-pull the view list from the manager. - :meth:
current_view— return the active :class:View(orNone).
Signals
view_applied(View): Emitted after a view has been applied to the bindings. view_saved(View): Emitted after a view has been persisted. view_deleted(str): Emitted with the view id after deletion. view_modified(str, bool): Emitted when the live UI no longer matches the loaded view settings, or when it returns to the saved state. Payload is (current_view_name, modified). binding_error(str, str): Emitted with (stage, message) when :class:ViewBindings reports a non-fatal failure while applying or capturing a view.
Source code in client/ayon_core/ui/components/views/view_selector.py
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 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 | |
apply_default_settings()
Reset every tracked setting to the built-in AYON defaults.
Used when neither a project nor a studio default view is configured, so "reset" has to fall back to what the consumer declared as its defaults. Applying an empty :class:ViewSettings makes :class:ViewBindings fill in every slice from default_settings - columns, sort, filter, grouping, row height and the consumer's extras alike - so nothing carries over from the view that was active before.
The reset lands on the working view: it is emitted through :attr:view_applied (so consumers can sync widgets the bindings do not own, such as the Group By menu) and then persisted, which is what makes it survive a restart.
Source code in client/ayon_core/ui/components/views/view_selector.py
645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 | |
current_view()
Return the currently active view, or None.
Source code in client/ayon_core/ui/components/views/view_selector.py
632 633 634 | |
emit_default_view_message(message, success)
Emit default-view feedback for host UIs.
Hosts can map this to the same toast presentation used by loader action results.
Source code in client/ayon_core/ui/components/views/view_selector.py
925 926 927 928 929 930 931 | |
get_default_views()
Return the current default views from the default view control.
Source code in client/ayon_core/ui/components/views/view_selector.py
1132 1133 1134 1135 1136 1137 | |
hideEvent(event)
Flush a pending working-view save before going away.
The debounce would otherwise drop the last few hundred milliseconds of edits when the window closes.
Source code in client/ayon_core/ui/components/views/view_selector.py
1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 | |
notify_view_modified(*_args)
Mark the view as modified after a UI settings change.
Consumer code may connect custom widgets here when they affect :meth:ViewBindings.capture but are not part of the built-in table/filter stack.
Source code in client/ayon_core/ui/components/views/view_selector.py
636 637 638 639 640 641 642 643 | |
refresh()
Re-resolve the working view and drop the cached view list.
Restoring the user's last state only needs the working view, which has its own endpoint. The dropdown is not on screen yet, so listing the rest - and each one's settings - waits until the menu is opened; see :meth:_ensure_views_listed.
Source code in client/ayon_core/ui/components/views/view_selector.py
601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 | |
refresh_dropdown_size()
Resize the dropdown popup to fit its current content.
Call after any change to the dropdown's contents (a full rebuild, or swapping a single row/pill's children in place): rebuilding a widget's children leaves stale cached size hints on its ancestors, so a plain adjustSize() alone can settle on a size that no longer fits — e.g. clipping the label text on a default-view pill after it switches between its "unset" and "active" (wider) look. Invalidating the layout chain first forces every ancestor to recompute before the popup resizes.
Source code in client/ayon_core/ui/components/views/view_selector.py
906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 | |
set_view_type(view_type)
Switch to a new view-type identifier.
Source code in client/ayon_core/ui/components/views/view_selector.py
593 594 595 596 597 598 599 | |
ColumnState dataclass
State of a single column inside a View.
Attributes:
| Name | Type | Description |
|---|---|---|
name | str | Column key, matches :attr: |
visible | bool | Whether the column is currently shown. |
pinned | bool | Whether the column is pinned to the left (Phase 3 polish; stored but not visually frozen in Phase 1). |
width | int | None | Pixel width override, or |
Source code in client/ayon_core/ui/components/views/data_models.py
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 | |
from_payload(payload) classmethod
Build a ColumnState from a single payload column dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload | dict[str, Any] | Dict like | required |
Returns:
| Type | Description |
|---|---|
'ColumnState' | A new ColumnState instance. |
Source code in client/ayon_core/ui/components/views/data_models.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
to_payload()
Serialise this column state to the payload format.
Returns:
| Type | Description |
|---|---|
dict[str, Any] | A new dict with payload-friendly keys. |
Source code in client/ayon_core/ui/components/views/data_models.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 | |
FilterDef dataclass
Server-side filter configuration captured in a View.
The condition dicts are opaque to ayon-core: they are passed through to the filter proxy untouched. The proxy converts them to :class:FilterCriterion via :meth:FilterCriterion.from_def / :meth:to_def.
Attributes:
| Name | Type | Description |
|---|---|---|
conditions | list[dict[str, Any]] | List of condition dicts. Each dict has at least a |
operator | str | How conditions combine — |
Source code in client/ayon_core/ui/components/views/data_models.py
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 | |
from_payload(payload) classmethod
Build a FilterDef from the payload's filter dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload | dict[str, Any] | None | Filter sub-dict, or | required |
Returns:
| Type | Description |
|---|---|
'FilterDef' | A new FilterDef. |
Source code in client/ayon_core/ui/components/views/data_models.py
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |
is_empty()
Return True when there are no filter conditions.
Returns:
| Type | Description |
|---|---|
bool | True when there are no conditions configured. |
Source code in client/ayon_core/ui/components/views/data_models.py
219 220 221 222 223 224 225 | |
to_payload()
Serialise this filter to a payload dict.
Returns:
| Type | Description |
|---|---|
dict[str, Any] | A dict with |
Source code in client/ayon_core/ui/components/views/data_models.py
208 209 210 211 212 213 214 215 216 217 | |
GroupingDef dataclass
Grouping configuration captured in a View.
Attributes:
| Name | Type | Description |
|---|---|---|
group_by | str | None | Column key to group rows by, or |
group_sort_desc | bool | Whether the group ordering is descending. |
show_empty_groups | bool | Whether groups with no visible rows are rendered or hidden. |
Source code in client/ayon_core/ui/components/views/data_models.py
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | |
is_empty()
Return True when no grouping is configured.
Returns:
| Type | Description |
|---|---|
bool | True when |
Source code in client/ayon_core/ui/components/views/data_models.py
244 245 246 247 248 249 250 | |
InMemoryViewManager
Bases: ViewManager
Lightweight in-process implementation used by tests / demos.
Stores views in a dict keyed by view.id. Useful when the consumer app has not yet wired the real server backend, or when running the standalone tester harness.
Source code in client/ayon_core/ui/components/views/view_manager.py
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 | |
__init__(views=None, parent=None)
Seed the manager with an optional initial set of views.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
views | list[View] | None | Initial views to register. Each view must have a non-empty :attr: | None |
parent | QObject | None | Optional parent QObject. | None |
Source code in client/ayon_core/ui/components/views/view_manager.py
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | |
all_views()
Return every stored view across all view types.
Returns:
| Type | Description |
|---|---|
list[View] | A snapshot list of all stored views. |
Source code in client/ayon_core/ui/components/views/view_manager.py
294 295 296 297 298 299 300 | |
clear()
Remove all stored views (intended for tests).
Source code in client/ayon_core/ui/components/views/view_manager.py
287 288 289 290 291 292 | |
delete_view(view_id)
Remove view_id from the store, if present.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view_id | str | Identifier of the view to remove. Missing ids are silently ignored after a debug log entry. | required |
Source code in client/ayon_core/ui/components/views/view_manager.py
262 263 264 265 266 267 268 269 270 271 272 273 274 | |
list_views(view_type)
Return views matching view_type, sorted for display.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view_type | str | The view-type identifier. | required |
Returns:
| Type | Description |
|---|---|
list[View] | Sorted list of views. |
Source code in client/ayon_core/ui/components/views/view_manager.py
231 232 233 234 235 236 237 238 239 240 241 242 243 244 | |
save_view(view)
Insert or replace view in the in-memory store.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view | View | The view to save. An id is assigned if missing. | required |
Returns:
| Type | Description |
|---|---|
View | The same view instance (with assigned id). |
Source code in client/ayon_core/ui/components/views/view_manager.py
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 | |
ProgressBarState
Bases: Enum
Semantic state controlling the colour of the filled chunk.
Source code in client/ayon_core/ui/components/progress_bar.py
23 24 25 26 27 28 29 | |
Scope
Bases: str, Enum
The level at which a view is stored on the server.
Source code in client/ayon_core/ui/components/views/data_models.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
ServerViewManager
Bases: ViewManager
ViewManager backed by AYON server REST endpoints.
Endpoints (project-scoped, all take ?project_name=<p>):
GET /api/views/{view_type}GET /api/views/{view_type}/workingPOST /api/views/{view_type}PATCH /api/views/{view_type}/{view_id}POST /api/addons/powerpack/{version}/views/{view_type}/{id}/shareDELETE /api/views/{view_type}/{view_id}
Attributes:
| Name | Type | Description |
|---|---|---|
project_name | str | Name of the project all calls are scoped to. |
Source code in client/ayon_core/ui/components/views/server_view_manager.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 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 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 | |
project_name property
Current project the manager is scoped to.
__init__(project_name, parent=None)
Initialise the manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_name | str | Initial project the manager is scoped to. May be empty when the loader has no project yet. | required |
parent | QObject | None | Optional parent QObject. | None |
Source code in client/ayon_core/ui/components/views/server_view_manager.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
delete_view(view_id)
Delete view_id on the server.
The view type is resolved via the id-map (populated by :meth:list_views and :meth:save_view), so this works even when the per-type list cache has been cleared by :meth:set_project. Unknown ids emit an :attr:error signal.
Does nothing (without emitting :attr:error) when no project is set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view_id | str | Identifier of the view to delete. | required |
Source code in client/ayon_core/ui/components/views/server_view_manager.py
478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 | |
get_default_project_view(view_type)
Return project default view.
Source code in client/ayon_core/ui/components/views/server_view_manager.py
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
get_default_studio_view(view_type)
Return studio default view.
Source code in client/ayon_core/ui/components/views/server_view_manager.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
get_working_view(view_type)
Return the working view for view_type using the direct endpoint.
Uses GET /api/views/{view_type}/working for faster lookup than scanning list_views.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view_type | str | View-type identifier. | required |
Returns:
| Type | Description |
|---|---|
View | None | Parsed working :class: |
Source code in client/ayon_core/ui/components/views/server_view_manager.py
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 | |
list_views(view_type)
Return views for view_type, fetching from server on miss.
Returns an empty list (without emitting :attr:error) when the project name is empty — callers should wait for project_changed before listing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view_type | str | View-type identifier (e.g. | required |
Returns:
| Type | Description |
|---|---|
list[View] | Sorted list of :class: |
list[View] | network or parse error. |
Source code in client/ayon_core/ui/components/views/server_view_manager.py
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 | |
load_view(view)
Return view with its settings fetched from the server.
:meth:list_views builds its rows from the listing endpoint, which omits settings, so opening the Views menu costs one request instead of one per view. This fills in the rest, and is a no-op for a view that already carries its settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view | View | A view, possibly built from a listing summary. | required |
Returns:
| Type | Description |
|---|---|
View | A fully populated view. The passed view is returned unchanged |
View | when it is already loaded, has no id, or the fetch fails - |
View | callers must still tolerate empty settings. |
Source code in client/ayon_core/ui/components/views/server_view_manager.py
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 | |
patch_view_access(view_id, access_data, should_share_access)
Patch per-view access data via the share endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view_id | str | Existing view identifier. | required |
access_data | dict[str, Any] | Access mapping (e.g. | required |
should_share_access | bool | Whether to set the view visibility to public (True) or private (False). | required |
Source code in client/ayon_core/ui/components/views/server_view_manager.py
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 | |
save_view(view)
POST a new view or PATCH an existing one.
The new-vs-update decision is based solely on whether :attr:View.id is non-empty. A view with a non-empty id is PATCHed; an empty id results in a POST. This is correct because ids are server-assigned — clients never mint them — so a non-empty id means the view was previously persisted.
The per-type cache is updated in-place (rather than invalidated) so the subsequent :attr:views_changed emission does not trigger an extra round-trip.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view | View | The view to save. | required |
Returns:
| Type | Description |
|---|---|
View | The saved view, rebuilt from the server response when |
View | the response includes data, otherwise the input view. |
Raises:
| Type | Description |
|---|---|
Exception | Re-raises any |
Source code in client/ayon_core/ui/components/views/server_view_manager.py
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 | |
set_project(project_name)
Rebind the manager to a different project.
Clears both caches and emits :attr:project_changed with the new project name so listeners can refresh.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_name | str | Target project name. No-op when the same as the current project. | required |
Source code in client/ayon_core/ui/components/views/server_view_manager.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
set_working_view(view)
Mark view as the sole working view for its type.
The base implementation scans :meth:list_views to clear the flag on every other view, which costs a full listing on each save. The server exposes the working view directly, so at most one other view can be holding the flag and one request finds it - and when view already is the working view, none is needed at all.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view | View | The view to mark as working. | required |
Source code in client/ayon_core/ui/components/views/server_view_manager.py
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | |
supports_sharing()
Whether view sharing is available on the server.
Sharing is a powerpack feature: it requires the powerpack addon in the current bundle.
Returns:
| Type | Description |
|---|---|
bool | True when powerpack is available and licensed. |
Source code in client/ayon_core/ui/components/views/server_view_manager.py
604 605 606 607 608 609 610 611 612 613 | |
View dataclass
A saved configuration that can be applied to a table/card view.
Attributes:
| Name | Type | Description |
|---|---|---|
id | str | Server-assigned identifier. Empty string for views that have not been persisted yet. |
label | str | Human-readable name shown in the view selector. |
view_type | str | Identifier of the page/context the view belongs to (e.g. |
settings | ViewSettings | The actual UI configuration. |
owner | str | User name / id of the creator. |
scope | Scope |
|
visibility | Visibility | :class: |
loaded | bool | False for a view built from a listing summary, whose |
working | bool | True for the per-user fallback view that captures ad-hoc tweaks. At most one working view per (user, view_type) should be flagged. |
position | int | Sort order hint within the selector. |
access_level | int | Required access level (0–30, step 10) for editing public views. Components store the value and gate UI via :meth: |
access | dict[str, int] | Per-user/per-group access dict mapping names to integer access levels. |
Source code in client/ayon_core/ui/components/views/data_models.py
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 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 | |
can_edit(current_user, user_access_level=50)
Return True when current_user may edit this view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
current_user | str | The viewer's user name / id. | required |
user_access_level | int | The viewer's effective access level on the relevant scope (0–50). Defaults to | 50 |
Returns:
| Type | Description |
|---|---|
bool | True when: |
bool |
|
bool |
|
Source code in client/ayon_core/ui/components/views/data_models.py
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 | |
from_payload(payload) classmethod
Build a View from a raw server payload.
Unknown top-level keys are preserved in :attr:extra.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload | dict[str, Any] | Raw server payload dict. | required |
Returns:
| Type | Description |
|---|---|
'View' | A new View instance. |
Source code in client/ayon_core/ui/components/views/data_models.py
427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 | |
to_payload()
Serialise this view to a payload dict.
Returns:
| Type | Description |
|---|---|
dict[str, Any] | A dict suitable for sending to the server. |
Source code in client/ayon_core/ui/components/views/data_models.py
475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 | |
ViewBindings dataclass
Adapter wiring a :class:View to a concrete widget stack.
Only :attr:model is required. Every other widget is optional and skipped when None.
Attributes:
| Name | Type | Description |
|---|---|---|
model | PaginatedTableModel | The shared :class: |
table_view | Any | None | Optional :class: |
card_view | Any | None | Optional :class: |
filter_bar | Any | None | Optional :class: |
on_extra_apply | Any | None | Optional callback |
on_extra_capture | Any | None | Optional callback |
default_filter | Callable[[], FilterDef] | None | Optional callback returning a |
default_settings | Callable[[], ViewSettings] | None | Optional callback returning complete defaults. When supplied, it is the preferred source for columns, sorting, filtering, grouping, row height, and consumer extras. |
default_sort_by | str | None | Optional column key used when the incoming view does not define a sort column. |
on_error | ErrorCallback | None | Optional callback |
Source code in client/ayon_core/ui/components/views/view_bindings.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 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 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 | |
apply(settings)
Apply settings to every wired widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
settings | ViewSettings | The :class: | required |
Raises:
| Type | Description |
|---|---|
TypeError | If settings is not a :class: |
Source code in client/ayon_core/ui/components/views/view_bindings.py
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 | |
capture()
Build a fresh :class:ViewSettings from the live widget state.
Returns:
| Type | Description |
|---|---|
ViewSettings | A new :class: |
Source code in client/ayon_core/ui/components/views/view_bindings.py
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 | |
capture_filter()
Capture filter criteria from the live filter bar.
The operator is preserved from the last :meth:apply call so a view that arrived with operator="or" roundtrips losslessly, even though :class:AYTableFilter only implements AND.
Returns:
| Type | Description |
|---|---|
FilterDef | A new :class: |
Source code in client/ayon_core/ui/components/views/view_bindings.py
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 | |
ViewManager
Bases: QObject
Abstract storage backend for :class:View instances.
Signals
views_changed(str): Emitted with view_type whenever the list of views for that type may have changed. view_saved(str): Emitted with the view id after a successful save_view. view_deleted(str): Emitted with the view id after a successful delete_view. project_changed(str): Emitted with the new project name when the manager is rebound to a different project. error(str): Emitted with an error message when an operation fails (subclasses may emit this instead of raising).
Source code in client/ayon_core/ui/components/views/view_manager.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 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 | |
__init__(parent=None)
Initialise the manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent | QObject | None | Optional parent QObject. | None |
Source code in client/ayon_core/ui/components/views/view_manager.py
52 53 54 55 56 57 58 | |
delete_view(view_id) abstractmethod
Delete the view with the given id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view_id | str | Identifier of the view to delete. | required |
Source code in client/ayon_core/ui/components/views/view_manager.py
88 89 90 91 92 93 94 | |
get_default_project_view(view_type)
Return the project-scope default view for view_type, if any.
See :meth:get_default_studio_view for how default views are identified.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view_type | str | The view-type identifier. | required |
Returns:
| Type | Description |
|---|---|
View | None | The project default view for view_type, or |
Source code in client/ayon_core/ui/components/views/view_manager.py
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
get_default_studio_view(view_type)
Return the studio-scope default view for view_type, if any.
Default views are saved with :data:DEFAULT_VIEW_LABEL and the matching :class:Scope (see DefaultViewControl._set_default_for_scope). Subclasses backed by a dedicated endpoint (e.g. :class:ServerViewManager) should override this rather than rely on filtering :meth:list_views.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view_type | str | The view-type identifier. | required |
Returns:
| Type | Description |
|---|---|
View | None | The studio default view for view_type, or |
Source code in client/ayon_core/ui/components/views/view_manager.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | |
get_working_view(view_type)
Return the working view for view_type, if any.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view_type | str | The view-type identifier. | required |
Returns:
| Type | Description |
|---|---|
View | None | The view flagged with |
View | None |
|
Source code in client/ayon_core/ui/components/views/view_manager.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 | |
list_views(view_type) abstractmethod
Return the list of views for the given view type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view_type | str | The view-type identifier (e.g. | required |
Returns:
| Type | Description |
|---|---|
list[View] | List of :class: |
list[View] | attr: |
Source code in client/ayon_core/ui/components/views/view_manager.py
62 63 64 65 66 67 68 69 70 71 72 | |
load_view(view)
Return view with its :attr:View.settings populated.
Managers that list views cheaply - fetching only the metadata the dropdown needs - override this to fetch the full payload the first time a view is actually used. The default implementation assumes :meth:list_views already returned complete views.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view | View | The view to complete. | required |
Returns:
| Type | Description |
|---|---|
View | A view whose settings are safe to apply or persist. |
Source code in client/ayon_core/ui/components/views/view_manager.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
save_view(view) abstractmethod
Persist a new or updated view.
Implementations must assign a non-empty :attr:View.id when creating a new view and return the (possibly modified) view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view | View | The view to save. | required |
Returns:
| Type | Description |
|---|---|
View | The saved view, with its assigned id. |
Source code in client/ayon_core/ui/components/views/view_manager.py
74 75 76 77 78 79 80 81 82 83 84 85 86 | |
set_working_view(view)
Mark view as the (sole) working view for its view type.
The default implementation clears the working flag on every other view of the same type and saves them all. Subclasses can override this with a bulk-update endpoint for efficiency.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view | View | The view to mark as working. | required |
Source code in client/ayon_core/ui/components/views/view_manager.py
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |
supports_sharing()
Whether views can be shared with other users.
Sharing controls in the UI (the "Shared views" section, the people-with-access editor) are shown only when this returns True. The default implementation has no restrictions.
Returns:
| Type | Description |
|---|---|
bool | True when views can be shared. |
Source code in client/ayon_core/ui/components/views/view_manager.py
98 99 100 101 102 103 104 105 106 107 108 | |
ViewSettings dataclass
The actual user-visible configuration of a View.
All "generic" knobs (columns, sort, row height, filter, grouping) are first-class fields. Anything else (showProducts, gridHeight, featuredVersionOrder, slicerType, …) is stashed verbatim in :attr:extra so the payload roundtrips losslessly across app versions.
Attributes:
| Name | Type | Description |
|---|---|---|
columns | list[ColumnState] | Ordered list of column states. |
sort_by | str | None | Column key to sort by, or |
sort_desc | bool | Whether the sort is descending. |
row_height | int | Table row height in pixels. Consumers without a table may use this for another height-based presentation setting. |
grouping | GroupingDef | Grouping configuration. |
filter | FilterDef | Filter configuration. |
extra | dict[str, Any] | All other settings keys, preserved untouched. |
Source code in client/ayon_core/ui/components/views/data_models.py
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 | |
from_payload(payload) classmethod
Build ViewSettings from the payload's settings sub-dict.
Unknown keys are preserved verbatim in :attr:extra.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload | dict[str, Any] | None | Settings sub-dict, or | required |
Returns:
| Type | Description |
|---|---|
'ViewSettings' | A new ViewSettings instance. |
Source code in client/ayon_core/ui/components/views/data_models.py
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 | |
to_payload()
Serialise these settings to a payload dict.
Unknown keys from :attr:extra are merged back in. Known keys in extra are ignored (first-class fields win) so accidental duplication can't corrupt a roundtrip.
Returns:
| Type | Description |
|---|---|
dict[str, Any] | A dict suitable for embedding under |
dict[str, Any] | View payload. |
Source code in client/ayon_core/ui/components/views/data_models.py
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 | |
Visibility
Bases: str, Enum
Whether a view is owner-only or public to others.
Subclasses str so it serialises naturally to JSON.
Source code in client/ayon_core/ui/components/views/data_models.py
72 73 74 75 76 77 78 79 | |