Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-6406

QProgressBar.setValue causes a stackoverflow

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P1: Critical
    • 4.7.1
    • 4.5.2
    • None
    • WinCE6 x86 Qt 4.5.2

    Description

      Following Code causes a Stackoverflow on WinCe but works well on WinXP:

      class MainWnd : public QWidget
      {
      	int m_Max;
      	int m_Value;
      	int m_TimerId;
      
      	QProgressBar* m_pProgressBar;
      
      public:
      	MainWnd()
      		:m_pProgressBar(NULL)
      		,m_Max( 10)
      		,m_Value( 0)
      	{
      		m_pProgressBar = new QProgressBar( this);
      		m_pProgressBar->setRange( 0, m_Max-1);
      		m_TimerId = startTimer( 100);
      		m_pProgressBar->setFixedWidth( this->width());
      	}
      
      protected:
      
      	virtual void timerEvent ( QTimerEvent * event ){
      		if(event->timerId() == m_TimerId){
      			if( m_Value < m_Max){
      				++m_Value;
      				m_pProgressBar->setValue( m_Value);
      			}else{
      				close();
      			}
      		}
      		QObject::timerEvent( event);
      	}
      };
      
      int main(int argc, char *argv[])
      {
      	QApplication app(argc, argv);
      	MainWnd mWnd;
      	mWnd.show();
      	app.exec();
      }
      

      Attachments

        1. .qmake.cache
          1 kB
        2. configure.cache
          0.1 kB
        3. screenshot-1.jpg
          screenshot-1.jpg
          68 kB
        4. screenshot-2.jpg
          screenshot-2.jpg
          50 kB
        5. WceProgress.zip
          3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jbornema Joerg Bornemann
            nhersche Niklaus Hersche
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes