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

read character QLineEdit

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 398 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.
  • S Offline
    S Offline
    s002wjh
    wrote on last edited by
    #1

    whats the command/syntax to read string/character from QLineEdit?

    for example i type 5,6 i need get 5, then comma , then 6 and use it as 2 different input for other code

    JonBJ 1 Reply Last reply
    0
    • S s002wjh

      whats the command/syntax to read string/character from QLineEdit?

      for example i type 5,6 i need get 5, then comma , then 6 and use it as 2 different input for other code

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

      @s002wjh
      http://doc.qt.io/qt-5/qlineedit.html#text-prop, QLineEdit::text(). Did you try the docs?

      1 Reply Last reply
      3
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by mrjj
        #3

        Hi
        adding to jonB
        the text() returns a QString and you can access each char with the
        at() function
        http://doc.qt.io/qt-5/qstring.html#at

        Make sure you check string length before using this functions as
        it will crash the app if you do not handle it with care.

        1 Reply Last reply
        3

        • Login

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