How to Develop a Calendar Widget.
-
I just recently create a minimal calendar in QtQuick in Javascript. It is unfinished, but shows dates correctly;)
-
hi gerolf,I got about the application you are speaking about,,is it applicable to mobile phones..also
-
[quote author="imrrk" date="1302167524"]hi gerolf,I got about the application you are speaking about,,is it applicable to mobile phones..also
[/quote]
Try and see? -
Thanks andre...
-
hello friends,still i dint get any concrete material so that i can develop a calendar for mobile..actually i want to use pushbuttons,for dates i.e very date is on pushbutton..so that i can click this button and i can add some notes for that button...but with the inbuilt widget its not possible i guess,because they have used QTableformat class and divided it into rows and columns..so friends please help me out..
regards
imrrk -
If you have no existing code that works for you, start build it on your own. I have never seen a calendar build on buttons.
We can give you ideas, suggestions for specific technical stuff. But we don't write your code. If you want it with buttons, sit down, take QtCreator and start coding.
-
but gerolf i just need the correct direction,have u seen the calendar of nokia phones..it has that feature...
-
First: why do you think you need buttons? You can of course implement a calendar based on grid of buttons. I am just wondering how that would help you achieve your goals?
-
That you click on a button?
Or that you click on a date and something happens?You can use a model/view (like Qt calendar widget) and react on the mouse events. No buttons needed. Qt has no build in "button calendar". and if you need one, build it. Or try if you can get the code for the nokia phone calendar.
-
hello gerolf,as u said,I need something should happen when i click on date..please guide me..
-
QCalendarWidget provides that already. See the signals listed in the documentation for that class.
-
[quote author="imrrk" date="1302259716"]hello gerolf,as u said,I need something should happen when i click on date..please guide me..[/quote]
If you derive from, a view and can handle mouse events, clicks should be easy... (they are mouse events). Read a bit of Qt documentation on events (QWidget etc.) and views.
Or look at QCalendarWidget and its interface. Perhaps derive from that.
-
ok thanks gerolf,hey i have created a two dimensional array of buttons,i.e 6 rows and 7 col,and by taking a counter i have my dates on pushbutttons,now the remaining work is to change the values on these buttons as the month and year changes..so any suggestions...
thanks
imrrk -
Yes. As others have said many times already, take a look at how other calendar widgets are implemented. There is one right in Qt already. Use your favourite text editor/IDE/pager to look at the source code for QCalendarWidget and see how they solved the problem.
We are not here to write your code or do research for you. We are just a bunch of volunteers. We can help you out with specific technical problems but you have not shown what approaches you have tried to solve this problem yourself first.
-
hi zapB,I have reffered to inbuilt example only and tried to do it in designer instead of hardcoding and wasting time,so what i have done has been mentioned already above,,,
-
hi gerolf,i am reading as per ur instructions,I have one doubt,we know that we have default calendar widget in qt designer which we can drag and drop on the form,whether your suggestion applies to this inbuit widget too..
-
I was referring to how the dates and days of week are calculated not on how to do the actual drawing overall.
-
i have reffered and know the logic,just want to do it in different way,hey can u tell me the default qcalendar widget in deesigner can be used in a efficient way..
-
What do you mean by "efficient way"? Just drop it on your form and hook up to it's signals. I am not clear exactly what you are trying to achieve. Do you have a graphic mockup of what you are after and a list of features?
-
Hi imrrk,
as already told many times, and now last time:
make a derived class for what you described. Make a
@
class MyCalendarWidget : public QCalendarWidget
@there change the mouse handling, change the drawing and you have what you need.
Then build up your UI on top of that.