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. Looks like the SIGNAL loadFinished(bool) is not emitted anymore with Qt 6.8.1
Forum Updated to NodeBB v4.3 + New Features

Looks like the SIGNAL loadFinished(bool) is not emitted anymore with Qt 6.8.1

Scheduled Pinned Locked Moved Solved General and Desktop
67 Posts 5 Posters 6.6k 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.
  • C ChrisW67

    Here are some things to try in your code:

    TimetablePrintForm::TimetablePrintForm(QWidget *parent): QDialog(parent){
    	QVBoxLayout *layout = new QVBoxLayout(this);
        QWebEngineView *view = new QWebEngineView(this);
    qDebug() << "As constructed" << view;
    
        connect(view, &QWebEngineView::loadFinished, this, &TimetablePrintForm::loadFinished);
        layout->addWidget(view);
    
        QTimer::singleShot(0,
                           [=](){
    qDebug() << "In lambda 1" << view;
                                                          view->setHtml("<html><head><title>Initial page</title></head><body><p>Initial content</p></body></html>");
                           } );
    
        QTimer::singleShot(3000,
                           [=](){
    qDebug() << "In lambda 2" << view;
                                                          view->setHtml("<html><head><title>Three seconds page</title></head><body><p>New content</p></body></html>");
                           } );
    

    Do the three qDebugs print the same value?
    What is the value of view in the slot TimetablePrintForm::loadFinished?

    Replace QWebEngineView with a basic instrumented subclass (something like):

    class MyWebEngineView: public QWebEngineView {
      Q_OBJECT
    public:
      explicit MyWebEngineView(QWidget *parent = nullptr) : QWebEngineView(parent) {
        qDebug() << "Constructing MyWebEngineView" << this;
      }
      ~MyWebEngineView() {
        qDebug() << "Destructing MyWebEngineView" << this;
      }
    };
    

    Do you see constructions/destructions you were not expecting?
    Matching pairs?

    When it crashes in your debugger, what is the complete backtrace?

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

    @ChrisW67 said in Looks like the SIGNAL loadFinished(bool) is not emitted anymore with Qt 6.8.1:

    ~MyWebEngineView() {
      qDebug() << "Destructing MyWebEngineView" << this;
    }
    

    I don't mean to detract from the diagnosis attempt, but I think it is actually causing its own problem/seg fault?

    If you scroll through to the last backtrace we have been given in https://forum.qt.io/post/818795 we come across:

    Thread 1 "Test" received signal SIGSEGV, Segmentation fault.
    0x0000555556c0ace0 in ?? ()
    (gdb) bt
    #0  0x0000555556c0ace0 in ?? ()
    #1  0x00007ffff77da635 in operator<<(QDebug, QWidget const*) () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Widgets.so.6
    #2  0x0000555555ae065f in operator() (__closure=0x555556ab0a20) at src/timetableprintform.cpp:52
    

    This looks to me like the this in the destructor code qDebug() << "Destructing MyWebEngineView" << this; is a QWidget const* and it is actually dying/segging on trying to fetch whatever from this is wanted for qDebug()? So although you can access this in a destructor I wonder what state the QWidget is in for qDebug() at this point?

    @Volker75
    You might want to change that line to just qDebug() << "Destructing MyWebEngineView"; (so no this) and see if that changes the backtrace to where whatever you real problem is.

    1 Reply Last reply
    0
    • V Offline
      V Offline
      Volker75
      wrote on last edited by Volker75
      #45

      About the "Replace QWebEngineView with a basic instrumented subclass".
      I think now unneeded for your code, since it was sadly my bug and I understand that problem now.
      But that trick might help to locate the bug in my source.
      I am sadly not clever enough to compile, since the linker complains:

      timetableprintform.cpp:(.text._ZN15MyWebEngineViewC2EP7QWidget[_ZN15MyWebEngineViewC5EP7QWidget]+0x2e): undefined reference to `vtable for MyWebEngineView'
      

      But that is of course only because my skill level is too low to do that trick. Maybe you can give me a hint? (I added the "class MyWebEngineView" source and only replaced "QWebEngineView" by "MyWebEngineView".)

      1 Reply Last reply
      0
      • V Offline
        V Offline
        Volker75
        wrote on last edited by Volker75
        #46

        With my code, that is working fine with Qt 6.7.2, I can see that Qt 6.8.1 closes the printdialog as soon as I call setHtmlPreview:

        15
        setEnabled Preview
        setHtml Preview
        15
        ~TimetablePrintForm
        15
        

        hmm... Why does it deconstruct the printdialog. There is no reason for this. In Qt 6.7.2 it waits for user input (Since the user might print other tables. They must press pushbutton "close" or "X" the window to quit. So it quits automatically now before displaying the preview)

        1 Reply Last reply
        0
        • V Offline
          V Offline
          Volker75
          wrote on last edited by Volker75
          #47

          Thank you.
          @JonB : I am sadly not clever enough. Source looks like this now:

          //
          
          #include <QtGlobal>
          #include <QtWidgets>
          
          //#ifdef Q_OS_WIN
          //nothing. Maybe the stuff from QPrintDialog?!
          //#else
          #include <QWebEngineView>
          
          //#endif
          
          #include "timetableprintform.h"
          
          
          #include <QString>
          #include <QStringList>
          #include <QSet>
          #include <QList>
          #include <QtSql>
          
          
          
          #include <QVBoxLayout>
          #include <QDebug>
          #include <QTimer>
          
          #ifdef QT_NO_PRINTER
          static QMap<QString, int> paperSizesMap;
          #else
          static QMap<QString, QPageSize> paperSizesMap;
          #endif
          
          // this is very similar to statisticsexport.cpp. so please also check there if you change something here!
          
          class MyWebEngineView: public QWebEngineView {
            Q_OBJECT
          public:
            explicit MyWebEngineView(QWidget *parent = nullptr) : QWebEngineView(parent) {
              qDebug() << "Constructing MyWebEngineView";
            }
            ~MyWebEngineView() {
              qDebug() << "Destructing MyWebEngineView";
            }
          };
          
          
          TimetablePrintForm::TimetablePrintForm(QWidget *parent): QDialog(parent){
          	QVBoxLayout *layout = new QVBoxLayout(this);
              MyWebEngineView *view = new MyWebEngineView(this);
          qDebug() << "As constructed" << view;
          
              connect(view, &MyWebEngineView::loadFinished, this, &TimetablePrintForm::loadFinished);
              layout->addWidget(view);
          
              QTimer::singleShot(0,
                                 [=](){
          qDebug() << "In lambda 1" << view;
                                                                view->setHtml("<html><head><title>Initial page</title></head><body><p>Initial content</p></body></html>");
                                 } );
          
              QTimer::singleShot(3000,
                                 [=](){
          qDebug() << "In lambda 2" << view;
                                                                view->setHtml("<html><head><title>Three seconds page</title></head><body><p>New content</p></body></html>");
                                 } );
          
          
          }
          
          TimetablePrintForm::~TimetablePrintForm() {
          	qDebug("~TimetablePrintForm");
          
          }
          
          void TimetablePrintForm::loadFinished(bool ok)
          {
              qDebug()  << Q_FUNC_INFO << ok;
          	qDebug("loadDinished");
          }
          
          //#endif
          
          

          But i can't compile, since the linker tells me:

          timetableprintform.cpp:(.text+0x557): undefined reference to `vtable for MyWebEngineView'
          collect2: error: ld returned 1 exit status
          
          JonBJ 1 Reply Last reply
          0
          • V Volker75

            Thank you.
            @JonB : I am sadly not clever enough. Source looks like this now:

            //
            
            #include <QtGlobal>
            #include <QtWidgets>
            
            //#ifdef Q_OS_WIN
            //nothing. Maybe the stuff from QPrintDialog?!
            //#else
            #include <QWebEngineView>
            
            //#endif
            
            #include "timetableprintform.h"
            
            
            #include <QString>
            #include <QStringList>
            #include <QSet>
            #include <QList>
            #include <QtSql>
            
            
            
            #include <QVBoxLayout>
            #include <QDebug>
            #include <QTimer>
            
            #ifdef QT_NO_PRINTER
            static QMap<QString, int> paperSizesMap;
            #else
            static QMap<QString, QPageSize> paperSizesMap;
            #endif
            
            // this is very similar to statisticsexport.cpp. so please also check there if you change something here!
            
            class MyWebEngineView: public QWebEngineView {
              Q_OBJECT
            public:
              explicit MyWebEngineView(QWidget *parent = nullptr) : QWebEngineView(parent) {
                qDebug() << "Constructing MyWebEngineView";
              }
              ~MyWebEngineView() {
                qDebug() << "Destructing MyWebEngineView";
              }
            };
            
            
            TimetablePrintForm::TimetablePrintForm(QWidget *parent): QDialog(parent){
            	QVBoxLayout *layout = new QVBoxLayout(this);
                MyWebEngineView *view = new MyWebEngineView(this);
            qDebug() << "As constructed" << view;
            
                connect(view, &MyWebEngineView::loadFinished, this, &TimetablePrintForm::loadFinished);
                layout->addWidget(view);
            
                QTimer::singleShot(0,
                                   [=](){
            qDebug() << "In lambda 1" << view;
                                                                  view->setHtml("<html><head><title>Initial page</title></head><body><p>Initial content</p></body></html>");
                                   } );
            
                QTimer::singleShot(3000,
                                   [=](){
            qDebug() << "In lambda 2" << view;
                                                                  view->setHtml("<html><head><title>Three seconds page</title></head><body><p>New content</p></body></html>");
                                   } );
            
            
            }
            
            TimetablePrintForm::~TimetablePrintForm() {
            	qDebug("~TimetablePrintForm");
            
            }
            
            void TimetablePrintForm::loadFinished(bool ok)
            {
                qDebug()  << Q_FUNC_INFO << ok;
            	qDebug("loadDinished");
            }
            
            //#endif
            
            

            But i can't compile, since the linker tells me:

            timetableprintform.cpp:(.text+0x557): undefined reference to `vtable for MyWebEngineView'
            collect2: error: ld returned 1 exit status
            
            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by JonB
            #48

            @Volker75
            I believe this is because you have put the class definition with Q_OBJECT directly into a .cpp file. Then moc does not get run on it. You be best/simplest moving the whole class MyWebEngineView definition to its own .h file, including that, and doing a clean rebuild.

            Actually, I don't see why what you have requires Q_OBJECT. Try commenting that line and (important) do a really clean rebuild?

            But then connect(view, &MyWebEngineView::loadFinished probably won't work.... Don't know then whether &QWebEngineView::loadFinished would work here. You may have to do first paragraph above, move to .h file.

            You might wait for @ChrisW67 to get back if he has anything to say, I don't know what effort this is worth for whatever it is trying to prove.

            C 1 Reply Last reply
            1
            • V Offline
              V Offline
              Volker75
              wrote on last edited by
              #49

              Thank you for teaching me so much!
              I done it's own .h file. I deleted the whole tmp folder. Clean rebuild.
              I got still linker warning undefined reference to `vtable for MyWebEngineView'.
              I removed Q_OBJECT.
              Then I was able to compile.
              I tried once and it crashed again.
              I added debug <<this.
              I tried once again and it looked similar as before (just with "this" information):

              15
              Constructing MyWebEngineView QWebEngineView(0x63d7c1694fe0)
              As constructed QWebEngineView(0x63d7c1694fe0)
              In lambda 1 QWebEngineView(0x63d7c1694fe0)
              15
              ~TimetablePrintForm
              Destructing MyWebEngineView QWebEngineView(0x63d7c1694fe0)
              Speicherzugriffsfehler (Speicherabzug geschrieben)
              

              gdb tells me:

              ...                                                                                                                                                                          
              [New Thread 0x7fffbbe006c0 (LWP 6774)]
              [New Thread 0x7fffbb4006c0 (LWP 6775)]
              [New Thread 0x7fffbaa006c0 (LWP 6776)]
              [Thread 0x7fffbaa006c0 (LWP 6776) exited]
              [Thread 0x7fffbb4006c0 (LWP 6775) exited]
              [Thread 0x7fffbbe006c0 (LWP 6774) exited]
              [New Thread 0x7fffbbe006c0 (LWP 6777)]
              [New Thread 0x7fffbb4006c0 (LWP 6778)]
              [New Thread 0x7fffbaa006c0 (LWP 6779)]
              [Thread 0x7fffbaa006c0 (LWP 6779) exited]
              [Thread 0x7fffbb4006c0 (LWP 6778) exited]
              [Thread 0x7fffbbe006c0 (LWP 6777) exited]
              [New Thread 0x7fffbbe006c0 (LWP 6780)]
              [Detaching after fork from child process 6781]
              [Detaching after fork from child process 6782]
              [Detaching after fork from child process 6783]
              [New Thread 0x7fffbb4006c0 (LWP 6784)]
              [New Thread 0x7fffbaa006c0 (LWP 6785)]
              [New Thread 0x7fffb8a006c0 (LWP 6786)]
              [New Thread 0x7fffafe006c0 (LWP 6787)]
              [New Thread 0x7fffaf4006c0 (LWP 6788)]
              [New Thread 0x7fffaea006c0 (LWP 6789)]
              [New Thread 0x7fffae0006c0 (LWP 6790)]
              [New Thread 0x7fffad6006c0 (LWP 6791)]
              [New Thread 0x7fffacc006c0 (LWP 6792)]
              [New Thread 0x7fffa3e006c0 (LWP 6793)]
              [New Thread 0x7fffa2a006c0 (LWP 6795)]
              [New Thread 0x7fffa34006c0 (LWP 6794)]
              [New Thread 0x7fffa20006c0 (LWP 6796)]
              [New Thread 0x7fffa0c006c0 (LWP 6798)]
              [New Thread 0x7fffa16006c0 (LWP 6797)]
              [New Thread 0x7fff97e006c0 (LWP 6799)]
              [New Thread 0x7fff974006c0 (LWP 6800)]
              [New Thread 0x7fff96a006c0 (LWP 6801)]
              [New Thread 0x7fff960006c0 (LWP 6802)]
              [New Thread 0x7fff956006c0 (LWP 6803)]
              [New Thread 0x7fff94c006c0 (LWP 6804)]
              [New Thread 0x7fff8be006c0 (LWP 6805)]
              [Thread 0x7fff8be006c0 (LWP 6805) exited]
              [Thread 0x7fff94c006c0 (LWP 6804) exited]
              [Thread 0x7fff956006c0 (LWP 6803) exited]
              [New Thread 0x7fff956006c0 (LWP 6806)]
              [New Thread 0x7fff94c006c0 (LWP 6807)]
              [New Thread 0x7fff8be006c0 (LWP 6808)]
              [Thread 0x7fff8be006c0 (LWP 6808) exited]
              [Thread 0x7fff94c006c0 (LWP 6807) exited]
              [Thread 0x7fff956006c0 (LWP 6806) exited]
              [New Thread 0x7fff956006c0 (LWP 6809)]
              [New Thread 0x7fff94c006c0 (LWP 6810)]
              [New Thread 0x7fff8be006c0 (LWP 6811)]
              15
              [New Thread 0x7fff8b4006c0 (LWP 6824)]
              [New Thread 0x7fff8a6006c0 (LWP 6825)]
              [New Thread 0x7fff89c006c0 (LWP 6826)]
              [New Thread 0x7fff892006c0 (LWP 6827)]
              [New Thread 0x7fff7fe006c0 (LWP 6828)]
              [New Thread 0x7fff7f4006c0 (LWP 6829)]
              [New Thread 0x7fff7ea006c0 (LWP 6830)]
              Constructing MyWebEngineView QWebEngineView(0x5555569dd090)
              As constructed QWebEngineView(0x5555569dd090)
              In lambda 1 QWebEngineView(0x5555569dd090)
              [New Thread 0x7fff7e0006c0 (LWP 6835)]
              [New Thread 0x7fff7d6006c0 (LWP 6836)]
              [New Thread 0x7fff7cc006c0 (LWP 6838)]
              [New Thread 0x7fff73e006c0 (LWP 6839)]
              [New Thread 0x7fff734006c0 (LWP 6840)]
              [Thread 0x7fff734006c0 (LWP 6840) exited]
              [Thread 0x7fff73e006c0 (LWP 6839) exited]
              [Thread 0x7fff7cc006c0 (LWP 6838) exited]
              [New Thread 0x7fff7cc006c0 (LWP 6841)]
              [New Thread 0x7fff73e006c0 (LWP 6842)]
              [New Thread 0x7fff734006c0 (LWP 6843)]
              [New Thread 0x7fff72a006c0 (LWP 6849)]
              [New Thread 0x7fff720006c0 (LWP 6850)]
              [New Thread 0x7fff716006c0 (LWP 6851)]
              [Thread 0x7fff716006c0 (LWP 6851) exited]
              [Thread 0x7fff720006c0 (LWP 6850) exited]
              [Thread 0x7fff72a006c0 (LWP 6849) exited]
              15
              ~TimetablePrintForm
              Destructing MyWebEngineView QWebEngineView(0x5555569dd090)
              [Thread 0x7fff734006c0 (LWP 6843) exited]
              [Thread 0x7fff73e006c0 (LWP 6842) exited]
              [Thread 0x7fff7cc006c0 (LWP 6841) exited]
              
              Thread 1 "Test" received signal SIGSEGV, Segmentation fault.
              0x00005555566db440 in ?? ()
              (gdb) bt
              #0  0x00005555566db440 in ?? ()
              #1  0x00007ffff77da635 in operator<<(QDebug, QWidget const*) () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Widgets.so.6
              #2  0x0000555555ae06a1 in operator() (__closure=0x5555568004d0) at src/timetableprintform.cpp:45
              #3  0x0000555555ae114d in operator() (__closure=0x7fffffffc120) at ../../../Qt6.8/6.8.1/gcc_64/include/QtCore/qobjectdefs_impl.h:141
              #4  0x0000555555ae11f4 in QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, TimetablePrintForm::TimetablePrintForm(QWidget*)::<lambda()> >::call(TimetablePrintForm::TimetablePrintForm(QWidget*)::<lambda()>&, void**)::<lambda()> >(void **, struct {...} &&) (args=0x7fffffffc258, fn=...)
                  at ../../../Qt6.8/6.8.1/gcc_64/include/QtCore/qobjectdefs_impl.h:65
              #5  0x0000555555ae1192 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, TimetablePrintForm::TimetablePrintForm(QWidget*)::<lambda()> >::call(struct {...} &, void **) (f=..., arg=0x7fffffffc258) at ../../../Qt6.8/6.8.1/gcc_64/include/QtCore/qobjectdefs_impl.h:140
              #6  0x0000555555ae10b7 in QtPrivate::FunctorCallable<TimetablePrintForm::TimetablePrintForm(QWidget*)::<lambda()> >::call<QtPrivate::List<>, void>(struct {...} &, void *, void **) (f=..., 
                  arg=0x7fffffffc258) at ../../../Qt6.8/6.8.1/gcc_64/include/QtCore/qobjectdefs_impl.h:362
              #7  0x0000555555ae1036 in QtPrivate::QCallableObject<TimetablePrintForm::TimetablePrintForm(QWidget*)::<lambda()>, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=1, this_=0x5555568004c0, r=0x5555568004e0, a=0x7fffffffc258, ret=0x0) at ../../../Qt6.8/6.8.1/gcc_64/include/QtCore/qobjectdefs_impl.h:572
              #8  0x00007ffff5fde038 in ?? () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Core.so.6
              #9  0x00007ffff5feb33e in ?? () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Core.so.6
              #10 0x00007ffff5fd1e75 in QObject::event(QEvent*) () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Core.so.6
              #11 0x00007ffff77903f6 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Widgets.so.6
              #12 0x00007ffff5f7bcaa in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Core.so.6
              #13 0x00007ffff6129b4a in QTimerInfoList::activateTimers() () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Core.so.6
              #14 0x00007ffff625570c in ?? () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Core.so.6
              #15 0x00007fffe95145b5 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
              --Type <RET> for more, q to quit, c to continue without paging--
              #16 0x00007fffe9573717 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
              #17 0x00007fffe9513a53 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
              #18 0x00007ffff625591e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Core.so.6
              #19 0x00007ffff5f88fe2 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Core.so.6
              #20 0x00007ffff5f85166 in QCoreApplication::exec() () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Core.so.6
              #21 0x00005555555a7625 in main (argc=1, argv=0x7fffffffd938) at src/main.cpp:677
              
              

              timetableprintform.cpp:45

              qDebug() << "In lambda 2" << view;
              

              I will go to sleep in ~30 minutes minutes. I will check the forum again after work. I can code in spare time only.
              Thank you so much!

              JonBJ 1 Reply Last reply
              0
              • V Volker75

                Thank you for teaching me so much!
                I done it's own .h file. I deleted the whole tmp folder. Clean rebuild.
                I got still linker warning undefined reference to `vtable for MyWebEngineView'.
                I removed Q_OBJECT.
                Then I was able to compile.
                I tried once and it crashed again.
                I added debug <<this.
                I tried once again and it looked similar as before (just with "this" information):

                15
                Constructing MyWebEngineView QWebEngineView(0x63d7c1694fe0)
                As constructed QWebEngineView(0x63d7c1694fe0)
                In lambda 1 QWebEngineView(0x63d7c1694fe0)
                15
                ~TimetablePrintForm
                Destructing MyWebEngineView QWebEngineView(0x63d7c1694fe0)
                Speicherzugriffsfehler (Speicherabzug geschrieben)
                

                gdb tells me:

                ...                                                                                                                                                                          
                [New Thread 0x7fffbbe006c0 (LWP 6774)]
                [New Thread 0x7fffbb4006c0 (LWP 6775)]
                [New Thread 0x7fffbaa006c0 (LWP 6776)]
                [Thread 0x7fffbaa006c0 (LWP 6776) exited]
                [Thread 0x7fffbb4006c0 (LWP 6775) exited]
                [Thread 0x7fffbbe006c0 (LWP 6774) exited]
                [New Thread 0x7fffbbe006c0 (LWP 6777)]
                [New Thread 0x7fffbb4006c0 (LWP 6778)]
                [New Thread 0x7fffbaa006c0 (LWP 6779)]
                [Thread 0x7fffbaa006c0 (LWP 6779) exited]
                [Thread 0x7fffbb4006c0 (LWP 6778) exited]
                [Thread 0x7fffbbe006c0 (LWP 6777) exited]
                [New Thread 0x7fffbbe006c0 (LWP 6780)]
                [Detaching after fork from child process 6781]
                [Detaching after fork from child process 6782]
                [Detaching after fork from child process 6783]
                [New Thread 0x7fffbb4006c0 (LWP 6784)]
                [New Thread 0x7fffbaa006c0 (LWP 6785)]
                [New Thread 0x7fffb8a006c0 (LWP 6786)]
                [New Thread 0x7fffafe006c0 (LWP 6787)]
                [New Thread 0x7fffaf4006c0 (LWP 6788)]
                [New Thread 0x7fffaea006c0 (LWP 6789)]
                [New Thread 0x7fffae0006c0 (LWP 6790)]
                [New Thread 0x7fffad6006c0 (LWP 6791)]
                [New Thread 0x7fffacc006c0 (LWP 6792)]
                [New Thread 0x7fffa3e006c0 (LWP 6793)]
                [New Thread 0x7fffa2a006c0 (LWP 6795)]
                [New Thread 0x7fffa34006c0 (LWP 6794)]
                [New Thread 0x7fffa20006c0 (LWP 6796)]
                [New Thread 0x7fffa0c006c0 (LWP 6798)]
                [New Thread 0x7fffa16006c0 (LWP 6797)]
                [New Thread 0x7fff97e006c0 (LWP 6799)]
                [New Thread 0x7fff974006c0 (LWP 6800)]
                [New Thread 0x7fff96a006c0 (LWP 6801)]
                [New Thread 0x7fff960006c0 (LWP 6802)]
                [New Thread 0x7fff956006c0 (LWP 6803)]
                [New Thread 0x7fff94c006c0 (LWP 6804)]
                [New Thread 0x7fff8be006c0 (LWP 6805)]
                [Thread 0x7fff8be006c0 (LWP 6805) exited]
                [Thread 0x7fff94c006c0 (LWP 6804) exited]
                [Thread 0x7fff956006c0 (LWP 6803) exited]
                [New Thread 0x7fff956006c0 (LWP 6806)]
                [New Thread 0x7fff94c006c0 (LWP 6807)]
                [New Thread 0x7fff8be006c0 (LWP 6808)]
                [Thread 0x7fff8be006c0 (LWP 6808) exited]
                [Thread 0x7fff94c006c0 (LWP 6807) exited]
                [Thread 0x7fff956006c0 (LWP 6806) exited]
                [New Thread 0x7fff956006c0 (LWP 6809)]
                [New Thread 0x7fff94c006c0 (LWP 6810)]
                [New Thread 0x7fff8be006c0 (LWP 6811)]
                15
                [New Thread 0x7fff8b4006c0 (LWP 6824)]
                [New Thread 0x7fff8a6006c0 (LWP 6825)]
                [New Thread 0x7fff89c006c0 (LWP 6826)]
                [New Thread 0x7fff892006c0 (LWP 6827)]
                [New Thread 0x7fff7fe006c0 (LWP 6828)]
                [New Thread 0x7fff7f4006c0 (LWP 6829)]
                [New Thread 0x7fff7ea006c0 (LWP 6830)]
                Constructing MyWebEngineView QWebEngineView(0x5555569dd090)
                As constructed QWebEngineView(0x5555569dd090)
                In lambda 1 QWebEngineView(0x5555569dd090)
                [New Thread 0x7fff7e0006c0 (LWP 6835)]
                [New Thread 0x7fff7d6006c0 (LWP 6836)]
                [New Thread 0x7fff7cc006c0 (LWP 6838)]
                [New Thread 0x7fff73e006c0 (LWP 6839)]
                [New Thread 0x7fff734006c0 (LWP 6840)]
                [Thread 0x7fff734006c0 (LWP 6840) exited]
                [Thread 0x7fff73e006c0 (LWP 6839) exited]
                [Thread 0x7fff7cc006c0 (LWP 6838) exited]
                [New Thread 0x7fff7cc006c0 (LWP 6841)]
                [New Thread 0x7fff73e006c0 (LWP 6842)]
                [New Thread 0x7fff734006c0 (LWP 6843)]
                [New Thread 0x7fff72a006c0 (LWP 6849)]
                [New Thread 0x7fff720006c0 (LWP 6850)]
                [New Thread 0x7fff716006c0 (LWP 6851)]
                [Thread 0x7fff716006c0 (LWP 6851) exited]
                [Thread 0x7fff720006c0 (LWP 6850) exited]
                [Thread 0x7fff72a006c0 (LWP 6849) exited]
                15
                ~TimetablePrintForm
                Destructing MyWebEngineView QWebEngineView(0x5555569dd090)
                [Thread 0x7fff734006c0 (LWP 6843) exited]
                [Thread 0x7fff73e006c0 (LWP 6842) exited]
                [Thread 0x7fff7cc006c0 (LWP 6841) exited]
                
                Thread 1 "Test" received signal SIGSEGV, Segmentation fault.
                0x00005555566db440 in ?? ()
                (gdb) bt
                #0  0x00005555566db440 in ?? ()
                #1  0x00007ffff77da635 in operator<<(QDebug, QWidget const*) () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Widgets.so.6
                #2  0x0000555555ae06a1 in operator() (__closure=0x5555568004d0) at src/timetableprintform.cpp:45
                #3  0x0000555555ae114d in operator() (__closure=0x7fffffffc120) at ../../../Qt6.8/6.8.1/gcc_64/include/QtCore/qobjectdefs_impl.h:141
                #4  0x0000555555ae11f4 in QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, TimetablePrintForm::TimetablePrintForm(QWidget*)::<lambda()> >::call(TimetablePrintForm::TimetablePrintForm(QWidget*)::<lambda()>&, void**)::<lambda()> >(void **, struct {...} &&) (args=0x7fffffffc258, fn=...)
                    at ../../../Qt6.8/6.8.1/gcc_64/include/QtCore/qobjectdefs_impl.h:65
                #5  0x0000555555ae1192 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, TimetablePrintForm::TimetablePrintForm(QWidget*)::<lambda()> >::call(struct {...} &, void **) (f=..., arg=0x7fffffffc258) at ../../../Qt6.8/6.8.1/gcc_64/include/QtCore/qobjectdefs_impl.h:140
                #6  0x0000555555ae10b7 in QtPrivate::FunctorCallable<TimetablePrintForm::TimetablePrintForm(QWidget*)::<lambda()> >::call<QtPrivate::List<>, void>(struct {...} &, void *, void **) (f=..., 
                    arg=0x7fffffffc258) at ../../../Qt6.8/6.8.1/gcc_64/include/QtCore/qobjectdefs_impl.h:362
                #7  0x0000555555ae1036 in QtPrivate::QCallableObject<TimetablePrintForm::TimetablePrintForm(QWidget*)::<lambda()>, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=1, this_=0x5555568004c0, r=0x5555568004e0, a=0x7fffffffc258, ret=0x0) at ../../../Qt6.8/6.8.1/gcc_64/include/QtCore/qobjectdefs_impl.h:572
                #8  0x00007ffff5fde038 in ?? () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Core.so.6
                #9  0x00007ffff5feb33e in ?? () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Core.so.6
                #10 0x00007ffff5fd1e75 in QObject::event(QEvent*) () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Core.so.6
                #11 0x00007ffff77903f6 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Widgets.so.6
                #12 0x00007ffff5f7bcaa in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Core.so.6
                #13 0x00007ffff6129b4a in QTimerInfoList::activateTimers() () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Core.so.6
                #14 0x00007ffff625570c in ?? () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Core.so.6
                #15 0x00007fffe95145b5 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
                --Type <RET> for more, q to quit, c to continue without paging--
                #16 0x00007fffe9573717 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
                #17 0x00007fffe9513a53 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
                #18 0x00007ffff625591e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Core.so.6
                #19 0x00007ffff5f88fe2 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Core.so.6
                #20 0x00007ffff5f85166 in QCoreApplication::exec() () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Core.so.6
                #21 0x00005555555a7625 in main (argc=1, argv=0x7fffffffd938) at src/main.cpp:677
                
                

                timetableprintform.cpp:45

                qDebug() << "In lambda 2" << view;
                

                I will go to sleep in ~30 minutes minutes. I will check the forum again after work. I can code in spare time only.
                Thank you so much!

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

                @Volker75 said in Looks like the SIGNAL loadFinished(bool) is not emitted anymore with Qt 6.8.1:

                #1 0x00007ffff77da635 in operator<<(QDebug, QWidget const*) () from /home/volker/Qt6.8/6.8.1/gcc_64/lib/libQt6Widgets.so.6

                Still looks to me like it's trying to qDebug() a QWidget --- presumably your view --- when something about it is invalid for that purpose during its destructor.

                Let's leave this now. I believe you have said you get a segmentation violation without introducing qDebug()s of objects during destruction. It would be nice to see a stack trace when that happens without any of this debug stuff introducing its own problems, which I believe is where you are now.

                1 Reply Last reply
                0
                • V Offline
                  V Offline
                  Volker75
                  wrote on last edited by Volker75
                  #51

                  hmm. Thank you so much. I sadly don't understand the last 2 sentences.
                  I am not as skilled as you. I still fear that one of the valgrind warnings is not false positive. But this is only a gut feeling from a rookie.
                  I will retry as soon as Qt 6.8.2 is released. I must sleep now.

                  1 Reply Last reply
                  0
                  • JonBJ JonB

                    @Volker75
                    I believe this is because you have put the class definition with Q_OBJECT directly into a .cpp file. Then moc does not get run on it. You be best/simplest moving the whole class MyWebEngineView definition to its own .h file, including that, and doing a clean rebuild.

                    Actually, I don't see why what you have requires Q_OBJECT. Try commenting that line and (important) do a really clean rebuild?

                    But then connect(view, &MyWebEngineView::loadFinished probably won't work.... Don't know then whether &QWebEngineView::loadFinished would work here. You may have to do first paragraph above, move to .h file.

                    You might wait for @ChrisW67 to get back if he has anything to say, I don't know what effort this is worth for whatever it is trying to prove.

                    C Offline
                    C Offline
                    ChrisW67
                    wrote on last edited by
                    #52

                    @JonB said in Looks like the SIGNAL loadFinished(bool) is not emitted anymore with Qt 6.8.1:

                    You might wait for @ChrisW67 to get back if he has anything to say, I don't know what effort this is worth for whatever it is trying to prove.

                    You are correct, it probably does not require Q_OBJECT. It's just habit for me to put it there and I was typing without the benefit of a Qt environment. I also missed the connect() referring to the wrong class as the target.

                    It's just trying to make construct/destruct of the object overt and identify the objects (hence printing this). This is an aid to identifying if you have accidentally created a masking variable and to allow ensuring that everything is operating on the same object. This could also be done with debugger breakpoints and understanding.

                    1 Reply Last reply
                    1
                    • V Offline
                      V Offline
                      Volker75
                      wrote on last edited by Volker75
                      #53
                      This post is deleted!
                      1 Reply Last reply
                      0
                      • V Offline
                        V Offline
                        Volker75
                        wrote on last edited by Volker75
                        #54

                        I was able to make a minimum example.
                        With Qt 6.7.2 it is working fine.
                        With Qt 6.8.1 is doesn't work.
                        Tested with Kubuntu 24.04.
                        http://www.scryer.de/MinBUG.zip

                        Can maybe anyone have a look?
                        Thank you so much!

                        1 Reply Last reply
                        0
                        • hskoglundH Offline
                          hskoglundH Offline
                          hskoglund
                          wrote on last edited by
                          #55

                          Hi, I tested on Ubuntu 24.04.1 using Qt 6.8.1 in Release mode with gcc version 13.3.0 and your app is working fine for me.
                          However, nothing really happened, the QWebEngineEiew just sits there waiting for an initial url to start.
                          So i added one line to your timetableprintform.cpp:

                          ...
                          viewPreview2 = new QWebEngineView(this); //notVisible. But must stay alive for printing.
                          viewPreview2->setHtml("");  // <--- I added this line
                          viewPreview2->hide();
                          ...
                          

                          and then I got this qQebug output:
                          printPreviewLoadStarted
                          printPreviewLoadProgress
                          0
                          The cached device pixel ratio value was stale on window update. Please file a QTBUG which explains how to reproduce.
                          The cached device pixel ratio value was stale on window update. Please file a QTBUG which explains how to reproduce.
                          printPreviewLoadProgress
                          70
                          printPreviewLoadProgress
                          100
                          setView start
                          setView end
                          printPreview
                          printDocument
                          printFinished
                          The cached device pixel ratio value was stale on window update. Please file a QTBUG which explains how to reproduce.
                          The cached device pixel ratio value was stale on window update. Please file a QTBUG which explains how to reproduce.
                          The cached device pixel ratio value was stale on window update. Please file a QTBUG which explains how to reproduce.

                          So it seems to be working fine, no crash.
                          P.S. Don't worry about those QTBUG message, they always appear for me since maybe 2023.

                          1 Reply Last reply
                          0
                          • V Offline
                            V Offline
                            Volker75
                            wrote on last edited by
                            #56

                            That line is already included.
                            See timetableprintform.cpp line 42.
                            And it is only working with Qt 6.7.2. Not with Qt 6.8.1.

                            1 Reply Last reply
                            0
                            • V Offline
                              V Offline
                              Volker75
                              wrote on last edited by
                              #57

                              It's a bit funny that it work in that line you added.
                              But i can't write it there, since in the real application is a big dialog where you can select of different settings and timetables.
                              So I can't call it from there.
                              I must call it from line 42 and there it is not working anymore.

                              1 Reply Last reply
                              0
                              • V Offline
                                V Offline
                                Volker75
                                wrote on last edited by Volker75
                                #58

                                So the bug is, that this line doesn't work anymore. But why? I need a connect. I can't call it in the constructor like you done it.

                                connect(pbPrintPreviewFull, SIGNAL(clicked()), this, SLOT(printPre
                                

                                You must of course press on preview button!

                                1 Reply Last reply
                                0
                                • V Offline
                                  V Offline
                                  Volker75
                                  wrote on last edited by Volker75
                                  #59

                                  BTW: I don't get the "The cached device pixel ratio value was stale on window update. Please file a QTBUG which explains how to reproduce." information. Are you using Windows, Linux or MacOS?
                                  I am currently trying Linux only and Linux doesn't work anymore :-(

                                  1 Reply Last reply
                                  0
                                  • V Offline
                                    V Offline
                                    Volker75
                                    wrote on last edited by
                                    #60

                                    Ah... Sorry. Reading your mail once again.
                                    Yes, then also the preview button is working. Strange. But the solution doesn't work, since there is a big white preview first and i can't hide it. And after printpreview at should also close, but it stays in the window. So that is not useable. It should work as with Qt 6.7.2.

                                    1 Reply Last reply
                                    0
                                    • hskoglundH Offline
                                      hskoglundH Offline
                                      hskoglund
                                      wrote on last edited by
                                      #61

                                      Hi, the reason the behavior differs between Qt 6.7.2 and Qt 6.8.1 is probably because you're creating the QWebEngineView with your QDialog derived TimetablePrintForm, i.e. not a QWdiget.

                                      Easiest solution is just to omit any parent, like this:

                                      ,,,
                                      viewPreview2 = new QWebEngineView(); //notVisible. But must stay alive for printing.
                                      viewPreview2->hide();
                                      ...
                                      

                                      It was probably just good luck that allowed a QDialog flavoed parent to work anyway in 6.7.2 but in 6.8.1 you run out of it :-)

                                      1 Reply Last reply
                                      1
                                      • V Offline
                                        V Offline
                                        Volker75
                                        wrote on last edited by
                                        #62

                                        I fear I don't understand it 100%, but it is working now!
                                        Thank you so much!
                                        You have earned my announce reward. Please tell me your PayPal (email) or IBAN here or write me a private message and I will sent you the money..
                                        Can you also tell if I need to care about deleting it now myself?
                                        So do I need to write somewhere "delete viewPreview2" myself now or does the garbage collector already cares about it?

                                        1 Reply Last reply
                                        0
                                        • hskoglundH Offline
                                          hskoglundH Offline
                                          hskoglund
                                          wrote on last edited by
                                          #63

                                          Re. the delete: easiest is to do that in TimetablePrintForm's destructor:

                                          ...
                                          TimetablePrintForm::~TimetablePrintForm(){
                                              delete viewPreview2;
                                          }
                                          ...
                                          

                                          (in C++ you have to take out the garbage yourself, no GC available)

                                          1 Reply Last reply
                                          1
                                          • V Volker75 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