2

I am using Qt 4.6.3, and tried to set some placeholder text on a QLineEdit. But these methods didn't work:

  • using Qt designer (uic)
  • through code ui->lineedit.setPlaceholderText("phtext")
  • setProperty("placeholderText","phtext")

The error is that setPlaceholderText is not a member of the QLineEdit class.

Is this a bug and\or is there a way to fix it?

yolo
  • 2,757
  • 6
  • 36
  • 65

2 Answers2

8

The placeholderText property was introduced in Qt 4.7 (see documentation), so it doesn't exist in Qt 4.6.

Frank Osterfeld
  • 24,815
  • 5
  • 58
  • 70
1

While the placeholderText property exists in Qt 4.6.3, it's only enabled for Maemo5 builds:

// ### Qt 4.7: remove this #if guard
#if (QT_VERSION >= 0x407000) || defined(Q_WS_MAEMO_5)
    Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText)
#endif

It seems like you're somehow mixing Qt platforms.

Marc Mutz - mmutz
  • 24,485
  • 12
  • 80
  • 90