Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QKeySequenceEdit, how to change placeholder Text?
Servers for Qt installer are currently down

QKeySequenceEdit, how to change placeholder Text?

Scheduled Pinned Locked Moved Solved General and Desktop
cppplaceholdertextkeysequenceedit
3 Posts 2 Posters 698 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BDC_Patrick
    wrote on 30 Aug 2021, 11:11 last edited by BDC_Patrick
    #1

    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..

    E 1 Reply Last reply 30 Aug 2021, 17:50
    0
    • B BDC_Patrick
      30 Aug 2021, 11:11

      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..

      E Offline
      E Offline
      eyllanesc
      wrote on 30 Aug 2021, 17:50 last edited by
      #2

      @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();
      }
      

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      B 1 Reply Last reply 31 Aug 2021, 10:56
      4
      • E eyllanesc
        30 Aug 2021, 17:50

        @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();
        }
        
        B Offline
        B Offline
        BDC_Patrick
        wrote on 31 Aug 2021, 10:56 last edited by
        #3

        @eyllanesc Works like a Charme! Thanks Mate!! :D

        1 Reply Last reply
        0

        1/3

        30 Aug 2021, 11:11

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved