Unsolved Adding calendar without changing layout
-
I have a text box in my Qt Designer for DOB insertion, where i need to add calendar in layout but hiding it too which should not disturb my design layout.
-
@Vineela You could use QTabWidget: on one tab you have the text box on the other the calendar and then simply switch between tabs as needed.
-
@jsulm how do i hide them then
-
@Vineela Do you want to hide both at the same time? If so then simply call hide() on the tab widget.
-
@Vineela Oh, sorry! I actually mean QStackedWidget :-)
-
@jsulm i need calendar to be hide when i run page and sorry my coding lang is in python how do i do it then
-
@Vineela Let's clarify it, because I'm still not sure what you really want: you show text box. Then at some point you want to show calendar and afterwards go back to text box? Is this correct? Do you want to show the calendar over the text box? If not where?
" my coding lang is in python how do i do it then" - same way you do it with other Qt widgets, only the programming language syntax is different.
-
Other approach might be a button or an icon (or even a key combination) which displays calendar widget as a popup (I prefer that when working with QLineEdit, always add it as an action with icon).
Anyway, popup approach would have nothing to do with your layout and be displayed only on demand (triggered either by user implicitly or by your code when certain criteria are met).