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. problem when using qstackwidget->setCurrentIndex

problem when using qstackwidget->setCurrentIndex

Scheduled Pinned Locked Moved Unsolved General and Desktop
qstackwidget
5 Posts 2 Posters 512 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.
  • M Offline
    M Offline
    MarkLuo
    wrote on last edited by
    #1

    Dear Sir,
    I have meet a problem when i using qstackwidget. First i new 10 Qwidget to fill the qstackwidget. And actually when i using the qstackwidget, I remove the old one and insert a new one.And the inserted one cantains a quickwidget.
    int i;
    for(i=0;i<APP_KEYSTUDY+1;i++)
    {
    ui->stackedWidget->addWidget(new QWidget(this));
    }

    mMainWindow->getStackedWidget()->removeWidget(mMainWindow->getStackedWidget()->widget(appIndex));
    mMainWindow->getStackedWidget()->insertWidget(appIndex,mApps->at(appIndex)->getContent());

    so the problem is when i using setCurrentIndex to switch page,there is not respond, nothing happen,the screen is black and not picture show.

    mMainWindow->getStackedWidget()->setCurrentIndex(appIndex);

    And when i use gdb to debug this, is shows like below:
    #0 0xb25666e34 in __libc_do_syscall() from /lib/libpthread.so.0
    #1 0xb256727a8 in pthread_cond_wait@@GLIBC_2.4() from /lib/libpthread.so.0
    #2 0xb25d8ae6 in _mali_osu_lock_wait () from /usr/lib/libGLESv2.so
    #3 0xb25d8ae6 in _mali_frame_builder_wait () from /usr/lib/libGLESv2.0.so
    #4 0xb25alc82 in _gles_finish() from /usr/lib/libGLESv2.so
    #5 0xb25982c4 in glFinish() from /usr/lib/libGLESv2.so
    #6 0xb3e51b98 in ?? () from /usr/local/Qt-5.9.7/lib/libQt5QuickWidgets.so.5

    That is the problem,please help to resovle.
    Thanks & Best regards!

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      @MarkLuo said in problem when using qstackwidget->setCurrentIndex:

      mApps->at(appIndex)->getContent()

      Code should work. Only issue I could see is mApps->at(appIndex)->getContent(). See if this returns the correct widget or null ?

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      M 3 Replies Last reply
      0
      • dheerendraD dheerendra

        @MarkLuo said in problem when using qstackwidget->setCurrentIndex:

        mApps->at(appIndex)->getContent()

        Code should work. Only issue I could see is mApps->at(appIndex)->getContent(). See if this returns the correct widget or null ?

        M Offline
        M Offline
        MarkLuo
        wrote on last edited by
        #3

        @dheerendra ok, I will check for this.Thanks!

        1 Reply Last reply
        0
        • dheerendraD dheerendra

          @MarkLuo said in problem when using qstackwidget->setCurrentIndex:

          mApps->at(appIndex)->getContent()

          Code should work. Only issue I could see is mApps->at(appIndex)->getContent(). See if this returns the correct widget or null ?

          M Offline
          M Offline
          MarkLuo
          wrote on last edited by
          #4

          @dheerendra
          HI Dheerendra,
          When our machine startup normal, there are 24 threads. But if the problem happens, there are only 14 threads. So I guess there must be somewhere blocked. And according to the log, it is here:
          mMainWindow->getStackedWidget()->setCurrentIndex(appIndex);

          So is it because of the function named pthread_cond_wait ?
          Thanks for your help!

          1 Reply Last reply
          0
          • dheerendraD dheerendra

            @MarkLuo said in problem when using qstackwidget->setCurrentIndex:

            mApps->at(appIndex)->getContent()

            Code should work. Only issue I could see is mApps->at(appIndex)->getContent(). See if this returns the correct widget or null ?

            M Offline
            M Offline
            MarkLuo
            wrote on last edited by
            #5

            @dheerendra said in problem when using qstackwidget->setCurrentIndex:

            at(appIndex)->getContent().

            hi dheerendra,
            I have checked that getContent() return the correct Widget, any advice?

            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