I have a custom datetimewidget that is set up like this:
1. When invalid datetime:
datetime_invalid.PNG
- 2 QPushButtons showing that the date and time are invalid.
2. When valid datetime:
datetime_valid.PNG
- A QDateEdit and a QTimeEdit. These are hidden if invalid datetime, and shown only if valid datetime
This datetimewidget is placed within a QGroupBox and then on a QScrollArea.
If starting out with an invalid datetime, clicking one of the buttons give you a valid datetime, hides the buttons and shows the controls. This works fine, except that the QScrollArea scrolls to top. Does anyone have an idea on where to look for what initiates this?
I've found some hints, but are still stuck on this:
- If I drop the QPushButton.hide() on the button that is hit, I don't get the unwanted scroll-behaviour. However, I really want to hide this button...
- If I drop the blockSignals true/false around the setting of current datetime to the QDateEdit and QTimeEdit, I don't get this problem. However, the blockSignals are needed to avoid signals of edited datetime when it's actually not edited.
Thanks alot!
TomasL
Bookmarks