qfontcombobox.sip 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // qfontcombobox.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 QFontComboBox : public QComboBox
  22. {
  23. %TypeHeaderCode
  24. #include <qfontcombobox.h>
  25. %End
  26. public:
  27. enum FontFilter /BaseType=Flag/
  28. {
  29. AllFonts,
  30. ScalableFonts,
  31. NonScalableFonts,
  32. MonospacedFonts,
  33. ProportionalFonts,
  34. };
  35. typedef QFlags<QFontComboBox::FontFilter> FontFilters;
  36. QFontComboBox::FontFilters fontFilters() const;
  37. explicit QFontComboBox(QWidget *parent /TransferThis/ = 0);
  38. virtual ~QFontComboBox();
  39. void setWritingSystem(QFontDatabase::WritingSystem);
  40. QFontDatabase::WritingSystem writingSystem() const;
  41. void setFontFilters(QFontComboBox::FontFilters filters);
  42. QFont currentFont() const;
  43. virtual QSize sizeHint() const;
  44. public slots:
  45. void setCurrentFont(const QFont &f);
  46. signals:
  47. void currentFontChanged(const QFont &f);
  48. protected:
  49. virtual bool event(QEvent *e);
  50. public:
  51. %If (Qt_6_3_0 -)
  52. void setSampleTextForSystem(QFontDatabase::WritingSystem writingSystem, const QString &sampleText);
  53. %End
  54. %If (Qt_6_3_0 -)
  55. QString sampleTextForSystem(QFontDatabase::WritingSystem writingSystem) const;
  56. %End
  57. %If (Qt_6_3_0 -)
  58. void setSampleTextForFont(const QString &fontFamily, const QString &sampleText);
  59. %End
  60. %If (Qt_6_3_0 -)
  61. QString sampleTextForFont(const QString &fontFamily) const;
  62. %End
  63. %If (Qt_6_3_0 -)
  64. void setDisplayFont(const QString &fontFamily, const QFont &font);
  65. %End
  66. %If (Qt_6_3_0 -)
  67. SIP_PYOBJECT displayFont(const QString &fontFamily) const /TypeHint="Optional[QFont]"/;
  68. %MethodCode
  69. std::optional<QFont> f = sipCpp->displayFont(*a0);
  70. if (f)
  71. {
  72. sipRes = sipConvertFromNewType(new QFont(f.value()), sipType_QFont, NULL);
  73. }
  74. else
  75. {
  76. sipRes = Py_None;
  77. Py_INCREF(sipRes);
  78. }
  79. %End
  80. %End
  81. };