src/gui/widgets/qlineedit.h
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    42 #ifndef QLINEEDIT_H
    42 #ifndef QLINEEDIT_H
    43 #define QLINEEDIT_H
    43 #define QLINEEDIT_H
    44 
    44 
    45 #include <QtGui/qframe.h>
    45 #include <QtGui/qframe.h>
    46 #include <QtCore/qstring.h>
    46 #include <QtCore/qstring.h>
       
    47 #include <QtCore/qmargins.h>
    47 
    48 
    48 QT_BEGIN_HEADER
    49 QT_BEGIN_HEADER
    49 
    50 
    50 QT_BEGIN_NAMESPACE
    51 QT_BEGIN_NAMESPACE
    51 
    52 
    80     Q_PROPERTY(bool dragEnabled READ dragEnabled WRITE setDragEnabled)
    81     Q_PROPERTY(bool dragEnabled READ dragEnabled WRITE setDragEnabled)
    81     Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
    82     Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
    82     Q_PROPERTY(bool undoAvailable READ isUndoAvailable)
    83     Q_PROPERTY(bool undoAvailable READ isUndoAvailable)
    83     Q_PROPERTY(bool redoAvailable READ isRedoAvailable)
    84     Q_PROPERTY(bool redoAvailable READ isRedoAvailable)
    84     Q_PROPERTY(bool acceptableInput READ hasAcceptableInput)
    85     Q_PROPERTY(bool acceptableInput READ hasAcceptableInput)
       
    86 // ### Qt 4.7: remove this #if guard
       
    87 #if (QT_VERSION >= 0x407000) || defined(Q_WS_MAEMO_5)
       
    88     Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText)
       
    89 #endif
    85 
    90 
    86 public:
    91 public:
    87     explicit QLineEdit(QWidget* parent=0);
    92     explicit QLineEdit(QWidget* parent=0);
    88     explicit QLineEdit(const QString &, QWidget* parent=0);
    93     explicit QLineEdit(const QString &, QWidget* parent=0);
    89 #ifdef QT3_SUPPORT
    94 #ifdef QT3_SUPPORT
    94     ~QLineEdit();
    99     ~QLineEdit();
    95 
   100 
    96     QString text() const;
   101     QString text() const;
    97 
   102 
    98     QString displayText() const;
   103     QString displayText() const;
       
   104 
       
   105 // ### Qt 4.7: remove this #if guard
       
   106 #if (QT_VERSION >= 0x407000) || defined(Q_WS_MAEMO_5)
       
   107     QString placeholderText() const;
       
   108     void setPlaceholderText(const QString &);
       
   109 #endif
    99 
   110 
   100     int maxLength() const;
   111     int maxLength() const;
   101     void setMaxLength(int);
   112     void setMaxLength(int);
   102 
   113 
   103     void setFrame(bool);
   114     void setFrame(bool);
   156     QString inputMask() const;
   167     QString inputMask() const;
   157     void setInputMask(const QString &inputMask);
   168     void setInputMask(const QString &inputMask);
   158     bool hasAcceptableInput() const;
   169     bool hasAcceptableInput() const;
   159 
   170 
   160     void setTextMargins(int left, int top, int right, int bottom);
   171     void setTextMargins(int left, int top, int right, int bottom);
       
   172     void setTextMargins(const QMargins &margins);
   161     void getTextMargins(int *left, int *top, int *right, int *bottom) const;
   173     void getTextMargins(int *left, int *top, int *right, int *bottom) const;
       
   174     QMargins textMargins() const;
   162 
   175 
   163 public Q_SLOTS:
   176 public Q_SLOTS:
   164     void setText(const QString &);
   177     void setText(const QString &);
   165     void clear();
   178     void clear();
   166     void selectAll();
   179     void selectAll();
   273     Q_PRIVATE_SLOT(d_func(), void _q_completionHighlighted(QString))
   286     Q_PRIVATE_SLOT(d_func(), void _q_completionHighlighted(QString))
   274 #endif
   287 #endif
   275 #ifdef QT_KEYPAD_NAVIGATION
   288 #ifdef QT_KEYPAD_NAVIGATION
   276     Q_PRIVATE_SLOT(d_func(), void _q_editFocusChange(bool))
   289     Q_PRIVATE_SLOT(d_func(), void _q_editFocusChange(bool))
   277 #endif
   290 #endif
       
   291     Q_PRIVATE_SLOT(d_func(), void _q_selectionChanged())
   278 };
   292 };
   279 
   293 
   280 #endif // QT_NO_LINEEDIT
   294 #endif // QT_NO_LINEEDIT
   281 
   295 
   282 QT_END_NAMESPACE
   296 QT_END_NAMESPACE