Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Different behaviors of QDateEdit Widget on different PCs



  • I'm using two identical QDateEdit widgets, they're used in the format MM/DD/YYYY, when I run the application, they work as expected, but when I generate the executable using pyinstaller, a weird behavior happens at the other PC I'm working on.
    0_1527342240817_65deb3c3-7fb2-405c-9bba-5a41246ac4f8-image.png

    Although, By default, QDateEdit prevents out of range dates.

    On the other PC, one of the QDateEdit widgets work with another format DD/MM/YYYY, and the other works as expected, I don't know where the problem might be, and any help would be great.

    0_1527342264198_eaffc2b7-1ab7-457f-8d28-a71ff9546e0c-image.png


  • Qt Champions 2019

    Without code it's hard to guess. I would create a simple test example which only consist of two dateedit to check if the behavior still exits. If not there must be something other wrong in your code.



  • I've figured out the reason, one of the dateedit widgets was following the local date convention for the OS, but the other weren't.

    But I don't know how to make sure that on other PCs they won't follow OS convention.

    I did so by modifying displayformat for both widget to be M/d/yyyy in the qt designer instead of MM/dd/yyyy, But i think there must be another way as through this I don't know why this particular change made the widget not following the OS date display convention


Log in to reply