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. How to display a specific pop-up window and then proceed with an internal procedure
Qt 6.11 is out! See what's new in the release blog

How to display a specific pop-up window and then proceed with an internal procedure

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 2 Posters 1.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.
  • I Offline
    I Offline
    IknowQT
    wrote on last edited by
    #1
    Standard_MeasureDataReceive* rcvData = nullptr;
    	this->connect(this, &wStandardCurve::UserDefine_ReceiveData, [&](Standard_MeasureDataReceive data)
    		{
    			rcvData = new Standard_MeasureDataReceive();
    			rcvData = static_cast<Standard_MeasureDataReceive*>(&data);
    		});
    
    m_pExcuteDlg->Show(999999, true);
    
    switch (m_pStcInfo->nMesType)
    	{
    	case 0:		// lamda 1
    	{
    		cGlobalParam::SendMeasureCellSetting(CellTypes::Single, (MultiCellTypes)m_pStcInfo->iCellNumber);
    
    		//for (int nCnt = 1; nCnt <= m_pDataModel->rowCount(); nCnt++)
    		for (int group = 1; group <= nGroupCnt; group++)
    		{
    			// [ 샘플을 넣으세요 Msg 출력]
    			{
    				wMessageBox msg(QString::fromLocal8Bit("샘플을 삽입하십시오"), this);
    			}
    
    			cGlobalParam::SendMeasureStart(ModeTypes::StandardCurve);
    
    			if (data)
    			{
    				float fa = data->ABS;
    				float ft = data->Trans;
    			}
                    }
             }
    

    m_pExcuteDlg is a pop-up window.
    After popping up this ui, a specific event is handled and processed as a lambda.
    Afterwards, I would like to proceed with the procedure of the swich case.

    I would like to proceed with the procedure with the popup still displayed.

    I don't want to use goto.

    jsulmJ 1 Reply Last reply
    0
    • I IknowQT

      @jsulm

      void wBusyDialog::Show(int msec, bool bSingle=false)
      {
      	if (m_pTimer)
      	{
      		m_pTimer->start(msec);
      		this->exec();
      	}
      }
      void wBusyDialog::Hide()
      {
      	if (m_pTimer)
      	{
      		m_pTimer->stop();
      		this->close();
      	}	
      }
      this->connect(this->m_pTimer, &QTimer::timeout, [=]()
      		{
      			//m_pTimer->stop();
      			this->Hide();
      		});
      

      Sorry I didn't understand what you meant.

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

      @IknowQT said in How to display a specific pop-up window and then proceed with an internal procedure:

      this->exec();

      So, it is blocking (exec() is blocking).
      Change its implementation so it is non-blocking (use show() instead of exec()) or provide a second non-blocking implementation.

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

      I 1 Reply Last reply
      1
      • I IknowQT
        Standard_MeasureDataReceive* rcvData = nullptr;
        	this->connect(this, &wStandardCurve::UserDefine_ReceiveData, [&](Standard_MeasureDataReceive data)
        		{
        			rcvData = new Standard_MeasureDataReceive();
        			rcvData = static_cast<Standard_MeasureDataReceive*>(&data);
        		});
        
        m_pExcuteDlg->Show(999999, true);
        
        switch (m_pStcInfo->nMesType)
        	{
        	case 0:		// lamda 1
        	{
        		cGlobalParam::SendMeasureCellSetting(CellTypes::Single, (MultiCellTypes)m_pStcInfo->iCellNumber);
        
        		//for (int nCnt = 1; nCnt <= m_pDataModel->rowCount(); nCnt++)
        		for (int group = 1; group <= nGroupCnt; group++)
        		{
        			// [ 샘플을 넣으세요 Msg 출력]
        			{
        				wMessageBox msg(QString::fromLocal8Bit("샘플을 삽입하십시오"), this);
        			}
        
        			cGlobalParam::SendMeasureStart(ModeTypes::StandardCurve);
        
        			if (data)
        			{
        				float fa = data->ABS;
        				float ft = data->Trans;
        			}
                        }
                 }
        

        m_pExcuteDlg is a pop-up window.
        After popping up this ui, a specific event is handled and processed as a lambda.
        Afterwards, I would like to proceed with the procedure of the swich case.

        I would like to proceed with the procedure with the popup still displayed.

        I don't want to use goto.

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

        @IknowQT Please provide more information!
        What is m_pExcuteDlg?
        What does Show() do exactly?
        You can show a dialog in a non-blocking way calling show() on it, but from the information you gave it is completelly unclear what your "ui" is actually doing...

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

        I 1 Reply Last reply
        0
        • jsulmJ jsulm

          @IknowQT Please provide more information!
          What is m_pExcuteDlg?
          What does Show() do exactly?
          You can show a dialog in a non-blocking way calling show() on it, but from the information you gave it is completelly unclear what your "ui" is actually doing...

          I Offline
          I Offline
          IknowQT
          wrote on last edited by
          #3

          @jsulm

          m_pExcuteDlg is a ui class with a progress bar.
          After ui show with a progress bar, when data comes in to the lambda, I want to go into the switch statement and proceed with the next step.

          Unless I call the exit function on the progress bar, the progress bar ui should remain popped up.

          jsulmJ 1 Reply Last reply
          0
          • I IknowQT

            @jsulm

            m_pExcuteDlg is a ui class with a progress bar.
            After ui show with a progress bar, when data comes in to the lambda, I want to go into the switch statement and proceed with the next step.

            Unless I call the exit function on the progress bar, the progress bar ui should remain popped up.

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

            @IknowQT Can you please answer this question: does m_pExcuteDlg->Show(999999, true); block? I have no idea how it is implemented, this is something you have to explain or show its implementation.

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

            I 1 Reply Last reply
            0
            • jsulmJ jsulm

              @IknowQT Can you please answer this question: does m_pExcuteDlg->Show(999999, true); block? I have no idea how it is implemented, this is something you have to explain or show its implementation.

              I Offline
              I Offline
              IknowQT
              wrote on last edited by IknowQT
              #5

              @jsulm

              void wBusyDialog::Show(int msec, bool bSingle=false)
              {
              	if (m_pTimer)
              	{
              		m_pTimer->start(msec);
              		this->exec();
              	}
              }
              void wBusyDialog::Hide()
              {
              	if (m_pTimer)
              	{
              		m_pTimer->stop();
              		this->close();
              	}	
              }
              this->connect(this->m_pTimer, &QTimer::timeout, [=]()
              		{
              			//m_pTimer->stop();
              			this->Hide();
              		});
              

              Sorry I didn't understand what you meant.

              jsulmJ 1 Reply Last reply
              0
              • I IknowQT

                @jsulm

                void wBusyDialog::Show(int msec, bool bSingle=false)
                {
                	if (m_pTimer)
                	{
                		m_pTimer->start(msec);
                		this->exec();
                	}
                }
                void wBusyDialog::Hide()
                {
                	if (m_pTimer)
                	{
                		m_pTimer->stop();
                		this->close();
                	}	
                }
                this->connect(this->m_pTimer, &QTimer::timeout, [=]()
                		{
                			//m_pTimer->stop();
                			this->Hide();
                		});
                

                Sorry I didn't understand what you meant.

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

                @IknowQT said in How to display a specific pop-up window and then proceed with an internal procedure:

                this->exec();

                So, it is blocking (exec() is blocking).
                Change its implementation so it is non-blocking (use show() instead of exec()) or provide a second non-blocking implementation.

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

                I 1 Reply Last reply
                1
                • jsulmJ jsulm

                  @IknowQT said in How to display a specific pop-up window and then proceed with an internal procedure:

                  this->exec();

                  So, it is blocking (exec() is blocking).
                  Change its implementation so it is non-blocking (use show() instead of exec()) or provide a second non-blocking implementation.

                  I Offline
                  I Offline
                  IknowQT
                  wrote on last edited by
                  #7

                  @jsulm said in How to display a specific pop-up window and then proceed with an internal procedure:

                  비차단 구현

                  Can I see an example of a non-blocking implementation?
                  What documentation should I refer to?

                  jsulmJ 1 Reply Last reply
                  0
                  • I IknowQT

                    @jsulm said in How to display a specific pop-up window and then proceed with an internal procedure:

                    비차단 구현

                    Can I see an example of a non-blocking implementation?
                    What documentation should I refer to?

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

                    @IknowQT said in How to display a specific pop-up window and then proceed with an internal procedure:

                    Can I see an example of a non-blocking implementation?

                    What example do you need to show how to call show()?

                    void wBusyDialog::Show(int msec, bool bSingle=false)
                    {
                        this->show();
                    }
                    

                    https://doc.qt.io/qt-5/qwidget.html#show

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

                    I 1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @IknowQT said in How to display a specific pop-up window and then proceed with an internal procedure:

                      Can I see an example of a non-blocking implementation?

                      What example do you need to show how to call show()?

                      void wBusyDialog::Show(int msec, bool bSingle=false)
                      {
                          this->show();
                      }
                      

                      https://doc.qt.io/qt-5/qwidget.html#show

                      I Offline
                      I Offline
                      IknowQT
                      wrote on last edited by
                      #9

                      @jsulm

                      I'll give it a try.

                      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