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. how to enter a data in a Qline edit which has mask
Forum Updated to NodeBB v4.3 + New Features

how to enter a data in a Qline edit which has mask

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

    I have a qline edit and i have set a mask like qlineedit->setInputMask("0000.000");

    now i have a button when it is pressed i will enter a number in the qlineedit. for example consider a calculator in which we press a number it will be displayed in qlineedit.

    similarly when i press the button it is being displayed inQlineedit as " .4 "
    when ever i press the value is being entered after the dot(.) . how to make it enter from the beginning?

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

      Hi
      Could show how you " enter a number in the qlineedit. " ? ( with the button)

      ManiRonM 1 Reply Last reply
      0
      • mrjjM mrjj

        Hi
        Could show how you " enter a number in the qlineedit. " ? ( with the button)

        ManiRonM Offline
        ManiRonM Offline
        ManiRon
        wrote on last edited by
        #3

        @mrjj i changed it and it is working

        int iLen = strInput.length();
        if(iLen <= 5)
        {
        strInput.insert(iLen-1,"5");
        ui->le_FreqTxtInput->setText(strInput);
        }
        else
        {
        ui->le_FreqTxtInput->setText(strInput+"5");
        }

        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