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?
Forum Updated to NodeBB v4.3 + New Features

QKeySequenceEdit, how to change placeholder Text?

Scheduled Pinned Locked Moved Solved General and Desktop
cppplaceholdertextkeysequenceedit
3 Posts 2 Posters 676 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.
  • BDC_PatrickB Offline
    BDC_PatrickB Offline
    BDC_Patrick
    wrote on 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..

    eyllanescE 1 Reply Last reply
    0
    • BDC_PatrickB BDC_Patrick

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

      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on 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.

      BDC_PatrickB 1 Reply Last reply
      4
      • eyllanescE eyllanesc

        @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();
        }
        
        BDC_PatrickB Offline
        BDC_PatrickB Offline
        BDC_Patrick
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0

        • Login

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