Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Saving notes on a particular date in a custom calendar
Forum Updated to NodeBB v4.3 + New Features

Saving notes on a particular date in a custom calendar

Scheduled Pinned Locked Moved General and Desktop
12 Posts 5 Posters 4.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    imrrk
    wrote on last edited by
    #1

    Hello friends,I have developed a custom calendar,and as we all know in a typical calendar,we can save notes on any specific date,so to save that in my calendar application,what storage method should i use?Please let me know what are the different storage methods for saving notes.I think sqlite cant be an efficient option for storing such small data?

    regards
    imrrk

    1 Reply Last reply
    0
    • L Offline
      L Offline
      leon.anavi
      wrote on last edited by
      #2

      Hi,

      You can use database such as "SQLite":http://www.sqlite.org/

      Cheers,
      Leon

      http://anavi.org/

      1 Reply Last reply
      0
      • G Offline
        G Offline
        giesbert
        wrote on last edited by
        #3

        You can use any type of storage,
        text files, xml files, database, html, binary files, ...

        That all depends on your needs and requirements.

        imrrk, I think you are on your calendar app with buttons, and like last time, without specific requirements, it's difficult to answer. Check, what you really need, storing can be done in 1000 ways... and all have advantages / disadvantages

        Nokia Certified Qt Specialist.
        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

        1 Reply Last reply
        0
        • I Offline
          I Offline
          imrrk
          wrote on last edited by
          #4

          Hello gerolf,I am done with my custom calendar and now i want to do one further step,suppose when a user clicks any date a new dialog or window will open and then he is asked to add notes on that particular date,so how shall i do it..how shall i save the data.

          regards
          imrrk

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mr_gui
            wrote on last edited by
            #5

            as gerolf said, there are 1000 ways to store the data. but as you have only 365 days in a year there might be not too much notes in this custom calender. maybe you try xml-files and store them in an user folder. there are a lot xml i/o functions already implemented in qt; they shoul work for your calendar.

            1 Reply Last reply
            0
            • L Offline
              L Offline
              leon.anavi
              wrote on last edited by
              #6

              [quote author="mr_gui" date="1305289531"] but as you have only 365 days in a year there might be not too much notes in this custom calender. maybe you try xml-files and store them in an user folder.[/quote]

              There is whole "XML module in Qt":http://doc.qt.nokia.com/latest/qtxml.html

              If you have let's say 9-10 notes per day that make approximately 3500 notes per year. Let's now assume that the application will be used for three years and more than 10K notes should be stored. I think the most appropriate and yet easy solution is to use SQLite.

              Cheers,
              Leon

              http://anavi.org/

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mr_gui
                wrote on last edited by
                #7

                @leon.avavi: you can store all notes of one day in one xmlfile. and if you have 10k notes with a size of 10kB (which is a lot of calendar text) you end up with 100MB on data in 3 years. imo a database is oversized for such a simple task.

                but as gerolf said, there are 100 ways of storing.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  srikanth_trulyit
                  wrote on last edited by
                  #8

                  1+ for xml way of storing. Also see Qt XML Patterns module, you can write a simple query to find the required note.

                  bq. Hello gerolf,I am done with my custom calendar and now i want to do one further step,suppose when a user clicks any date a new dialog or window will open and then he is asked to add notes on that particular date,so how shall i do it..how shall i save the data. eq

                  Signals and slots of course.

                  1 Reply Last reply
                  0
                  • I Offline
                    I Offline
                    imrrk
                    wrote on last edited by
                    #9

                    hello everyone,many people here gave me advice of using xml module or xml patterns but as i am new to it,i am not able to understand the official doc .so please any one can help me out,
                    actually on click of any date on a calendar,i open a new window which contains a text browser(or any widget to write text in it),now when a user writes some notes on the text browser,how shall it be stored using xml module or xml patterns,please friends give me an idea or a brief overview..

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mr_gui
                      wrote on last edited by
                      #10

                      Maybe something like this:

                      @<?xml version="1.0" encoding="ISO-8859-1"?>
                      <Entries Date="2011-05-16">
                      <Entry ID="1028" Time="11:00:21">Text</Entry>
                      <Entry ID="1029" Time="11:05:21">Text2</Entry>
                      </Entries>
                      <Entries Date="2011-05-18">
                      <Entry ID="1028" Time="10:00:21">Text</Entry>
                      </Entries>@

                      You can then go through the xml data by using qt xml module, for example like this:
                      @
                      QXmlStreamReader xml( data );

                      xml.readNextStartElement (); // step over every start element
                      QXmlStreamAttributes content= xml.attributes(); // returns the attributes
                      // go through the attributes and find what you need
                      QString entry_text = xml.text (); // get the entry text@

                      or just read the xml example in teh doc ("Qt doc exmaples":http://doc.qt.nokia.com/4.7.1/examples-xml.html)

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        srikanth_trulyit
                        wrote on last edited by
                        #11

                        If you need an understanding of how a document model like xml works please see "DOM":http://en.wikipedia.org/wiki/Document_Object_Model.

                        Once you have a basic understanding of XML, please see QXMLStreamWriter class on how to create a xml with your own data. Also you can see "this":http://wiki.forum.nokia.com/index.php/Generate_XML_programatically_in_Qt tutorial on generating xml using Qt.

                        By the way, which official doc you are unable to understand?

                        1 Reply Last reply
                        0
                        • I Offline
                          I Offline
                          imrrk
                          wrote on last edited by
                          #12

                          Hello mr_gui,can u tell whether your method works for a mobile app also..and suppose i write something on a textbrowser in my app of mobile device,how shall i retrieve it..,how shall i save it..i want to know how shall i save the data?

                          regards
                          imrrk

                          1 Reply Last reply
                          0

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved