PDA

View Full Version : Pop-up Calendar From Pushbutton



wagmare
16th January 2009, 06:49
Hi friends,
I apologize if its a newbie Question
Please any one help me how to display a widget (just like a popup calender) as a pushButton that when pressed, will disply a pop up calender or any thing ... i just need like this format to add to my taskbar ..

please help
thanks in advance

yleesun
16th January 2009, 07:04
pupo up menu!

wagmare
16th January 2009, 07:15
thanks fo reply
no i want to pop up a widget ( a dialog window) ... when a pushbutton is pressed or toggled...

i don't know how to use extension example here because the my Qt window is only taskbar size (1010X20) with a push button and i don't know how to introduce a 400X400 dialog window above the button on the taskbar ..

its like cutting another window and pasting above the pushbutton on taskbar ..
is there any way .... :)

aamer4yu
16th January 2009, 12:27
You can get the global pos of the event when u press the button.
Based on that calculate the rect wher ur dialog will fit in, and show .

wagmare
16th January 2009, 13:34
thanks for reply :)
I will follow by the way ...
but we cant make any relation with the button and a dialog? i am just asking just to know about it ....
again thanks for the useful suggestion

jpn
16th January 2009, 13:42
Something like this: Calendar Pop Up (http://www.qtcentre.org/forum/f-qt-programming-2/t-calendar-pop-up-17372.html)?

wagmare
16th January 2009, 15:40
exactly this one i needed ... thank you very much .....
QMenu* pushMenu = new QMenu(pushButton);
QCalendarWidget* pushCalendar = new QCalendarWidget(pushMenu);
QWidgetAction* pushAction = new QWidgetAction(pushMenu);
pushAction->setDefaultWidget(pushCalendar);
pushMenu->addAction(pushAction);
pushButton->setMenu(pushMenu);
in place of calender i have to use another widget ..... i get it .. :D

wagmare
28th January 2009, 06:54
i complete inserting a QWidgetAction ->setDefaultWinget(window) ... this window is designed by me and now the problem is that the entire window behaviour is changed as a toggle pushButton clicking anywhere than a button leads to close the window as toggle the button .... how can i rectify this one .. please help
the calender program also have the same problem ...
please help