Results 1 to 2 of 2

Thread: QWidgetTable filtering text only numbers using QLineEdit and QDoubleValidator issue

  1. #1
    Join Date
    Mar 2013
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X

    Question QWidgetTable filtering text only numbers using QLineEdit and QDoubleValidator issue

    hi there,
    i have a a QTableWidget that have to handle only double values and i don't know how to achieve it... i googled a lot and some confusing solutions found, i tried this one:
    if understood well what im trying to do is like puttin QLineEdit into the QTableWIdgetItems selected by appropriate Slot (named myCellChanged); problem is when i finish to fill the table items it has an anormal behavior as sometimes it filter inputs and sometimes no.... what I'm doing wrong?


    Here's my source:
    http://pastebin.com/FXGS5Rpf


    thanks

  2. #2
    Join Date
    Sep 2012
    Location
    Pune, India
    Posts
    18
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QWidgetTable filtering text only numbers using QLineEdit and QDoubleValidator iss

    What you want to do is use editors for items in QTableWidget. I would highly recommend you to use QItemEditorFactory. There are default editors available and also you can create and use your own.

Similar Threads

  1. QLineEdit for editing hexadecimal and decimal numbers
    By schall_l in forum Qt Programming
    Replies: 2
    Last Post: 28th April 2012, 12:38
  2. Negative numbers on QLineEdit
    By Cucus in forum Qt Tools
    Replies: 1
    Last Post: 22nd April 2011, 14:51
  3. Enter only numbers in the text edit??
    By Gokulnathvc in forum Newbie
    Replies: 8
    Last Post: 23rd March 2011, 19:01
  4. how convert numbers into text
    By tommy in forum Qt Programming
    Replies: 4
    Last Post: 5th August 2009, 11:01
  5. a Text Editor with line numbers...
    By fullmetalcoder in forum Qt Programming
    Replies: 47
    Last Post: 5th April 2006, 12:10

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.