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. srt file
Forum Updated to NodeBB v4.3 + New Features

srt file

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 680 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.
  • J Offline
    J Offline
    jack1998
    wrote on 10 May 2022, 08:54 last edited by
    #1

    how can i create an srt file please , i try to do it but i can't always
    srt-file-example.png

    J 1 Reply Last reply 10 May 2022, 08:58
    0
    • J jack1998
      10 May 2022, 08:54

      how can i create an srt file please , i try to do it but i can't always
      srt-file-example.png

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 10 May 2022, 08:58 last edited by
      #2

      @jack1998 Looks like a simple text file.
      What exactly is the problem?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      J 1 Reply Last reply 10 May 2022, 09:02
      0
      • J jsulm
        10 May 2022, 08:58

        @jack1998 Looks like a simple text file.
        What exactly is the problem?

        J Offline
        J Offline
        jack1998
        wrote on 10 May 2022, 09:02 last edited by
        #3

        @jsulm my file is always between 0 and 60s it means that I have 00;00;60 the next instruction is 00;00;01 and not 00;01;00

        J P 2 Replies Last reply 10 May 2022, 09:07
        0
        • J jack1998
          10 May 2022, 09:02

          @jsulm my file is always between 0 and 60s it means that I have 00;00;60 the next instruction is 00;00;01 and not 00;01;00

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 10 May 2022, 09:07 last edited by
          #4

          @jack1998 Please post your code - how else should anybody know why it does not work?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          J 1 Reply Last reply 10 May 2022, 09:09
          0
          • J jsulm
            10 May 2022, 09:07

            @jack1998 Please post your code - how else should anybody know why it does not work?

            J Offline
            J Offline
            jack1998
            wrote on 10 May 2022, 09:09 last edited by VRonin 5 Oct 2022, 11:43
            #5

            @jsulm

              int    minute = 0;                                       
                int    heure = 0;                                             
                int    seconde = 0;
                QString note = QDateTime::currentDateTime().toString(QString("'%1/fichier_note_'dd-MM-yyyy'.str").arg(dossier));
                QFile filenote(note);
                filenote.open(QIODevice::Append | QIODevice::Append);
                QTextStream commentaire (&filenote);
                for (heure=0;heure<=24;heure++)
                {
                for (seconde =0;seconde<60;seconde++)
                {
                    seconde++;
                    heure=0;
                    minute=0;
                  commentaire<<heure<<":"<<minute<<":"<<seconde<<"\n";
                  if (seconde==59)
                  {
                      minute++;
                      seconde = 0;
                      heure =0;
                      commentaire<<heure<<":"<<minute<<":"<<seconde<<"\n";
                  }
                  if (minute == 59)
                  {
                      heure++;
                      minute=0;
                      seconde =0;
                      commentaire<<heure<<":"<<minute<<":"<<seconde<<"\n";
            
                  }
                }
                }
            
            J 1 Reply Last reply 10 May 2022, 09:28
            0
            • J jack1998
              10 May 2022, 09:09

              @jsulm

                int    minute = 0;                                       
                  int    heure = 0;                                             
                  int    seconde = 0;
                  QString note = QDateTime::currentDateTime().toString(QString("'%1/fichier_note_'dd-MM-yyyy'.str").arg(dossier));
                  QFile filenote(note);
                  filenote.open(QIODevice::Append | QIODevice::Append);
                  QTextStream commentaire (&filenote);
                  for (heure=0;heure<=24;heure++)
                  {
                  for (seconde =0;seconde<60;seconde++)
                  {
                      seconde++;
                      heure=0;
                      minute=0;
                    commentaire<<heure<<":"<<minute<<":"<<seconde<<"\n";
                    if (seconde==59)
                    {
                        minute++;
                        seconde = 0;
                        heure =0;
                        commentaire<<heure<<":"<<minute<<":"<<seconde<<"\n";
                    }
                    if (minute == 59)
                    {
                        heure++;
                        minute=0;
                        seconde =0;
                        commentaire<<heure<<":"<<minute<<":"<<seconde<<"\n";
              
                    }
                  }
                  }
              
              J Offline
              J Offline
              JonB
              wrote on 10 May 2022, 09:28 last edited by JonB 5 Oct 2022, 09:30
              #6

              @jack1998 said in srt file:

              for (heure=0;heure<=24;heure++)
              {
              for (seconde =0;seconde<60;seconde++)
              {
              seconde++;
              heure=0;
              minute=0;

              Please use the Code tag (</> from the toolbar) when posting code.

              This seems to be a loop for every second --- **why?? ** --- which resets heure & minute to 0 --- why?? --- as well as increment seconde which the loop is incrementing too --- why??.

              Fix your basic C++ algorithm for whatever you are trying to achieve. I have no idea what you are trying to achieve/thinking you are achieving.

              1 Reply Last reply
              2
              • J jack1998
                10 May 2022, 09:02

                @jsulm my file is always between 0 and 60s it means that I have 00;00;60 the next instruction is 00;00;01 and not 00;01;00

                P Offline
                P Offline
                Pl45m4
                wrote on 10 May 2022, 09:30 last edited by
                #7

                @jack1998 said in srt file:

                my file is always between 0 and 60s it means that I have 00;00;60 the next instruction is 00;00;01 and not 00;01;00

                There is no 60th second... Seconds go from 0 to 59. The 60th second is 1 minute (01:00)

                Just restart everything after you get to one minute so you start counting from 00:00,000 again


                If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                ~E. W. Dijkstra

                1 Reply Last reply
                2

                3/7

                10 May 2022, 09:02

                • Login

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