Important: Please read the Qt Code of Conduct -

QTableView Behavior with Windows 7

  • Hello all.

    I have a problem where I have a tableview set up to update quote detail records on Windows 7 systems. When entering the unit price field...a spin box appears when editiing and we are limited to 2 places to the right of the decimal point. (We need 4.) Its fine when adding a new detail allows all 4 decimals to be entered, and no spin box appears. To take it a step further, the exact same executable on an XP system does not display the spin box and allows the flexibility to enter 4 decimal places in both add and update mode.

    Can someone explain what I need to do to correct?



  • Lifetime Qt Champion


    Is it the same executable for both OS ? Or did you build one for XP and one for 7 ?

  • Its the same executable. The only difference I can see is the operating system.

  • Lifetime Qt Champion

    Strangeā€¦ Can you provide a minimal example that shows the behavior ?

  • Id gladly share anything I can, but I really don't know how to really show you an example. I could send you the CPP, UI, and H files if that's what you want, but its seems a bit much to deal with for you.

    Im relatively new to QT...and the whole tableview class Is a little unfamiliar to me. I don't see how, using tableview, that you can control any data formatting of the information in those fields. Maybe if I understood that I could get pointed in the right direction to get it fixed.

  • Lifetime Qt Champion

    The view uses a QStyledItemDelegate to render the content and create the appropriate editor (for known types) The delegate will determine what the right editor is, based on what the model gives to him.

    You should take a look at the MVC chapters in Qt's documentation, you'll have a nice introduction and overview of how things works. The examples are also a good sources of information.

  • Hello. I have a few questions:

    1. What does MVC stand for? I can't find that in the documentation anywhere.

    2. Since its working on older systems and not on newer, could this be a version problem in QT? The QT creator version we are using is 2.0.0, which as far as I can tell is back from 2010. When I compile using the MAKE RELEASE, I see the folder its looking for files in is c:\qt\4.4.3 ...but don't see a version of the compiler mentioned anywhere else.



  • Lifetime Qt Champion

    1)Model View Controller
    It's explained in the "Introduction to Model/View Programming" chapter.

    1. I don't have such an old version of creator at hand to tell you. You should really consider updating to at least 4.8.5, there's been a lot of improvement and bug fixes

    If you since something like mingw32-* then you are using MinGW otherwise it will be cl.exe then you'll be using Microsoft Visual Studio

  • We are using MinGW. So is this our compiler, and QT Creator is a form designer? Just trying to get my terminology straight.

    I agree, we should get more current with our version...but would we be updating QT creator or MinGW? Or both? When you install the QT creator, is MinGw installed as a part of that...or Is it a separate install?

  • Lifetime Qt Champion

    Yes, MinGW is the compiler, Qt Creator is an IDE which provides code editing feature/debugging/form edition and on more recent version integration of Android/Blackberry/iOS/Embedded Linux targets.

    No, compilers are not a part of Qt Creator (e.g. Visual Studio can only be obtained through Microsoft) However, the MinGW version installer for Qt 5.2 provides the MinGW compiler so you can use that one.

  • Where do I find the "MinGW version Installer for QT 5.2"? I can't find it online, nor does it seem to be part of the qt installation.

  • I was able to find MinGW and installed that, but not sure Ive downloaded the correct version.

  • Lifetime Qt Champion

Log in to reply