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. Any idea what this means?
Forum Updated to NodeBB v4.3 + New Features

Any idea what this means?

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 4 Posters 737 Views
  • 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
    jkwok678
    wrote on last edited by
    #1

    :-1: error: An exception was triggered:
    Exception at 0x412bb6, code: 0xc000041d: , flags=0x0.

    I'm not sure where to look for the error.

    RatzzR 1 Reply Last reply
    0
    • J jkwok678

      :-1: error: An exception was triggered:
      Exception at 0x412bb6, code: 0xc000041d: , flags=0x0.

      I'm not sure where to look for the error.

      RatzzR Offline
      RatzzR Offline
      Ratzz
      wrote on last edited by
      #2

      @jkwok678
      You can view using stack trace .

      --Alles ist gut.

      1 Reply Last reply
      4
      • J Offline
        J Offline
        jkwok678
        wrote on last edited by
        #3
        void Canvas::paintEvent(QPaintEvent* event)
        {
            canvasSizeX = width();
            canvasSizeY = height();
            QPainter painter(this);
            //painter.drawImage(0, 704, *straightHImage);
            if (*canvasChosen == Mode::SETTRACKLENGTHSPEED)
            {
                for (std::shared_ptr<StraightTrack> currentElement : drawnLayout->getStraightTrackList())
                {
                    //Get the stored location of track relative to the canvas widget.
                    int currentX = currentElement->getLocationX();
                    int currentY = currentElement->getLocationY();
        

        For some reason this line stops the debugger, but on normal run through without debugger, the program works fine.

        if (*canvasChosen == Mode::SETTRACKLENGTHSPEED)

        stackTrace.png

        I feel like this means it's not me, but any ideas ?

        KroMignonK RatzzR JonBJ 3 Replies Last reply
        0
        • J jkwok678
          void Canvas::paintEvent(QPaintEvent* event)
          {
              canvasSizeX = width();
              canvasSizeY = height();
              QPainter painter(this);
              //painter.drawImage(0, 704, *straightHImage);
              if (*canvasChosen == Mode::SETTRACKLENGTHSPEED)
              {
                  for (std::shared_ptr<StraightTrack> currentElement : drawnLayout->getStraightTrackList())
                  {
                      //Get the stored location of track relative to the canvas widget.
                      int currentX = currentElement->getLocationX();
                      int currentY = currentElement->getLocationY();
          

          For some reason this line stops the debugger, but on normal run through without debugger, the program works fine.

          if (*canvasChosen == Mode::SETTRACKLENGTHSPEED)

          stackTrace.png

          I feel like this means it's not me, but any ideas ?

          KroMignonK Offline
          KroMignonK Offline
          KroMignon
          wrote on last edited by
          #4

          @jkwok678 said in Any idea what this means?:

          if (*canvasChosen == Mode::SETTRACKLENGTHSPEED)

          Are you sure canvasChosen is not a dangling pointer, is it right initialized?

          It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

          1 Reply Last reply
          3
          • J Offline
            J Offline
            jkwok678
            wrote on last edited by
            #5

            I'm fairly sure, because I have another class called window, and it contains the canvas class, and before the first PaintEvent is called using the timer at the last 2 line, drawingSurface->setMode(modeChosen) makes the canvasChosen = to modeChosen.

            drawingSurface = new Canvas;
                drawingSurface->setMode(modeChosen);
            
                windowOffsetX = 0;
                windowOffsetY = 0;
                drawingSurface->setOffsetX(windowOffsetX);
                drawingSurface->setOffsetY(windowOffsetY);
              
                QTimer *timer = new QTimer(this);
                connect(timer, SIGNAL(timeout()), this, SLOT(timerRun()));
            
            KroMignonK 1 Reply Last reply
            0
            • J jkwok678
              void Canvas::paintEvent(QPaintEvent* event)
              {
                  canvasSizeX = width();
                  canvasSizeY = height();
                  QPainter painter(this);
                  //painter.drawImage(0, 704, *straightHImage);
                  if (*canvasChosen == Mode::SETTRACKLENGTHSPEED)
                  {
                      for (std::shared_ptr<StraightTrack> currentElement : drawnLayout->getStraightTrackList())
                      {
                          //Get the stored location of track relative to the canvas widget.
                          int currentX = currentElement->getLocationX();
                          int currentY = currentElement->getLocationY();
              

              For some reason this line stops the debugger, but on normal run through without debugger, the program works fine.

              if (*canvasChosen == Mode::SETTRACKLENGTHSPEED)

              stackTrace.png

              I feel like this means it's not me, but any ideas ?

              RatzzR Offline
              RatzzR Offline
              Ratzz
              wrote on last edited by
              #6

              @jkwok678 said in Any idea what this means?:

              For some reason this line stops the debugger

              Can you tell which is line number 1766 ?

              --Alles ist gut.

              1 Reply Last reply
              0
              • J jkwok678
                void Canvas::paintEvent(QPaintEvent* event)
                {
                    canvasSizeX = width();
                    canvasSizeY = height();
                    QPainter painter(this);
                    //painter.drawImage(0, 704, *straightHImage);
                    if (*canvasChosen == Mode::SETTRACKLENGTHSPEED)
                    {
                        for (std::shared_ptr<StraightTrack> currentElement : drawnLayout->getStraightTrackList())
                        {
                            //Get the stored location of track relative to the canvas widget.
                            int currentX = currentElement->getLocationX();
                            int currentY = currentElement->getLocationY();
                

                For some reason this line stops the debugger, but on normal run through without debugger, the program works fine.

                if (*canvasChosen == Mode::SETTRACKLENGTHSPEED)

                stackTrace.png

                I feel like this means it's not me, but any ideas ?

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by JonB
                #7

                @jkwok678 said in Any idea what this means?:

                For some reason this line stops the debugger, but on normal run through without debugger, the program works fine.

                If this really is the case, put in console print statements between each line, to find where you get to.

                1 Reply Last reply
                0
                • J jkwok678

                  I'm fairly sure, because I have another class called window, and it contains the canvas class, and before the first PaintEvent is called using the timer at the last 2 line, drawingSurface->setMode(modeChosen) makes the canvasChosen = to modeChosen.

                  drawingSurface = new Canvas;
                      drawingSurface->setMode(modeChosen);
                  
                      windowOffsetX = 0;
                      windowOffsetY = 0;
                      drawingSurface->setOffsetX(windowOffsetX);
                      drawingSurface->setOffsetY(windowOffsetY);
                    
                      QTimer *timer = new QTimer(this);
                      connect(timer, SIGNAL(timeout()), this, SLOT(timerRun()));
                  
                  KroMignonK Offline
                  KroMignonK Offline
                  KroMignon
                  wrote on last edited by KroMignon
                  #8

                  @jkwok678 said in Any idea what this means?:

                  I'm fairly sure

                  If the debugger stops the application, you can also check the current value of canvasChosen and verify if it value is correctly set.
                  I suppose that you initialize it to 0 in Canvas constructor?

                  But, by the way, I don't understand why you use a pointer to store an enum value?

                  It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                  1 Reply Last reply
                  2
                  • J Offline
                    J Offline
                    jkwok678
                    wrote on last edited by
                    #9

                    @KroMignon said in Any idea what this means?:

                    pointer

                    Hmm, changing the canvasChosen to not being a pointer seems to fix it.
                    Any idea why though?

                    KroMignonK 1 Reply Last reply
                    0
                    • J jkwok678

                      @KroMignon said in Any idea what this means?:

                      pointer

                      Hmm, changing the canvasChosen to not being a pointer seems to fix it.
                      Any idea why though?

                      KroMignonK Offline
                      KroMignonK Offline
                      KroMignon
                      wrote on last edited by
                      #10

                      @jkwok678 said in Any idea what this means?:

                      Hmm, changing the canvasChosen to not being a pointer seems to fix it.
                      Any idea why though?

                      Because pointer is not right initialized or is pointing to a not valid memory address.

                      It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                      1 Reply Last reply
                      5

                      • Login

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