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
Qt 6.11 is out! See what's new in the release blog

srt file

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 1.1k 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 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

    jsulmJ 1 Reply Last reply
    0
    • J jack1998

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

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on 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
      0
      • jsulmJ jsulm

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

        J Offline
        J Offline
        jack1998
        wrote on 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

        jsulmJ Pl45m4P 2 Replies Last reply
        0
        • J jack1998

          @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

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on 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
          0
          • jsulmJ jsulm

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

            J Offline
            J Offline
            jack1998
            wrote on last edited by VRonin
            #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";
            
                  }
                }
                }
            
            JonBJ 1 Reply Last reply
            0
            • J jack1998

              @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";
              
                    }
                  }
                  }
              
              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by JonB
              #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

                @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

                Pl45m4P Offline
                Pl45m4P Offline
                Pl45m4
                wrote on 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

                • Login

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