qinputdialog.sip 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. // qinputdialog.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 QInputDialog : public QDialog
  22. {
  23. %TypeHeaderCode
  24. #include <qinputdialog.h>
  25. %End
  26. public:
  27. enum InputDialogOption /BaseType=Flag/
  28. {
  29. NoButtons,
  30. UseListViewForComboBoxItems,
  31. UsePlainTextEditForTextInput,
  32. };
  33. typedef QFlags<QInputDialog::InputDialogOption> InputDialogOptions;
  34. enum InputMode
  35. {
  36. TextInput,
  37. IntInput,
  38. DoubleInput,
  39. };
  40. static QString getText(QWidget *parent, const QString &title, const QString &label, QLineEdit::EchoMode echo = QLineEdit::Normal, const QString &text = QString(), bool *ok = 0, Qt::WindowFlags flags = Qt::WindowFlags(), Qt::InputMethodHints inputMethodHints = Qt::ImhNone) /ReleaseGIL/;
  41. static int getInt(QWidget *parent, const QString &title, const QString &label, int value = 0, int min = -2147483647, int max = 2147483647, int step = 1, bool *ok = 0, Qt::WindowFlags flags = Qt::WindowFlags()) /ReleaseGIL/;
  42. static double getDouble(QWidget *parent, const QString &title, const QString &label, double value = 0, double min = -2147483647, double max = 2147483647, int decimals = 1, bool *ok = 0, Qt::WindowFlags flags = Qt::WindowFlags(), double step = 1);
  43. static QString getItem(QWidget *parent, const QString &title, const QString &label, const QStringList &items, int current = 0, bool editable = true, bool *ok = 0, Qt::WindowFlags flags = Qt::WindowFlags(), Qt::InputMethodHints inputMethodHints = Qt::ImhNone) /ReleaseGIL/;
  44. static QString getMultiLineText(QWidget *parent, const QString &title, const QString &label, const QString &text = QString(), bool *ok = 0, Qt::WindowFlags flags = Qt::WindowFlags(), Qt::InputMethodHints inputMethodHints = Qt::ImhNone) /ReleaseGIL/;
  45. QInputDialog(QWidget *parent /TransferThis/ = 0, Qt::WindowFlags flags = Qt::WindowFlags());
  46. virtual ~QInputDialog();
  47. void setInputMode(QInputDialog::InputMode mode);
  48. QInputDialog::InputMode inputMode() const;
  49. void setLabelText(const QString &text);
  50. QString labelText() const;
  51. void setOption(QInputDialog::InputDialogOption option, bool on = true);
  52. bool testOption(QInputDialog::InputDialogOption option) const;
  53. void setOptions(QInputDialog::InputDialogOptions options);
  54. QInputDialog::InputDialogOptions options() const;
  55. void setTextValue(const QString &text);
  56. QString textValue() const;
  57. void setTextEchoMode(QLineEdit::EchoMode mode);
  58. QLineEdit::EchoMode textEchoMode() const;
  59. void setComboBoxEditable(bool editable);
  60. bool isComboBoxEditable() const;
  61. void setComboBoxItems(const QStringList &items);
  62. QStringList comboBoxItems() const;
  63. void setIntValue(int value);
  64. int intValue() const;
  65. void setIntMinimum(int min);
  66. int intMinimum() const;
  67. void setIntMaximum(int max);
  68. int intMaximum() const;
  69. void setIntRange(int min, int max);
  70. void setIntStep(int step);
  71. int intStep() const;
  72. void setDoubleValue(double value);
  73. double doubleValue() const;
  74. void setDoubleMinimum(double min);
  75. double doubleMinimum() const;
  76. void setDoubleMaximum(double max);
  77. double doubleMaximum() const;
  78. void setDoubleRange(double min, double max);
  79. void setDoubleDecimals(int decimals);
  80. int doubleDecimals() const;
  81. void setOkButtonText(const QString &text);
  82. QString okButtonText() const;
  83. void setCancelButtonText(const QString &text);
  84. QString cancelButtonText() const;
  85. virtual void open();
  86. void open(SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/);
  87. %MethodCode
  88. QObject *receiver;
  89. QByteArray slot_signature;
  90. if ((sipError = pyqt6_qtwidgets_get_connection_parts(a0, sipCpp, "()", false, &receiver, slot_signature)) == sipErrorNone)
  91. {
  92. sipCpp->open(receiver, slot_signature.constData());
  93. }
  94. else if (sipError == sipErrorContinue)
  95. {
  96. sipError = sipBadCallableArg(0, a0);
  97. }
  98. %End
  99. virtual QSize minimumSizeHint() const;
  100. virtual QSize sizeHint() const;
  101. virtual void setVisible(bool visible);
  102. virtual void done(int result);
  103. signals:
  104. void textValueChanged(const QString &text);
  105. void textValueSelected(const QString &text);
  106. void intValueChanged(int value);
  107. void intValueSelected(int value);
  108. void doubleValueChanged(double value);
  109. void doubleValueSelected(double value);
  110. public:
  111. void setDoubleStep(double step);
  112. double doubleStep() const;
  113. };