Results 1 to 19 of 19

Thread: Calender

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Posts
    12
    Qt products
    Qt3
    Platforms
    Symbian S60

    Default Calender

    Is it possible for me to represent each day in calender in button,so that i can interact with each of the day for particular process..

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Calender

    Yes, its possible.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Apr 2011
    Posts
    12
    Qt products
    Qt3
    Platforms
    Symbian S60

    Default Re: Calender

    Can u please tell me how it can be done...as i have created array of button..that looks like

    1 2 3 4 5 6 7
    8 9 10........
    .......31

    each of these number r shown in button...now hw can i change the position of each button depending upon the month ie if i change my month from april to may
    than the position of the button changes as per calender work..so what logic i hv to use to implement this i want to knw..

    thanks

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Calender

    Here are some thoughts:
    • Create 31 buttons. Create a 7x5 grid layout and move the buttons to the appropriate cells for the month (and hide 29, 30, 31 as required)
    • Create 35 buttons and put them into a 7x5 grid layout. Set the labels and enable disable the correct buttons for the month.

  5. #5
    Join Date
    Apr 2011
    Posts
    12
    Qt products
    Qt3
    Platforms
    Symbian S60

    Default Re: Calender

    would u provide some code regarding this..as i am new in QT..

  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Calender

    If you are new to Qt then it is very important that you know where to find the manual.
    Open Qt Assistant and search for "Layout Examples" and look at the "Basic Layouts Example". Also read the docs for QGridLayout.

    If you are targeting S60 then Qt Quick may also be of interest, but I cannot help at all with that.

  7. #7
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Calender

    would u provide some code regarding this.
    maybe, if you would provide a concrete description of the problem you have?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  8. #8
    Join Date
    Apr 2011
    Posts
    12
    Qt products
    Qt3
    Platforms
    Symbian S60

    Default Re: Calender

    Problem is that instead of representing all day that is 1 to 31 in grid that is given in the calender widget in qtdesigner part..i hv to built my own custom calender where i represent each day ie from 1 to 31 in buttons...so that i can interact with each day as i want..either by onclick or onpress function..so if suitable can u provide me the code for that..

    thanks

  9. #9
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Calender

    so if suitable can u provide me the code for that.
    Sure.
    Do you want a special skin for it as well?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  10. #10
    Join Date
    Apr 2011
    Posts
    12
    Qt products
    Qt3
    Platforms
    Symbian S60

    Default Re: Calender

    yeh..if possible

  11. #11
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Calender

    Sure, I am right on it.
    Should the user be able to use Chinese calendar as well?
    Or you want only the Gregorian?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.