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. The touch screen events are block after deleteLater function
Qt 6.11 is out! See what's new in the release blog

The touch screen events are block after deleteLater function

Scheduled Pinned Locked Moved Unsolved General and Desktop
29 Posts 5 Posters 5.2k 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.
  • G Offline
    G Offline
    GianmarcoUtech
    wrote on last edited by
    #1

    Hello guys,

    I am development my application with the qt 5.15 (c++ code) .The my application is implement using objects are child of the QWidget class. Every time that I open a child class connect the closing signal at the slot to parent class to delete the object child :

    PARENT CLASS :
    windows = new ChildClass ( ) ;
    connect ( )
    disconnect(childClass,&childClass::signalClose,parentClass,&parentClass::closeChildClass);
    windows-> showFullScreen ( ) ;

    CHILD CLASS :
    emit signalClose ( ) ;

    PARENT CLASS :
    slot closeChildClass :
    windows-> deleteLater ( ) ;

    I have Implement a application to execute this simple code, if I can keep press the touch screen with my finger when the application execute the windows-> deleteLater ( ) instruction, the touch screen is freeze, I don't can to press the button of the my application with the display touch. While if I connect the mouse I can press the button correctly, but if to press button with the finger not spring the &QPushButton::released event. If I can to active &QPushButton::released event with mouse, means that my application is not block and the button is enabled. If I comment the windows-> deleteLater ( ) instruction I don't this problem. Afer that problem occurred if I restart the application it work correctly, without power off the pc, so the display touch work correcty.

    Can you help me ?
    This problem blocking the release the my application !
    Thanks

    jsulmJ 1 Reply Last reply
    0
    • G GianmarcoUtech

      Hello guys,

      I am development my application with the qt 5.15 (c++ code) .The my application is implement using objects are child of the QWidget class. Every time that I open a child class connect the closing signal at the slot to parent class to delete the object child :

      PARENT CLASS :
      windows = new ChildClass ( ) ;
      connect ( )
      disconnect(childClass,&childClass::signalClose,parentClass,&parentClass::closeChildClass);
      windows-> showFullScreen ( ) ;

      CHILD CLASS :
      emit signalClose ( ) ;

      PARENT CLASS :
      slot closeChildClass :
      windows-> deleteLater ( ) ;

      I have Implement a application to execute this simple code, if I can keep press the touch screen with my finger when the application execute the windows-> deleteLater ( ) instruction, the touch screen is freeze, I don't can to press the button of the my application with the display touch. While if I connect the mouse I can press the button correctly, but if to press button with the finger not spring the &QPushButton::released event. If I can to active &QPushButton::released event with mouse, means that my application is not block and the button is enabled. If I comment the windows-> deleteLater ( ) instruction I don't this problem. Afer that problem occurred if I restart the application it work correctly, without power off the pc, so the display touch work correcty.

      Can you help me ?
      This problem blocking the release the my application !
      Thanks

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @GianmarcoUtech said in The touch screen events are block after deleteLater function:

      PARENT CLASS :
      windows = new ChildClass ( ) ;
      connect ( )
      disconnect(childClass,&childClass::signalClose,parentClass,&parentClass::closeChildClass);
      windows-> showFullScreen ( ) ;
      CHILD CLASS :
      emit signalClose ( ) ;
      PARENT CLASS :
      slot closeChildClass :
      windows-> deleteLater ( ) ;

      I don't understand this: you create a child class and name the object "windows", but then you connect an object called "childClass"? Why?! And why do you call disconnect instead of connect? Can you please post proper code you're using?

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

      G 1 Reply Last reply
      0
      • jsulmJ jsulm

        @GianmarcoUtech said in The touch screen events are block after deleteLater function:

        PARENT CLASS :
        windows = new ChildClass ( ) ;
        connect ( )
        disconnect(childClass,&childClass::signalClose,parentClass,&parentClass::closeChildClass);
        windows-> showFullScreen ( ) ;
        CHILD CLASS :
        emit signalClose ( ) ;
        PARENT CLASS :
        slot closeChildClass :
        windows-> deleteLater ( ) ;

        I don't understand this: you create a child class and name the object "windows", but then you connect an object called "childClass"? Why?! And why do you call disconnect instead of connect? Can you please post proper code you're using?

        G Offline
        G Offline
        GianmarcoUtech
        wrote on last edited by
        #3

        @jsulm okay,

        ----------------------- home.h -------------------------```
        code_text

        #ifndef HOME_H
        #define HOME_H
        
        #include <QWidget>
        
        
        //---------------------
        //INCLUDE VALIDI PER TUTTE LE FINESTRE
        #include <QScreen>
        #include <QDebug>
        #include <QTimer>
        #include <QDateTime>
        #include <QFile>
        #include <QJsonDocument>
        #include <QJsonValue>
        #include <QJsonArray>
        #include <QJsonObject>
        #include <QFileInfo>
        #include <QSqlDatabase>
        #include <QSqlError>
        #include <QSqlQuery>
        #include <QMessageLogContext>
        #include <QLoggingCategory>
        //---------------------
        #include "lavaggio.h"
        
        #include <QtGui>
        #include <QPainter>
        #include <QStyleOption>
        #include <QDir>
        
        
        namespace Ui {
        class Home;
        }
        
        class Home : public QWidget
        {
            Q_OBJECT
        
        public:
            explicit Home ( Init *tmp_init = nullptr, QWidget *parent = nullptr ) ;
            ~Home();
        
         protected:
            void paintEvent(QPaintEvent *)
            {
                QStyleOption opt;
                opt.init(this);
                QPainter p(this);
                style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
            }
        
        signals :
        
        public slots :
        
           void openAvvioLavaggio();
           void closeAvvioLavaggio();
        
        private slots:    
         
        private :
            Ui::Home *ui ;
            Lavaggio *window = nullptr ;
        
        } ;
        
        
        #endif // HOME_H
        
        ----------------------- home.cpp -------------------------
        Home::Home (Init * tmp_init , QWidget * parent ) :
            QWidget ( parent ) ,
            ui ( new Ui::Home )
        {
            qDebug ( ) << "Load Home" ;
        
            ui->setupUi(this);
        
            this -> setWindowFlags ( Qt::Window | Qt::CustomizeWindowHint ) ;
        connect(ui->btn_avvio_lavaggio, &QPushButton::released, this, &Home::openAvvioLavaggio);
        
        }
        
        void Home::openAvvioLavaggio(){
        
            qDebug ( ) <<"Start 'wash'.";
        
            // creo istanza oggetto finestra Avvio Lavaggio
            window= new Lavaggio();
        
            //collego slot-signal all'eventi di chiusura del widget
            // Note : time to execute this instruction about 500ms
            connect(window,&Lavaggio::closeLavaggio,this,&Home::closeAvvioLavaggio);
        
            //visualizzo schermata Avvio Lavaggio
            window->showFullScreen();
        
            // Remove the 'stays on top hint'
            this -> setWindowFlags ( Qt::Window | Qt::CustomizeWindowHint ) ;
        
             
        }
        
        void Home::closeAvvioLavaggio()
        {
            qDebug ( ) <<"closeAvvioLavaggio";
        
            //scollego slot-signal all'eventi di chiusura del widget
            disconnect(window,&Lavaggio::closeLavaggio,this,&Home::closeAvvioLavaggio);
            window->deleteLater();
            window = nullptr ;
        
        }
        
        ----------------------- lavaggio.h -------------------------
        #ifndef LAVAGGIO_H
        #define LAVAGGIO_H
        
        #include <QWidget>
        //--------------------- 
        //INCLUDE VALIDI PER TUTTE LE FINESTRE
        #include <QScreen>
        #include <QDebug>
        #include <QTimer>
        
        #include <QDateTime>
        #include <QProcess>
        #include <QFile>
        #include <QJsonDocument>
        #include <QJsonValue>
        #include <QJsonArray>
        #include <QJsonObject>
        #include <QFileInfo>
        #include <QSqlDatabase>
        #include <QSqlError>
        #include <QSqlQuery>
        #include <QSqlRecord>
        
        #include <QtGui>
        #include <QPainter>
        #include <QStyleOption>
        
        //---------------------
        #include "pagamentolavaggioasciugatura.h"
        #include "messagebox.h"
        #include "ChooseTypeWash.h"
        #include "laundrysettings.h"
        #include "laundryapp.h"
        
        
        namespace Ui {
        class Lavaggio;
        }
        
        class Lavaggio : public QWidget
        {
            Q_OBJECT
        
        public:
            explicit Lavaggio( QWidget *parent = nullptr);
            ~Lavaggio();
        
          
        protected:
            void paintEvent(QPaintEvent *)
            {
                QStyleOption opt;
                opt.init(this);
                QPainter p(this);
                style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
            }
        
        signals :
            // Close the window
            void closeLavaggio ( ) ;
        
        private slots:
            // Exit from screen
            void exitWash ( ) ;
        
        private:
            Ui::Lavaggio *ui;
        
        } ;
        
        #endif // LAVAGGIO_H
        
        
        ----------------------- lavaggio.cpp -------------------------
        
        Lavaggio::Lavaggio ( QWidget *parent ) :
            QWidget(parent),
            ui(new Ui::Lavaggio)
        {
            qDebug ( ) <<"Load Lavaggio";
        
            //--------------------------------------
            //CARICAMENTO GRAFICA
            //avvio caricamento grafica
            ui->setupUi(this);
        
            // --------------------------------------
            // PERSONALIZZAZIONE GRAFICA
            // queste impostazioni grafiche devono valere per tutte le finestre
            // per eliminare la toolbar
            // Note: Time to execute this instruction about 500ms
            this->setWindowFlags(Qt::Window | Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint );
        
            connect(ui->btn_indietro, &QPushButton::released, this, &Lavaggio::exitWash);
        
        }
        
        void Lavaggio::exitWash ( ) {
        
            qDebug ( ) <<"Check Exit wash" ;
        
                qDebug ( ) << "Exit -> wash" ;
        
                emit closeLavaggio ( ) ;    
        
                close ( ) ;
           
        }
        jsulmJ 1 Reply Last reply
        0
        • G GianmarcoUtech

          @jsulm okay,

          ----------------------- home.h -------------------------```
          code_text

          #ifndef HOME_H
          #define HOME_H
          
          #include <QWidget>
          
          
          //---------------------
          //INCLUDE VALIDI PER TUTTE LE FINESTRE
          #include <QScreen>
          #include <QDebug>
          #include <QTimer>
          #include <QDateTime>
          #include <QFile>
          #include <QJsonDocument>
          #include <QJsonValue>
          #include <QJsonArray>
          #include <QJsonObject>
          #include <QFileInfo>
          #include <QSqlDatabase>
          #include <QSqlError>
          #include <QSqlQuery>
          #include <QMessageLogContext>
          #include <QLoggingCategory>
          //---------------------
          #include "lavaggio.h"
          
          #include <QtGui>
          #include <QPainter>
          #include <QStyleOption>
          #include <QDir>
          
          
          namespace Ui {
          class Home;
          }
          
          class Home : public QWidget
          {
              Q_OBJECT
          
          public:
              explicit Home ( Init *tmp_init = nullptr, QWidget *parent = nullptr ) ;
              ~Home();
          
           protected:
              void paintEvent(QPaintEvent *)
              {
                  QStyleOption opt;
                  opt.init(this);
                  QPainter p(this);
                  style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
              }
          
          signals :
          
          public slots :
          
             void openAvvioLavaggio();
             void closeAvvioLavaggio();
          
          private slots:    
           
          private :
              Ui::Home *ui ;
              Lavaggio *window = nullptr ;
          
          } ;
          
          
          #endif // HOME_H
          
          ----------------------- home.cpp -------------------------
          Home::Home (Init * tmp_init , QWidget * parent ) :
              QWidget ( parent ) ,
              ui ( new Ui::Home )
          {
              qDebug ( ) << "Load Home" ;
          
              ui->setupUi(this);
          
              this -> setWindowFlags ( Qt::Window | Qt::CustomizeWindowHint ) ;
          connect(ui->btn_avvio_lavaggio, &QPushButton::released, this, &Home::openAvvioLavaggio);
          
          }
          
          void Home::openAvvioLavaggio(){
          
              qDebug ( ) <<"Start 'wash'.";
          
              // creo istanza oggetto finestra Avvio Lavaggio
              window= new Lavaggio();
          
              //collego slot-signal all'eventi di chiusura del widget
              // Note : time to execute this instruction about 500ms
              connect(window,&Lavaggio::closeLavaggio,this,&Home::closeAvvioLavaggio);
          
              //visualizzo schermata Avvio Lavaggio
              window->showFullScreen();
          
              // Remove the 'stays on top hint'
              this -> setWindowFlags ( Qt::Window | Qt::CustomizeWindowHint ) ;
          
               
          }
          
          void Home::closeAvvioLavaggio()
          {
              qDebug ( ) <<"closeAvvioLavaggio";
          
              //scollego slot-signal all'eventi di chiusura del widget
              disconnect(window,&Lavaggio::closeLavaggio,this,&Home::closeAvvioLavaggio);
              window->deleteLater();
              window = nullptr ;
          
          }
          
          ----------------------- lavaggio.h -------------------------
          #ifndef LAVAGGIO_H
          #define LAVAGGIO_H
          
          #include <QWidget>
          //--------------------- 
          //INCLUDE VALIDI PER TUTTE LE FINESTRE
          #include <QScreen>
          #include <QDebug>
          #include <QTimer>
          
          #include <QDateTime>
          #include <QProcess>
          #include <QFile>
          #include <QJsonDocument>
          #include <QJsonValue>
          #include <QJsonArray>
          #include <QJsonObject>
          #include <QFileInfo>
          #include <QSqlDatabase>
          #include <QSqlError>
          #include <QSqlQuery>
          #include <QSqlRecord>
          
          #include <QtGui>
          #include <QPainter>
          #include <QStyleOption>
          
          //---------------------
          #include "pagamentolavaggioasciugatura.h"
          #include "messagebox.h"
          #include "ChooseTypeWash.h"
          #include "laundrysettings.h"
          #include "laundryapp.h"
          
          
          namespace Ui {
          class Lavaggio;
          }
          
          class Lavaggio : public QWidget
          {
              Q_OBJECT
          
          public:
              explicit Lavaggio( QWidget *parent = nullptr);
              ~Lavaggio();
          
            
          protected:
              void paintEvent(QPaintEvent *)
              {
                  QStyleOption opt;
                  opt.init(this);
                  QPainter p(this);
                  style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
              }
          
          signals :
              // Close the window
              void closeLavaggio ( ) ;
          
          private slots:
              // Exit from screen
              void exitWash ( ) ;
          
          private:
              Ui::Lavaggio *ui;
          
          } ;
          
          #endif // LAVAGGIO_H
          
          
          ----------------------- lavaggio.cpp -------------------------
          
          Lavaggio::Lavaggio ( QWidget *parent ) :
              QWidget(parent),
              ui(new Ui::Lavaggio)
          {
              qDebug ( ) <<"Load Lavaggio";
          
              //--------------------------------------
              //CARICAMENTO GRAFICA
              //avvio caricamento grafica
              ui->setupUi(this);
          
              // --------------------------------------
              // PERSONALIZZAZIONE GRAFICA
              // queste impostazioni grafiche devono valere per tutte le finestre
              // per eliminare la toolbar
              // Note: Time to execute this instruction about 500ms
              this->setWindowFlags(Qt::Window | Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint );
          
              connect(ui->btn_indietro, &QPushButton::released, this, &Lavaggio::exitWash);
          
          }
          
          void Lavaggio::exitWash ( ) {
          
              qDebug ( ) <<"Check Exit wash" ;
          
                  qDebug ( ) << "Exit -> wash" ;
          
                  emit closeLavaggio ( ) ;    
          
                  close ( ) ;
             
          }
          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @GianmarcoUtech said in The touch screen events are block after deleteLater function:

          void Home::closeAvvioLavaggio()
          {
          qDebug ( ) <<"closeAvvioLavaggio";

          //scollego slot-signal all'eventi di chiusura del widget
          disconnect(window,&Lavaggio::closeLavaggio,this,&Home::closeAvvioLavaggio);
          window->deleteLater();
          window = nullptr ;
          

          }

          Did you try to call this->show() or this->showFullScreen() inside closeAvvioLavaggio?

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

          G 1 Reply Last reply
          0
          • jsulmJ jsulm

            @GianmarcoUtech said in The touch screen events are block after deleteLater function:

            void Home::closeAvvioLavaggio()
            {
            qDebug ( ) <<"closeAvvioLavaggio";

            //scollego slot-signal all'eventi di chiusura del widget
            disconnect(window,&Lavaggio::closeLavaggio,this,&Home::closeAvvioLavaggio);
            window->deleteLater();
            window = nullptr ;
            

            }

            Did you try to call this->show() or this->showFullScreen() inside closeAvvioLavaggio?

            G Offline
            G Offline
            GianmarcoUtech
            wrote on last edited by
            #5

            @jsulm said in The touch screen events are block after deleteLater function:

            Did you try to call this->show() or this->showFullScreen() inside closeAvvioLavaggio?

            Do you think that could be the cause of the problem?

            I need to display the widget full screen, so that the user can't press behind the widget.

            jsulmJ 1 Reply Last reply
            0
            • G GianmarcoUtech

              @jsulm said in The touch screen events are block after deleteLater function:

              Did you try to call this->show() or this->showFullScreen() inside closeAvvioLavaggio?

              Do you think that could be the cause of the problem?

              I need to display the widget full screen, so that the user can't press behind the widget.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @GianmarcoUtech said in The touch screen events are block after deleteLater function:

              I need to display the widget full screen, so that the user can't press behind the widget

              Yes, but as soon as the child widget is closed you want to show the main window again, right?

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

              G 1 Reply Last reply
              0
              • jsulmJ jsulm

                @GianmarcoUtech said in The touch screen events are block after deleteLater function:

                I need to display the widget full screen, so that the user can't press behind the widget

                Yes, but as soon as the child widget is closed you want to show the main window again, right?

                G Offline
                G Offline
                GianmarcoUtech
                wrote on last edited by
                #7

                @jsulm said in The touch screen events are block after deleteLater function:

                Yes, but as soon as the child widget is closed you want to show the main window again, right?

                Yes it's right, but in really the parent screen is already open, under the child screen, the parent screen is show when is close the child screen.

                G 1 Reply Last reply
                0
                • G GianmarcoUtech

                  @jsulm said in The touch screen events are block after deleteLater function:

                  Yes, but as soon as the child widget is closed you want to show the main window again, right?

                  Yes it's right, but in really the parent screen is already open, under the child screen, the parent screen is show when is close the child screen.

                  G Offline
                  G Offline
                  GianmarcoUtech
                  wrote on last edited by
                  #8

                  @jsulm sorry for the insistence, for me is important understand the origin of the problem, because it am blocking the delivery of the projects developed with qt. Thanks

                  jsulmJ 1 Reply Last reply
                  0
                  • G GianmarcoUtech

                    @jsulm sorry for the insistence, for me is important understand the origin of the problem, because it am blocking the delivery of the projects developed with qt. Thanks

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @GianmarcoUtech Sorry, but currently I'm out of ideas.

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

                    G 1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @GianmarcoUtech Sorry, but currently I'm out of ideas.

                      G Offline
                      G Offline
                      GianmarcoUtech
                      wrote on last edited by
                      #10

                      @jsulm You know who I can contact to resolve my problem ?

                      Thanks

                      JoeCFDJ 1 Reply Last reply
                      0
                      • G GianmarcoUtech

                        @jsulm You know who I can contact to resolve my problem ?

                        Thanks

                        JoeCFDJ Offline
                        JoeCFDJ Offline
                        JoeCFD
                        wrote on last edited by JoeCFD
                        #11

                        @GianmarcoUtech Qt 5 has update problems on touch screen.
                        A workaround may be to hide window

                        
                        
                            void Home::closeAvvioLavaggio()
                            {
                                qDebug ( ) <<"closeAvvioLavaggio";
                        
                                //scollego slot-signal all'eventi di chiusura del widget
                                disconnect( window,&Lavaggio::closeLavaggio,
                                            this,  &Home::closeAvvioLavaggio);
                                window->setVisible( false );  /* do not delete it now, simply hide it since I assume it is not big */
                            }
                        
                        

                        Delete it in the destructor of Home

                        G 1 Reply Last reply
                        0
                        • JoeCFDJ JoeCFD

                          @GianmarcoUtech Qt 5 has update problems on touch screen.
                          A workaround may be to hide window

                          
                          
                              void Home::closeAvvioLavaggio()
                              {
                                  qDebug ( ) <<"closeAvvioLavaggio";
                          
                                  //scollego slot-signal all'eventi di chiusura del widget
                                  disconnect( window,&Lavaggio::closeLavaggio,
                                              this,  &Home::closeAvvioLavaggio);
                                  window->setVisible( false );  /* do not delete it now, simply hide it since I assume it is not big */
                              }
                          
                          

                          Delete it in the destructor of Home

                          G Offline
                          G Offline
                          GianmarcoUtech
                          wrote on last edited by
                          #12

                          @JoeCFD The your idea its correct, but hiding the window without deleting the object creates an increase in memory occupation. Because using NEW (in the openAvvioLavaggio function) you create new objects that are never deleted. Then my application has many child windows to manage.

                          jsulmJ 1 Reply Last reply
                          0
                          • G GianmarcoUtech

                            @JoeCFD The your idea its correct, but hiding the window without deleting the object creates an increase in memory occupation. Because using NEW (in the openAvvioLavaggio function) you create new objects that are never deleted. Then my application has many child windows to manage.

                            jsulmJ Offline
                            jsulmJ Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            @GianmarcoUtech There is no need to delete and recreate the window all the time. Simply show and hide one existing window...

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

                            G 1 Reply Last reply
                            0
                            • jsulmJ jsulm

                              @GianmarcoUtech There is no need to delete and recreate the window all the time. Simply show and hide one existing window...

                              G Offline
                              G Offline
                              GianmarcoUtech
                              wrote on last edited by
                              #14

                              @jsulm It's true, but there are almost 50 screens, it takes a long time to modify all of them and the application has been consolidated for a couple of years, I would like to modify as little as possible. But actually I would like to understand why deleting an object with delayLater causes this problem with the touch, I would like to understand if it is my problem or a qt bug. It seems very strange to me that this hasn't happened to any other developer.

                              JoeCFDJ 1 Reply Last reply
                              0
                              • G GianmarcoUtech

                                @jsulm It's true, but there are almost 50 screens, it takes a long time to modify all of them and the application has been consolidated for a couple of years, I would like to modify as little as possible. But actually I would like to understand why deleting an object with delayLater causes this problem with the touch, I would like to understand if it is my problem or a qt bug. It seems very strange to me that this hasn't happened to any other developer.

                                JoeCFDJ Offline
                                JoeCFDJ Offline
                                JoeCFD
                                wrote on last edited by
                                #15

                                @GianmarcoUtech It may also be related to the drivers for touch screen. But I guess it is more a Qt issue.

                                Can you try to set focus or call update or both to Home after

                                window->deleteLater();
                                window = nullptr ;
                                
                                G 1 Reply Last reply
                                0
                                • JoeCFDJ JoeCFD

                                  @GianmarcoUtech It may also be related to the drivers for touch screen. But I guess it is more a Qt issue.

                                  Can you try to set focus or call update or both to Home after

                                  window->deleteLater();
                                  window = nullptr ;
                                  
                                  G Offline
                                  G Offline
                                  GianmarcoUtech
                                  wrote on last edited by
                                  #16

                                  @JoeCFD

                                  I have tried , but I have not resolved:

                                  void Home::closeAvvioLavaggio()
                                  {
                                    disconnect(window,&Lavaggio::closeLavaggio,this,&Home::closeAvvioLavaggio);
                                      window->deleteLater();
                                      window = nullptr ;
                                  
                                      this->update ( ) ;
                                      this->setFocus ( ) ;
                                  
                                  }
                                  
                                  JoeCFDJ 1 Reply Last reply
                                  0
                                  • G GianmarcoUtech

                                    @JoeCFD

                                    I have tried , but I have not resolved:

                                    void Home::closeAvvioLavaggio()
                                    {
                                      disconnect(window,&Lavaggio::closeLavaggio,this,&Home::closeAvvioLavaggio);
                                        window->deleteLater();
                                        window = nullptr ;
                                    
                                        this->update ( ) ;
                                        this->setFocus ( ) ;
                                    
                                    }
                                    
                                    JoeCFDJ Offline
                                    JoeCFDJ Offline
                                    JoeCFD
                                    wrote on last edited by
                                    #17

                                    @GianmarcoUtech Can you also try to assign Home to the parent of window

                                    delete window;
                                    window = nullptr;

                                    Home is frozen often because it lost focus and does not update.

                                    G 1 Reply Last reply
                                    0
                                    • JoeCFDJ JoeCFD

                                      @GianmarcoUtech Can you also try to assign Home to the parent of window

                                      delete window;
                                      window = nullptr;

                                      Home is frozen often because it lost focus and does not update.

                                      G Offline
                                      G Offline
                                      GianmarcoUtech
                                      wrote on last edited by
                                      #18

                                      @JoeCFD So how should I modify my code?

                                      JoeCFDJ 1 Reply Last reply
                                      0
                                      • G GianmarcoUtech

                                        @JoeCFD So how should I modify my code?

                                        JoeCFDJ Offline
                                        JoeCFDJ Offline
                                        JoeCFD
                                        wrote on last edited by JoeCFD
                                        #19

                                        @GianmarcoUtech
                                        I guess window is a fullscreen pop-up, right? If yes, you may not be able to do it.
                                        Otherwise, you can do
                                        window= new Lavaggio( this );

                                        Anyway, what I am suggesting is to somehow update your gui after window is deleted. If you can update any widget on your GUI after the delete, it will help since the update of any widget will cause the whole GUI to update.

                                        G 1 Reply Last reply
                                        0
                                        • JoeCFDJ JoeCFD

                                          @GianmarcoUtech
                                          I guess window is a fullscreen pop-up, right? If yes, you may not be able to do it.
                                          Otherwise, you can do
                                          window= new Lavaggio( this );

                                          Anyway, what I am suggesting is to somehow update your gui after window is deleted. If you can update any widget on your GUI after the delete, it will help since the update of any widget will cause the whole GUI to update.

                                          G Offline
                                          G Offline
                                          GianmarcoUtech
                                          wrote on last edited by
                                          #20

                                          @JoeCFD I have understand the your suggesting. Is a idea very interesent, but I can't put it into practice, because I know olny the functions setFocus and update. I have looking for on qt manual, but I have not find anything interesting. I testing this code but unfortunately not work :

                                          void Home::closeAvvioLavaggio()
                                          {
                                          disconnect(window,&Lavaggio::closeLavaggio,this,&Home::closeAvvioLavaggio);
                                          window->deleteLater();
                                          window = nullptr ;

                                          this->setFocus ( ) ;
                                          this->update ( ) ;   
                                          

                                          }

                                          void Home::openAvvioLavaggio(){

                                          qDebug ( ) <<"Start 'wash'.";
                                          
                                          // creo istanza oggetto finestra Avvio Lavaggio
                                          window= new Lavaggio(this);
                                          
                                          //collego slot-signal all'eventi di chiusura del widget
                                          // Note : time to execute this instruction about 500ms
                                          connect(window,&Lavaggio::closeLavaggio,this,&Home::closeAvvioLavaggio);
                                          
                                          //visualizzo schermata Avvio Lavaggio
                                          window->showFullScreen();
                                          
                                          // Remove the 'stays on top hint'
                                          this -> setWindowFlags ( Qt::Window | Qt::CustomizeWindowHint ) ;
                                          

                                          }

                                          JoeCFDJ 1 Reply Last reply
                                          0

                                          • Login

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