Differences From Artifact [f374133c3b]:
- File QtWidgets/QtWidget.mm — part of check-in [3ece549448] at 2017-04-15 17:18:52 on branch trunk — Make toOF/toQt more powerful and complete QtWidget (user: js, size: 19170) [annotate] [blame] [check-ins using]
- File
src/QtWidgets/QtWidget.mm
— part of check-in
[baf52ea3b1]
at
2017-04-17 23:25:45
on branch trunk
— Add a proper build system
Also lowers the minimum required Qt version to 5.5. (user: js, size: 19170) [annotate] [blame] [check-ins using]
To Artifact [df0e867276]:
- File src/QtWidgets/QtWidget.mm — part of check-in [860515ac5a] at 2017-05-08 00:11:18 on branch trunk — Update to recent ObjFW changes (user: js, size: 19248) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
36 37 38 39 40 41 42 | @implementation QtWidget + (void)initialize { if (self == [QtWidget class]) [self inheritMethodsFromClass: [QtPaintDevice class]]; } | | | | | | | | | | 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 | @implementation QtWidget + (void)initialize { if (self == [QtWidget class]) [self inheritMethodsFromClass: [QtPaintDevice class]]; } - initWithQObject: (QObject *)qObject { OF_INVALID_INIT_METHOD } - initWithQWidget: (QWidget *)qWidget { return [super initWithQObject: qWidget]; } - (QWidget *)qWidget { return qobject_cast<QWidget *>(_qObject); } - (bool)acceptDrops { return toQt(self)->acceptDrops(); } - (void)setAcceptDrops: (bool)acceptDrops { toQt(self)->setAcceptDrops(acceptDrops); } - (OFString *)accessibleDescription { return toOF(toQt(self)->accessibleDescription()); } - (void)setAccessibleDescription: (OFString *)accessibleDescription { toQt(self)->setAccessibleDescription(toQt(accessibleDescription)); } - (OFString *)accessibleName { return toOF(toQt(self)->accessibleName()); } - (void)setAccessibleName: (OFString *)accessibleName { toQt(self)->setAccessibleName(toQt(accessibleName)); } - (bool)autoFillBackground { return toQt(self)->autoFillBackground(); |
︙ | ︙ | |||
161 162 163 164 165 166 167 | } - (void)setFocusPolicy: (Qt::FocusPolicy)focusPolicy { toQt(self)->setFocusPolicy(focusPolicy); } | | | | 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | } - (void)setFocusPolicy: (Qt::FocusPolicy)focusPolicy { toQt(self)->setFocusPolicy(focusPolicy); } - (const QFont &)font { return toQt(self)->font(); } - (void)setFont: (const QFont &)font { toQt(self)->setFont(font); } - (of_rectangle_t)frameGeometry { return toOF(toQt(self)->frameGeometry()); |
︙ | ︙ | |||
341 342 343 344 345 346 347 | } - (of_rectangle_t)normalGeometry { return toOF(toQt(self)->normalGeometry()); } | | | | 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 | } - (of_rectangle_t)normalGeometry { return toOF(toQt(self)->normalGeometry()); } - (const QPalette &)palette { return toQt(self)->palette(); } - (void)setPalette: (const QPalette &)palette { toQt(self)->setPalette(palette); } - (of_point_t)pos { return toOF(toQt(self)->pos()); |
︙ | ︙ | |||
401 402 403 404 405 406 407 | } - (void)setSizePolicy: (QSizePolicy)sizePolicy { toQt(self)->setSizePolicy(sizePolicy); } | | | | | | | | 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 | } - (void)setSizePolicy: (QSizePolicy)sizePolicy { toQt(self)->setSizePolicy(sizePolicy); } - (OFString *)statusTip { return toOF(toQt(self)->statusTip()); } - (void)setStatusTip: (OFString *)statusTip { toQt(self)->setStatusTip(toQt(statusTip)); } - (OFString *)styleSheet { return toOF(toQt(self)->styleSheet()); } - (void)setStyleSheet: (OFString *)styleSheet { toQt(self)->setStyleSheet(toQt(styleSheet)); } - (OFString *)toolTip { return toOF(toQt(self)->toolTip()); } - (void)setToolTip: (OFString *)toolTip { toQt(self)->setToolTip(toQt(toolTip)); } - (int)toolTipDuration { return toQt(self)->toolTipDuration(); |
︙ | ︙ | |||
461 462 463 464 465 466 467 | } - (void)setVisible: (bool)visible { toQt(self)->setVisible(visible); } | | | | | | 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 | } - (void)setVisible: (bool)visible { toQt(self)->setVisible(visible); } - (OFString *)whatsThis { return toOF(toQt(self)->whatsThis()); } - (void)setWhatsThis: (OFString *)whatsThis { toQt(self)->setWhatsThis(toQt(whatsThis)); } - (int)width { return toQt(self)->width(); } - (OFString *)windowFilePath { return toOF(toQt(self)->windowFilePath()); } - (void)setWindowFilePath: (OFString *)windowFilePath { toQt(self)->setWindowFilePath(toQt(windowFilePath)); } - (Qt::WindowFlags)windowFlags { return toQt(self)->windowFlags(); |
︙ | ︙ | |||
536 537 538 539 540 541 542 | } - (void)setWindowOpacity: (double)windowOpacity { toQt(self)->setWindowOpacity(windowOpacity); } | | | | | | | | | | | 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 | } - (void)setWindowOpacity: (double)windowOpacity { toQt(self)->setWindowOpacity(windowOpacity); } - (OFString *)windowTitle { return toOF(toQt(self)->windowTitle()); } - (void)setWindowTitle: (OFString *)windowTitle { toQt(self)->setWindowTitle(toQt(windowTitle)); } - (int)x { return toQt(self)->x(); } - (int)y { return toQt(self)->y(); } - (OFArray OF_GENERIC(QtAction *) *)actions { const QList<QAction *> &actions = toQt(self)->actions(); OFMutableArray *ret = [OFMutableArray arrayWithCapacity: actions.count()]; void *pool = objc_autoreleasePoolPush(); for (QAction *action: actions) [ret addObject: toOF(action)]; [ret makeImmutable]; objc_autoreleasePoolPop(pool); return ret; } - (void)activateWindow { toQt(self)->activateWindow(); } - (void)addAction: (QtAction *)action { toQt(self)->addAction(toQt(action)); } - (void)addActions: (OFArray OF_GENERIC(QtAction *) *)actions { QList<QAction *> list; for (QtAction *action in actions) list.append(toQt(action)); toQt(self)->addActions(list); } - (void)adjustSize { toQt(self)->adjustSize(); } - (QPalette::ColorRole)backgroundRole { return toQt(self)->backgroundRole(); } - (QBackingStore *)backingStore { return toQt(self)->backingStore(); } - (QtWidget *)childAt: (of_point_t)point { return toOF(toQt(self)->childAt(toQt(point))); } - (void)clearFocus { return toQt(self)->clearFocus(); |
︙ | ︙ | |||
643 644 645 646 647 648 649 | } - (void)ensurePolished { toQt(self)->ensurePolished(); } | | | | 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 | } - (void)ensurePolished { toQt(self)->ensurePolished(); } - (QtWidget *)focusProxy { return toOF(toQt(self)->focusProxy()); } - (QtWidget *)focusWidget { return toOF(toQt(self)->focusWidget()); } - (QFontInfo)fontInfo { return toQt(self)->fontInfo(); |
︙ | ︙ | |||
694 695 696 697 698 699 700 | } - (void)grabMouse { toQt(self)->grabMouse(); } | | | | | | | 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 | } - (void)grabMouse { toQt(self)->grabMouse(); } - (void)grabMouseWithCursor: (const QCursor &)cursor { toQt(self)->grabMouse(cursor); } - (int)grabShortcutWithKey: (const QKeySequence &)key { return toQt(self)->grabShortcut(key); } - (int)grabShortcutWithKey: (const QKeySequence &)key context: (Qt::ShortcutContext)context { return toQt(self)->grabShortcut(key, context); } - (QGraphicsEffect *)graphicsEffect { return toQt(self)->graphicsEffect(); } - (QGraphicsProxyWidget *)graphicsProxyWidget { return toQt(self)->graphicsProxyWidget(); } #ifdef QT_KEYPAD_NAVIGATION - (bool)hasEditFocus { |
︙ | ︙ | |||
742 743 744 745 746 747 748 | } - (QVariant)queryInputMethod: (Qt::InputMethodQuery)query { return toQt(self)->inputMethodQuery(query); } | | | | | | | | | | | | | | | | | | | | | | | | 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 | } - (QVariant)queryInputMethod: (Qt::InputMethodQuery)query { return toQt(self)->inputMethodQuery(query); } - (void)insertAction: (QtAction *)action before: (QtAction *)before { toQt(self)->insertAction(toQt(before), toQt(action)); } - (void)insertActions: (OFArray OF_GENERIC(QtAction *) *)actions before: (QtAction *)before { QList<QAction *> list; for (QtAction *action in actions) list.append(toQt(action)); toQt(self)->insertActions(toQt(before), list); } - (bool)isAncestorOf: (QtWidget *)child { return toQt(self)->isAncestorOf(toQt(child)); } - (bool)isEnabledTo: (QtWidget *)ancestor { return toQt(self)->isEnabledTo(toQt(ancestor)); } - (bool)isHidden { return toQt(self)->isHidden(); } - (bool)isVisibleTo: (QtWidget *)ancestor { return toQt(self)->isVisibleTo(toQt(ancestor)); } - (bool)isWindow { return toQt(self)->isWindow(); } - (of_point_t)mapPosition: (of_point_t)pos from: (QtWidget *)parent { return toOF(toQt(self)->mapFrom(toQt(parent), toQt(pos))); } - (of_point_t)mapPositionFromGlobal: (of_point_t)pos { return toOF(toQt(self)->mapFromGlobal(toQt(pos))); } - (of_point_t)mapPositionFromParent: (of_point_t)pos { return toOF(toQt(self)->mapFromParent(toQt(pos))); } - (of_point_t)mapPosition: (of_point_t)pos to: (QtWidget *)parent { return toOF(toQt(self)->mapTo(toQt(parent), toQt(pos))); } - (of_point_t)mapPositionToGlobal: (of_point_t)pos { return toOF(toQt(self)->mapToGlobal(toQt(pos))); } - (of_point_t)mapPositionToParent: (of_point_t)pos { return toOF(toQt(self)->mapToParent(toQt(pos))); } - (QRegion)mask { return toQt(self)->mask(); } - (QtWidget *)nativeParentWidget { return toOF(toQt(self)->nativeParentWidget()); } - (QtWidget *)nextInFocusChain { return toOF(toQt(self)->nextInFocusChain()); } - (void)overrideWindowFlags: (Qt::WindowFlags)flags { toQt(self)->overrideWindowFlags(flags); } - (QtWidget *)parentWidget { return toOF(toQt(self)->parentWidget()); } - (QtWidget *)previousInFocusChain { return toOF(toQt(self)->previousInFocusChain()); } - (void)releaseKeyboard { toQt(self)->releaseKeyboard(); } - (void)releaseMouse { toQt(self)->releaseMouse(); } - (void)releaseShortcut: (int)ID { toQt(self)->releaseShortcut(ID); } - (void)removeAction: (QtAction *)action { toQt(self)->removeAction(toQt(action)); } - (void)renderIntoPaintDevice: (QtObject <QtPaintDevice> *)target targetOffset: (of_point_t)targetOffset sourceRegion: (QRegion)sourceRegion { toQt(self)->render([target qPaintDevice], toQt(targetOffset), sourceRegion); } - (void)renderIntoPaintDevice: (QtObject <QtPaintDevice> *)target targetOffset: (of_point_t)targetOffset sourceRegion: (QRegion)sourceRegion flags: (QWidget::RenderFlags)renderFlags { toQt(self)->render([target qPaintDevice], toQt(targetOffset), sourceRegion, renderFlags); } - (void)renderIntoPainter: (QPainter *)target targetOffset: (of_point_t)targetOffset sourceRegion: (QRegion)sourceRegion { toQt(self)->render(target, toQt(targetOffset), sourceRegion); } - (void)renderIntoPainter: (QPainter *)target targetOffset: (of_point_t)targetOffset sourceRegion: (QRegion)sourceRegion flags: (QWidget::RenderFlags)renderFlags { toQt(self)->render(target, toQt(targetOffset), sourceRegion, renderFlags); } - (void)repaintInRectangle: (of_rectangle_t)rect { toQt(self)->repaint(toQt(rect)); } - (void)repaintInRegion: (const QRegion &)region { toQt(self)->repaint(region); } - (bool)restoreGeometry: (OFDataArray *)geometry { return toQt(self)->restoreGeometry(toQt(geometry)); } - (OFDataArray *)saveGeometry { return toOF(toQt(self)->saveGeometry()); } - (void)scrollRight: (int)dx down: (int)dy { |
︙ | ︙ | |||
965 966 967 968 969 970 971 | } - (void)setFocus: (Qt::FocusReason)reason { toQt(self)->setFocus(reason); } | | | | | | | | | | | | | 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 | } - (void)setFocus: (Qt::FocusReason)reason { toQt(self)->setFocus(reason); } - (void)setFocusProxy: (QtWidget *)widget { toQt(self)->setFocusProxy(toQt(widget)); } - (void)setForegroundRole: (QPalette::ColorRole)role { toQt(self)->setForegroundRole(role); } - (void)setGraphicsEffect: (QGraphicsEffect *)effect { toQt(self)->setGraphicsEffect(effect); } - (void)setLayout: (QLayout *)layout { toQt(self)->setLayout(layout); } - (void)setMaskFromBitmap: (const QBitmap &)bitmap { toQt(self)->setMask(bitmap); } - (void)setMask: (const QRegion &)region { toQt(self)->setMask(region); } - (void)setParent: (QtWidget *)parent { toQt(self)->setParent(toQt(parent)); } - (void)setParent: (QtWidget *)parent flags: (Qt::WindowFlags)flags { toQt(self)->setParent(toQt(parent), flags); } - (void)setAutoRepeat: (bool)enable forShortcut: (int)ID { toQt(self)->setShortcutAutoRepeat(ID, enable); } - (void)setEnabled: (bool)enable forShortcut: (int)ID { toQt(self)->setShortcutEnabled(ID, enable); } - (void)setStyle: (QStyle *)style { toQt(self)->setStyle(style); } - (void)setWindowRole: (OFString *)role { toQt(self)->setWindowRole(toQt(role)); } - (void)setWindowState: (Qt::WindowStates)windowState { toQt(self)->setWindowState(windowState); } - (void)stackUnder: (QtWidget *)widget { toQt(self)->stackUnder(toQt(widget)); } - (QStyle *)style { return toQt(self)->style(); } - (bool)testAttribute: (Qt::WidgetAttribute)attribute { return toQt(self)->testAttribute(attribute); |
︙ | ︙ | |||
1063 1064 1065 1066 1067 1068 1069 | } - (void)updateInRectangle: (of_rectangle_t)rect { toQt(self)->update(toQt(rect)); } | | | | | | 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 | } - (void)updateInRectangle: (of_rectangle_t)rect { toQt(self)->update(toQt(rect)); } - (void)updateInRegion: (const QRegion &)region { toQt(self)->update(region); } - (void)updateGeometry { toQt(self)->updateGeometry(); } - (QRegion)visibleRegion { return toQt(self)->visibleRegion(); } - (WId)winID { return toQt(self)->winId(); } - (QtWidget *)window { return toOF(toQt(self)->window()); } - (QWindow *)windowHandle { return toQt(self)->windowHandle(); } - (OFString *)windowRole { return toOF(toQt(self)->windowRole()); } - (Qt::WindowStates)windowState { return toQt(self)->windowState(); |
︙ | ︙ |