QKeySequenceEdit, how to change placeholder Text?
Solved
General and Desktop
-
Hi there..
I want to localize the Placeholder Text of a QKeySequenceEdit Widget via my own system.
It works with LineEdits and such, by changing the placeholderText.
But the Key Sequencer doesn´t include a set function for it.Is there a way to change it?
Edit: Meant is the "Press Shortcut" Placeholder Text.. I can't figure out, how to access it with get/set..
-
@BDC_Patrick Demo:
#include <QApplication> #include <QKeySequenceEdit> #include <QLineEdit> #include <QDebug> int main(int argc, char *argv[]) { QApplication a(argc, argv); QKeySequenceEdit editor; QObject::connect(&editor, &QKeySequenceEdit::editingFinished, [&editor](){ qDebug() << editor.keySequence(); }); if(QLineEdit *lineEdit = editor.findChild<QLineEdit*>("qt_keysequenceedit_lineedit")){ lineEdit->setPlaceholderText("Qt is awesome!!!"); } editor.show(); return a.exec(); }
-
@eyllanesc Works like a Charme! Thanks Mate!! :D