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. issue with nested qtabwidget with qvector<qtableview*> on the inner table
Forum Updated to NodeBB v4.3 + New Features

issue with nested qtabwidget with qvector<qtableview*> on the inner table

Scheduled Pinned Locked Moved Solved General and Desktop
12 Posts 4 Posters 964 Views 2 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.
  • S Offline
    S Offline
    swankster
    wrote on last edited by
    #3

    no, in order to get past the QVector[T] "out of range" and crash. I had to add to for loop to addTabs.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #4

      Did you check with the debugger what was happening ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply
      0
      • SGaistS SGaist

        Did you check with the debugger what was happening ?

        S Offline
        S Offline
        swankster
        wrote on last edited by
        #5

        @SGaist when I do not to the addTab i get
        ASSERT failure in QVector<T>::operator[]: "index out of range", file C:/msys64/mingw64/include/QtCore/qvector.h, line 462

        when I do addTab, I cant seem to determine where the segmentation fault occurs. indicating a highlight definition was not found.
        All syntax definitions are up to date.

        Not sure if this tells you anything?

        *running,thread-id="all"

        ~"[Thread 20288.0x4f48 exited with code 3221225725]\n"
        [Thread 20288.0x4f48 exited with code 3221225725]
        =thread-exited,id="2",group-id="i1"
        Thread 2 in group i1 exited.
        ~"[Thread 20288.0x4f44 exited with code 3221225725]\n"
        [Thread 20288.0x4f44 exited with code 3221225725]
        =thread-exited,id="1",group-id="i1"
        Thread 1 in group i1 exited.
        ~"[Thread 20288.0x4f4c exited with code 3221225725]\n"
        [Thread 20288.0x4f4c exited with code 3221225725]
        =thread-exited,id="3",group-id="i1"
        Thread 3 in group i1 exited.
        ~"[Thread 20288.0x4f74 exited with code 3221225725]\n"
        [Thread 20288.0x4f74 exited with code 3221225725]
        =thread-exited,id="4",group-id="i1"
        Thread 4 in group i1 exited.
        ~"[Thread 20288.0x4f78 exited with code 3221225725]\n"
        [Thread 20288.0x4f78 exited with code 3221225725]
        =thread-exited,id="5",group-id="i1"
        Thread 5 in group i1 exited.
        ~"[Thread 20288.0x4f7c exited with code 3221225725]\n"
        [Thread 20288.0x4f7c exited with code 3221225725]
        =thread-exited,id="6",group-id="i1"
        Thread 6 in group i1 exited.
        ~"[Thread 20288.0x4f80 exited with code 3221225725]\n"
        [Thread 20288.0x4f80 exited with code 3221225725]
        =thread-exited,id="7",group-id="i1"
        Thread 7 in group i1 exited.
        ~"[Thread 20288.0x4f88 exited with code 3221225725]\n"
        [Thread 20288.0x4f88 exited with code 3221225725]
        =thread-exited,id="9",group-id="i1"
        Thread 9 in group i1 exited.
        ~"[Thread 20288.0x4f8c exited with code 3221225725]\n"
        [Thread 20288.0x4f8c exited with code 3221225725]
        =thread-exited,id="10",group-id="i1"
        Thread 10 in group i1 exited.
        ~"[Thread 20288.0x4f90 exited with code 3221225725]\n"
        [Thread 20288.0x4f90 exited with code 3221225725]
        =thread-exited,id="11",group-id="i1"
        Thread 11 in group i1 exited.
        ~"[Thread 20288.0x4f94 exited with code 3221225725]\n"
        [Thread 20288.0x4f94 exited with code 3221225725]
        =thread-exited,id="12",group-id="i1"
        Thread 12 in group i1 exited.
        ~"[Thread 20288.0x4f84 exited with code 3221225725]\n"
        [Thread 20288.0x4f84 exited with code 3221225725]
        =thread-exited,id="8",group-id="i1"
        Thread 8 in group i1 exited.
        =thread-exited,id="13",group-id="i1"
        Thread 13 in group i1 exited.
        ~"\nProgram terminated with signal "
        ~"SIGSEGV, Segmentation fault.\n"

        S 1 Reply Last reply
        0
        • Axel SpoerlA Offline
          Axel SpoerlA Offline
          Axel Spoerl
          Moderators
          wrote on last edited by
          #6

          As @SGaist said, can you run this in the debugger and inspect the call stack, when the crash happens?

          Software Engineer
          The Qt Company, Oslo

          S 1 Reply Last reply
          0
          • S swankster

            @SGaist when I do not to the addTab i get
            ASSERT failure in QVector<T>::operator[]: "index out of range", file C:/msys64/mingw64/include/QtCore/qvector.h, line 462

            when I do addTab, I cant seem to determine where the segmentation fault occurs. indicating a highlight definition was not found.
            All syntax definitions are up to date.

            Not sure if this tells you anything?

            *running,thread-id="all"

            ~"[Thread 20288.0x4f48 exited with code 3221225725]\n"
            [Thread 20288.0x4f48 exited with code 3221225725]
            =thread-exited,id="2",group-id="i1"
            Thread 2 in group i1 exited.
            ~"[Thread 20288.0x4f44 exited with code 3221225725]\n"
            [Thread 20288.0x4f44 exited with code 3221225725]
            =thread-exited,id="1",group-id="i1"
            Thread 1 in group i1 exited.
            ~"[Thread 20288.0x4f4c exited with code 3221225725]\n"
            [Thread 20288.0x4f4c exited with code 3221225725]
            =thread-exited,id="3",group-id="i1"
            Thread 3 in group i1 exited.
            ~"[Thread 20288.0x4f74 exited with code 3221225725]\n"
            [Thread 20288.0x4f74 exited with code 3221225725]
            =thread-exited,id="4",group-id="i1"
            Thread 4 in group i1 exited.
            ~"[Thread 20288.0x4f78 exited with code 3221225725]\n"
            [Thread 20288.0x4f78 exited with code 3221225725]
            =thread-exited,id="5",group-id="i1"
            Thread 5 in group i1 exited.
            ~"[Thread 20288.0x4f7c exited with code 3221225725]\n"
            [Thread 20288.0x4f7c exited with code 3221225725]
            =thread-exited,id="6",group-id="i1"
            Thread 6 in group i1 exited.
            ~"[Thread 20288.0x4f80 exited with code 3221225725]\n"
            [Thread 20288.0x4f80 exited with code 3221225725]
            =thread-exited,id="7",group-id="i1"
            Thread 7 in group i1 exited.
            ~"[Thread 20288.0x4f88 exited with code 3221225725]\n"
            [Thread 20288.0x4f88 exited with code 3221225725]
            =thread-exited,id="9",group-id="i1"
            Thread 9 in group i1 exited.
            ~"[Thread 20288.0x4f8c exited with code 3221225725]\n"
            [Thread 20288.0x4f8c exited with code 3221225725]
            =thread-exited,id="10",group-id="i1"
            Thread 10 in group i1 exited.
            ~"[Thread 20288.0x4f90 exited with code 3221225725]\n"
            [Thread 20288.0x4f90 exited with code 3221225725]
            =thread-exited,id="11",group-id="i1"
            Thread 11 in group i1 exited.
            ~"[Thread 20288.0x4f94 exited with code 3221225725]\n"
            [Thread 20288.0x4f94 exited with code 3221225725]
            =thread-exited,id="12",group-id="i1"
            Thread 12 in group i1 exited.
            ~"[Thread 20288.0x4f84 exited with code 3221225725]\n"
            [Thread 20288.0x4f84 exited with code 3221225725]
            =thread-exited,id="8",group-id="i1"
            Thread 8 in group i1 exited.
            =thread-exited,id="13",group-id="i1"
            Thread 13 in group i1 exited.
            ~"\nProgram terminated with signal "
            ~"SIGSEGV, Segmentation fault.\n"

            S Offline
            S Offline
            swankster
            wrote on last edited by
            #7

            @swankster disregard the previous. this was the first segmentation fault picked up.

            --- token barrier ---
            dNOTE: INFERIOR RUN REQUESTED
            Run requested...
            dState changed from InferiorStopOk(11) to InferiorRunRequested(7)
            Running requested...
            <66-exec-continue

            66^running
            dNOTE: INFERIOR RUN OK
            Running.
            dState changed from InferiorRunRequested(7) to InferiorRunOk(8)
            *running,thread-id="all"

            ~"\nThread "
            ~"1 received signal SIGSEGV, Segmentation fault.\n"
            ~"0x00007ffeebdcec7a in ntdll!RtlGetFullPathName_UstrEx () from C:\WINDOWS\SYSTEM32\ntdll.dll\n"
            *stopped,reason="signal-received",signal-name="SIGSEGV",signal-meaning="Segmentation fault",frame={addr="0x00007ffeebdcec7a",func="ntdll!RtlGetFullPathName_UstrEx",args=[],from="C:\WINDOWS\SYSTEM32\ntdll.dll",arch="i386:x86-64"},thread-id="1",stopped-threads="all"
            dNOTE: INFERIOR SPONTANEOUS STOP
            Stopped.
            dState changed from InferiorRunOk(8) to InferiorStopOk(11)
            dHANDLING SIGNAL SIGSEGV
            Stopped: Segmentation fault (Signal SIGSEGV).

            JonBJ 1 Reply Last reply
            0
            • S swankster

              @swankster disregard the previous. this was the first segmentation fault picked up.

              --- token barrier ---
              dNOTE: INFERIOR RUN REQUESTED
              Run requested...
              dState changed from InferiorStopOk(11) to InferiorRunRequested(7)
              Running requested...
              <66-exec-continue

              66^running
              dNOTE: INFERIOR RUN OK
              Running.
              dState changed from InferiorRunRequested(7) to InferiorRunOk(8)
              *running,thread-id="all"

              ~"\nThread "
              ~"1 received signal SIGSEGV, Segmentation fault.\n"
              ~"0x00007ffeebdcec7a in ntdll!RtlGetFullPathName_UstrEx () from C:\WINDOWS\SYSTEM32\ntdll.dll\n"
              *stopped,reason="signal-received",signal-name="SIGSEGV",signal-meaning="Segmentation fault",frame={addr="0x00007ffeebdcec7a",func="ntdll!RtlGetFullPathName_UstrEx",args=[],from="C:\WINDOWS\SYSTEM32\ntdll.dll",arch="i386:x86-64"},thread-id="1",stopped-threads="all"
              dNOTE: INFERIOR SPONTANEOUS STOP
              Stopped.
              dState changed from InferiorRunOk(8) to InferiorStopOk(11)
              dHANDLING SIGNAL SIGSEGV
              Stopped: Segmentation fault (Signal SIGSEGV).

              JonBJ Online
              JonBJ Online
              JonB
              wrote on last edited by
              #8

              @swankster
              As @SGaist & @Axel-Spoerl have said, you need to run your program inside a debugger and show the stack trace when it crashes.

              1 Reply Last reply
              1
              • Axel SpoerlA Axel Spoerl

                As @SGaist said, can you run this in the debugger and inspect the call stack, when the crash happens?

                S Offline
                S Offline
                swankster
                wrote on last edited by
                #9

                @Axel-Spoerl
                this is the call stack when I do not addTab which is how it should be working. from my understanding.

                1 RaiseFailFastException 0x7fff2a87b2dc
                2 qt_message_fatal qlogging.cpp 1905 0x7fff00f93051
                3 QMessageLogger::fatal qlogging.cpp 893 0x7fff012a9038
                4 qt_assert_x qglobal.cpp 3366 0x7fff012a8c17
                5 QVector<QTableView *>::operator[] qvector.h 462 0x7ff6189f5048
                6 MainWindow::on_systemLogHeaderSectionResized mainwindow.cpp 1686 0x7ff6189d9166
                7 QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<int, int, int>, void, void (MainWindow:: *)(int, int, int)>::call qobjectdefs_impl.h 152 0x7ff6189f5623
                8 QtPrivate::FunctionPointer<void (MainWindow:: *)(int, int, int)>::call<QtPrivate::List<int, int, int>, void> qobjectdefs_impl.h 185 0x7ff6189f5d2f
                9 QtPrivate::QSlotObject<void (MainWindow:: *)(int, int, int), QtPrivate::List<int, int, int>, void>::impl qobjectdefs_impl.h 418 0x7ff6189f5988
                10 QtPrivate::QSlotObjectBase::call qobjectdefs_impl.h 398 0x7fff0124f1cc
                11 doActivate<false> qobject.cpp 3886 0x7fff0124f1cc
                12 QMetaObject::activate qobject.cpp 3946 0x7fff01195d47
                13 QHeaderView::sectionResized moc_qheaderview.cpp 455 0x7ffeffc3ade0
                14 QHeaderViewPrivate::resizeSections qheaderview.cpp 3600 0x7ffeffc3ade0
                15 QHeaderView::viewportEvent qheaderview.cpp 2816 0x7ffeffc422c2
                16 QCoreApplicationPrivate::sendThroughObjectEventFilters qcoreapplication.cpp 1189 0x7fff01163bdc
                17 QCoreApplicationPrivate::sendThroughObjectEventFilters qcoreapplication.cpp 1194 0x7fff01164819
                18 QApplicationPrivate::notify_helper qapplication.cpp 3626 0x7ffeff9d7fc2
                19 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1063 0x7fff011651e0
                20 QCoreApplication::sendEvent qcoreapplication.cpp 1458 0x7fff011651e0
                ... <More>

                JonBJ S 2 Replies Last reply
                0
                • S swankster

                  @Axel-Spoerl
                  this is the call stack when I do not addTab which is how it should be working. from my understanding.

                  1 RaiseFailFastException 0x7fff2a87b2dc
                  2 qt_message_fatal qlogging.cpp 1905 0x7fff00f93051
                  3 QMessageLogger::fatal qlogging.cpp 893 0x7fff012a9038
                  4 qt_assert_x qglobal.cpp 3366 0x7fff012a8c17
                  5 QVector<QTableView *>::operator[] qvector.h 462 0x7ff6189f5048
                  6 MainWindow::on_systemLogHeaderSectionResized mainwindow.cpp 1686 0x7ff6189d9166
                  7 QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<int, int, int>, void, void (MainWindow:: *)(int, int, int)>::call qobjectdefs_impl.h 152 0x7ff6189f5623
                  8 QtPrivate::FunctionPointer<void (MainWindow:: *)(int, int, int)>::call<QtPrivate::List<int, int, int>, void> qobjectdefs_impl.h 185 0x7ff6189f5d2f
                  9 QtPrivate::QSlotObject<void (MainWindow:: *)(int, int, int), QtPrivate::List<int, int, int>, void>::impl qobjectdefs_impl.h 418 0x7ff6189f5988
                  10 QtPrivate::QSlotObjectBase::call qobjectdefs_impl.h 398 0x7fff0124f1cc
                  11 doActivate<false> qobject.cpp 3886 0x7fff0124f1cc
                  12 QMetaObject::activate qobject.cpp 3946 0x7fff01195d47
                  13 QHeaderView::sectionResized moc_qheaderview.cpp 455 0x7ffeffc3ade0
                  14 QHeaderViewPrivate::resizeSections qheaderview.cpp 3600 0x7ffeffc3ade0
                  15 QHeaderView::viewportEvent qheaderview.cpp 2816 0x7ffeffc422c2
                  16 QCoreApplicationPrivate::sendThroughObjectEventFilters qcoreapplication.cpp 1189 0x7fff01163bdc
                  17 QCoreApplicationPrivate::sendThroughObjectEventFilters qcoreapplication.cpp 1194 0x7fff01164819
                  18 QApplicationPrivate::notify_helper qapplication.cpp 3626 0x7ffeff9d7fc2
                  19 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1063 0x7fff011651e0
                  20 QCoreApplication::sendEvent qcoreapplication.cpp 1458 0x7fff011651e0
                  ... <More>

                  JonBJ Online
                  JonBJ Online
                  JonB
                  wrote on last edited by JonB
                  #10

                  @swankster said in issue with nested qtabwidget with qvector<qtableview*> on the inner table:

                  5 QVector<QTableView *>::operator[] qvector.h 462 0x7ff6189f5048

                  This, and your earlier

                  ASSERT failure in QVector<T>::operator[]: "index out of range", file C:/msys64/mingw64/include/QtCore/qvector.h, line 462

                  would suggest to me the QVector<QTableView *> you talk about is not of the size expected at some point. @Axel-Spoerl or @SGaist might be able to guess something, for my part I would want to see a minimal reproducible example of your full code to get further.

                  Have you tried removing all the model data, proxies, SQL code to start with, why should that be relevant to your switching of tabs holding tableviews, whatever the issue proves to be? If it's a UI issue the backed data should not matter. Though it's interesting the stack shows it's failing during a QHeaderView resize. MainWindow::on_systemLogHeaderSectionResized() is yours, and is accessing the QVector<QTableView *> out of range? Show what you are indexing it by and what its current size is?

                  A complete minimal example might be less than 100 lines of code.

                  1 Reply Last reply
                  0
                  • S swankster

                    @Axel-Spoerl
                    this is the call stack when I do not addTab which is how it should be working. from my understanding.

                    1 RaiseFailFastException 0x7fff2a87b2dc
                    2 qt_message_fatal qlogging.cpp 1905 0x7fff00f93051
                    3 QMessageLogger::fatal qlogging.cpp 893 0x7fff012a9038
                    4 qt_assert_x qglobal.cpp 3366 0x7fff012a8c17
                    5 QVector<QTableView *>::operator[] qvector.h 462 0x7ff6189f5048
                    6 MainWindow::on_systemLogHeaderSectionResized mainwindow.cpp 1686 0x7ff6189d9166
                    7 QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<int, int, int>, void, void (MainWindow:: *)(int, int, int)>::call qobjectdefs_impl.h 152 0x7ff6189f5623
                    8 QtPrivate::FunctionPointer<void (MainWindow:: *)(int, int, int)>::call<QtPrivate::List<int, int, int>, void> qobjectdefs_impl.h 185 0x7ff6189f5d2f
                    9 QtPrivate::QSlotObject<void (MainWindow:: *)(int, int, int), QtPrivate::List<int, int, int>, void>::impl qobjectdefs_impl.h 418 0x7ff6189f5988
                    10 QtPrivate::QSlotObjectBase::call qobjectdefs_impl.h 398 0x7fff0124f1cc
                    11 doActivate<false> qobject.cpp 3886 0x7fff0124f1cc
                    12 QMetaObject::activate qobject.cpp 3946 0x7fff01195d47
                    13 QHeaderView::sectionResized moc_qheaderview.cpp 455 0x7ffeffc3ade0
                    14 QHeaderViewPrivate::resizeSections qheaderview.cpp 3600 0x7ffeffc3ade0
                    15 QHeaderView::viewportEvent qheaderview.cpp 2816 0x7ffeffc422c2
                    16 QCoreApplicationPrivate::sendThroughObjectEventFilters qcoreapplication.cpp 1189 0x7fff01163bdc
                    17 QCoreApplicationPrivate::sendThroughObjectEventFilters qcoreapplication.cpp 1194 0x7fff01164819
                    18 QApplicationPrivate::notify_helper qapplication.cpp 3626 0x7ffeff9d7fc2
                    19 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1063 0x7fff011651e0
                    20 QCoreApplication::sendEvent qcoreapplication.cpp 1458 0x7fff011651e0
                    ... <More>

                    S Offline
                    S Offline
                    swankster
                    wrote on last edited by
                    #11

                    @swankster Thank you guys, tracking it through stack view. i found the issue. Tab position starts at 0. i was missing a -1 in a reference position.
                    thanks again for the direction

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #12

                      Great !
                      Since you have it working now please mark the thread as solved using the "Topic Tools" button or the three dotted button beside the answer you deem correct so that other forum members may know a solution has been found :-)

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • S swankster has marked this topic as solved on

                      • Login

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