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. QWidgetTable filtering text only numbers using QLineEdit and QDoubleValidator
Forum Updated to NodeBB v4.3 + New Features

QWidgetTable filtering text only numbers using QLineEdit and QDoubleValidator

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.2k 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.
  • T Offline
    T Offline
    tundo
    wrote on last edited by
    #1

    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

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

      Hi,

      Have a look at the "Spin Box Delegate Example":http://qt-project.org/doc/qt-4.8/itemviews-spinboxdelegate.html it is easily adaptable to use a QDoubleSpinBox and seems to fit your need.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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