Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [Solved] How to prevent internal editor from invoking with QLineEdit
QtWS25 Last Chance

[Solved] How to prevent internal editor from invoking with QLineEdit

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 2 Posters 2.3k 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
    frankiwawa
    wrote on last edited by
    #1

    Hi,

    I have subclassed QLineEdit, because I need to have control on what is entered into it (basically it's a field for changing PIN code to application) so I have buttons and user is supposed to click on them to enter old PIN/new PIN (this is page for changing it). Now, because I subclassed QLineEdit it is sending clicked() signal, so i know which one is edited, but how to disable internal editor from showing up?
    I'm using Qt 4.7.3 on Symbian^3 (N8)

    best regards
    Marek

    1 Reply Last reply
    0
    • BilbonSacquetB Offline
      BilbonSacquetB Offline
      BilbonSacquet
      wrote on last edited by
      #2

      Could be more clear on what you are asking. I have difficulties to understand the situation.

      You say you have buttons (QPushButton) ... but in this case you should have a widget containing this button (a QLineEdit is not a container!).
      Now you are saying 'how to disable internal editor', a QTextEdit without editor is a QLabel, isn't?

      1 Reply Last reply
      0
      • F Offline
        F Offline
        frankiwawa
        wrote on last edited by
        #3

        So I have page (on my application) called "PIN change" - this is PIN to log into this application.
        On this page I have buttons arranged as a keyboard from phone (1,2,3,...0) and I have three fields (currently QLineEdit's) with labels: enter old pin, enter new pin, reenter new pin.
        Now user is supposed to enter old pin and new pin by clicking numbers on my keyboard. I connected signal clicked (from subclassed QLineEdit) to some function that enables my keyboard and when user clicks the numbers they appear on proper QLineEdit.
        PIN should have only numbers, four of them, thats why I made keyboard.
        So the problem is that when user clicks on QLineEdit (in order to emit signal clicked, which I intercept, to get notification which pin is entered now, old or new) the default text editor is called with characters, digits and symbols - and I don't need that.

        However maybe I simply shouldn't use QLineEdit at all, just some QLabel with proper background color and subclass it if it doesn't already have clicked() signal - thats probably simplest solution.

        Marek

        1 Reply Last reply
        0
        • BilbonSacquetB Offline
          BilbonSacquetB Offline
          BilbonSacquet
          wrote on last edited by
          #4

          That's exactly the remark I will do: why not a QLabel. You're never editing why did you need such a complex one? But of course which could more could less, the QTextEdit has a read-only modus:

          @myTextEdit->setReadOnly(true);@

          1 Reply Last reply
          0
          • F Offline
            F Offline
            frankiwawa
            wrote on last edited by
            #5

            Right, setReadOnly works for me.

            Many thanks
            Marek

            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