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

lineEdit button setDefault

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 240 Views
  • 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.
  • F Offline
    F Offline
    fornakter
    wrote on last edited by
    #1

    Hi.
    I want to setDefault for button when i use a specific lineEdit. How can i do that?
    When i setDefault button i still cant use that button when i press 'Enter'.

    JonBJ 1 Reply Last reply
    0
    • F fornakter

      Hi.
      I want to setDefault for button when i use a specific lineEdit. How can i do that?
      When i setDefault button i still cant use that button when i press 'Enter'.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @fornakter said in lineEdit button setDefault:

      want to setDefault for button when i use a specific lineEdit. How can i do that?

      Line edits do not have default buttons. Dialogs do. So what button are you talking about?

      I can only think by catching focus in & out on that line edit and changing/restoring what the default button is as these occur.

      When i setDefault button i still cant use that button when i press 'Enter'.

      Press Enter where? If you mean when the focus is in a QLineEdit I believe that "swallows" the Enter. Use QLineEdit::returnPressed signal, e.g. https://stackoverflow.com/questions/15561608/detecting-enter-on-a-qlineedit-or-qpushbutton ?

      1 Reply Last reply
      2
      • F Offline
        F Offline
        fornakter
        wrote on last edited by
        #3

        Thank you.
        Simple 'lineEdit.returnPressed.connect' resolve my problem.
        I didn't think about that, lineEdit 'swallows' Enter.
        Thank You again.

        1 Reply Last reply
        1

        • Login

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