qfontdialog.sip 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // qfontdialog.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtWidgets Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  8. //
  9. // This file may be used under the terms of the GNU General Public License
  10. // version 3.0 as published by the Free Software Foundation and appearing in
  11. // the file LICENSE included in the packaging of this file. Please review the
  12. // following information to ensure the GNU General Public License version 3.0
  13. // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  14. //
  15. // If you do not wish to use this file under the terms of the GPL version 3.0
  16. // then you may purchase a commercial license. For more information contact
  17. // info@riverbankcomputing.com.
  18. //
  19. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. class QFontDialog : public QDialog
  22. {
  23. %TypeHeaderCode
  24. #include <qfontdialog.h>
  25. %End
  26. public:
  27. enum FontDialogOption /BaseType=Flag/
  28. {
  29. NoButtons,
  30. DontUseNativeDialog,
  31. ScalableFonts,
  32. NonScalableFonts,
  33. MonospacedFonts,
  34. ProportionalFonts,
  35. };
  36. typedef QFlags<QFontDialog::FontDialogOption> FontDialogOptions;
  37. explicit QFontDialog(QWidget *parent /TransferThis/ = 0);
  38. QFontDialog(const QFont &initial, QWidget *parent /TransferThis/ = 0);
  39. virtual ~QFontDialog();
  40. static QFont getFont(bool *ok, const QFont &initial, QWidget *parent = 0, const QString &caption = QString(), QFontDialog::FontDialogOptions options = QFontDialog::FontDialogOptions()) /ReleaseGIL/;
  41. static QFont getFont(bool *ok, QWidget *parent = 0) /ReleaseGIL/;
  42. protected:
  43. virtual void changeEvent(QEvent *e);
  44. virtual void done(int result);
  45. virtual bool eventFilter(QObject *object, QEvent *event);
  46. public:
  47. void setCurrentFont(const QFont &font);
  48. QFont currentFont() const;
  49. QFont selectedFont() const;
  50. void setOption(QFontDialog::FontDialogOption option, bool on = true);
  51. bool testOption(QFontDialog::FontDialogOption option) const;
  52. void setOptions(QFontDialog::FontDialogOptions options);
  53. QFontDialog::FontDialogOptions options() const;
  54. virtual void open();
  55. void open(SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/);
  56. %MethodCode
  57. QObject *receiver;
  58. QByteArray slot_signature;
  59. if ((sipError = pyqt6_qtwidgets_get_connection_parts(a0, sipCpp, "()", false, &receiver, slot_signature)) == sipErrorNone)
  60. {
  61. sipCpp->open(receiver, slot_signature.constData());
  62. }
  63. else if (sipError == sipErrorContinue)
  64. {
  65. sipError = sipBadCallableArg(0, a0);
  66. }
  67. %End
  68. virtual void setVisible(bool visible);
  69. signals:
  70. void currentFontChanged(const QFont &font);
  71. void fontSelected(const QFont &font);
  72. };