Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Application hangs after using up/down arrows in scrollbar of scrollarea widget
QtWS25 Last Chance

Application hangs after using up/down arrows in scrollbar of scrollarea widget

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
14 Posts 4 Posters 465 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.
  • S SGaist
    19 Mar 2025, 19:20

    Hi,

    Did you set any configuration on the scroll area's QScrollBars ?
    How big is it ?

    V Offline
    V Offline
    Vidya H
    wrote on 20 Mar 2025, 09:11 last edited by Vidya H
    #3

    @SGaist , below is a snippet of the scroll area properties. Label "lblSysInfoSystemName" is available in the below snippet for reference. The area is huge with multiple such labels.

    Please note that this is a multi-threaded application.

    <widget class="QScrollArea" name="scrollArea">
        <property name="geometry">
         <rect>
          <x>14</x>
          <y>198</y>
          <width>996</width>
          <height>290</height>
         </rect>
        </property>
        <property name="styleSheet">
         <string notr="true">QScrollArea QWidget
    {   
        background-color:rgba(0,0,0,0);
    }
    
    
    /******************************* ScrollBar Vertical ***********************************/
    
    QScrollBar:vertical 
    {
      border-color:rgb(76,76,76);
      border-radius: 8px;
      background-color:rgb(76,76,76);
      width:65px;
      margin: 0px 0px 0px 5px;
    }
    
    QScrollBar::handle:vertical 
    {
      background-color: rgb(100, 191, 187);
      min-height: 50px;
      border-radius: 8px;
      margin: 60px 5px 60px 5px;
    }
    
    QScrollBar::handle:vertical:disabled 
    {
      background-color:rgb(76,76,76);
      min-height: 50px;
      border-radius: 8px;
      margin: 60px 5px 60px 5px;
    }
    
     QScrollBar::add-line:vertical
    {
       background-color: rgb(76,76,76);
       height: 56px;
       subcontrol-position: bottom;
       subcontrol-origin: margin;
       margin: 0px 0px 0px 5px; 
       border-bottom-right-radius:8px;
    	border-bottom-left-radius:8px;
    }
    
    QScrollBar::add-line:vertical::pressed
    {
       background-color: rgb(100, 191, 187);
       height: 56px;
       subcontrol-position: bottom;
       subcontrol-origin: margin;
       margin: 0px 0px 0px 5px; 
     border-bottom-right-radius:8px;
    	border-bottom-left-radius:8px;
    }
    
    QScrollBar::sub-line:vertical 
    {
       background-color:rgb(76,76,76);
       height: 56px;
       subcontrol-position: top;
       subcontrol-origin: margin;
        margin: 0px 0px 0px 5px;
    	border-top-right-radius:8px;
    	border-top-left-radius:8px;
    }
    
    QScrollBar::sub-line:vertical::pressed
    {
       background-color: rgb(100, 191, 187);
      height: 56px;
       subcontrol-position: top;
       subcontrol-origin: margin;
        margin: 0px 0px 0px 3px;
    	border-top-right-radius:8px;
    	border-top-left-radius:8px;
    }
    
    QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical 
    {
       background-color: none;
    }
    
    QScrollBar::up-arrow:vertical
    {
    	image:url(:/new/Images/resources/UIImages/UpArrowWhite.png);
    	margin-top:2px;
    }
    
    QScrollBar::up-arrow:vertical::pressed
    {
    	image:url(:/new/Images/resources/UIImages/UpArrowWhite.png);
    	margin-top:2px;
    }
    
    QScrollBar::up-arrow:vertical:disabled
    {
      image: none;
    }
    
    QScrollBar::down-arrow:vertical
    {
     	image:url(:/new/Images/resources/UIImages/DownArrowWhite.png);
    	margin-bottom:2px;
    }
    
    QScrollBar::down-arrow:vertical::pressed
    {
      image:url(:/new/Images/resources/UIImages/DownArrowWhite.png);
    	margin-bottom:2px;
    }
    QScrollBar::down-arrow:vertical:disabled
    {
      image: none;
    }
    </string>
        </property>
        <property name="verticalScrollBarPolicy">
         <enum>Qt::ScrollBarAsNeeded</enum>
        </property>
        <property name="sizeAdjustPolicy">
         <enum>QAbstractScrollArea::AdjustIgnored</enum>
        </property>
        <property name="widgetResizable">
         <bool>true</bool>
        </property>
        <widget class="QWidget" name="scrollAreaWidgetContents">
         <property name="geometry">
          <rect>
           <x>0</x>
           <y>0</y>
           <width>980</width>
           <height>1955</height>
          </rect>
         </property>
         <property name="minimumSize">
          <size>
           <width>0</width>
           <height>1955</height>
          </size>
         </property>
         <widget class="QLabel" name="lblSysInfoSystemName">
          <property name="geometry">
           <rect>
            <x>0</x>
            <y>0</y>
            <width>552</width>
            <height>55</height>
           </rect>
          </property>
          <property name="font">
           <font>
            <family>Helvetica LT</family>
            <pointsize>17</pointsize>
           </font>
          </property>
          <property name="styleSheet">
           <string notr="true">/**************** Label *************************/
    
    
    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 20 Mar 2025, 20:27 last edited by
      #4

      How huge is this QScrollArea ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • V Offline
        V Offline
        Vidya H
        wrote on 21 Mar 2025, 10:12 last edited by
        #5

        7dfe986e-ee5a-4ab8-b964-2bbcf2d2abe1-image.png

        This is how the screen looks like. I have hidden sensitive information.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 21 Mar 2025, 20:07 last edited by
          #6

          Can you provide a minimal compilable example that reproduces this behavior ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • V Offline
            V Offline
            Vidya H
            wrote on 22 Mar 2025, 05:08 last edited by Vidya H
            #7

            I tested the example code in Qt and it works fine on the target board. I am using linuxfb platform. Could this be something to do with the environment variables?

            1 Reply Last reply
            0
            • V Offline
              V Offline
              Vidya H
              wrote on 25 Mar 2025, 11:12 last edited by
              #8

              @SGaist , could you please help on this issue? Is this due to Qt framework or my application or root file system or environment variables setting? I want to narrow down the issue.

              S 1 Reply Last reply 25 Mar 2025, 15:21
              0
              • O Offline
                O Offline
                OZVID Technologies
                wrote on 25 Mar 2025, 11:43 last edited by
                #9
                This post is deleted!
                1 Reply Last reply
                0
                • V Vidya H
                  19 Mar 2025, 15:52

                  I am running a Qt5.15 based application on a embedded Linux platform target. I have a QScrollArea widget to display particular information. There is a scrollbar with up and down arrows.

                  When I use the scrollbar, the scrolling is smooth. However, when I press and hold the up/down arrow, it starts to scroll and within few seconds, the UI hangs.

                  Please suggest how to fix this. Let me know if further details are required.

                  E Offline
                  E Offline
                  ElizabethTurner
                  wrote on 25 Mar 2025, 14:54 last edited by
                  #10
                  This post is deleted!
                  1 Reply Last reply
                  0
                  • V Vidya H
                    25 Mar 2025, 11:12

                    @SGaist , could you please help on this issue? Is this due to Qt framework or my application or root file system or environment variables setting? I want to narrow down the issue.

                    S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 25 Mar 2025, 15:21 last edited by
                    #11

                    @Vidya-H If the Qt example is working properly on the target then it means that something is wrong with your application.

                    Not knowing more about it, one classical way to find the issue is to remove everything from the application then add gradually things back until it breaks again.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • V Offline
                      V Offline
                      Vidya H
                      wrote on 26 Mar 2025, 08:19 last edited by
                      #12

                      Okay. I added delay of 20 millisecond when scroll bar value changed. I am seeing performance improvement with this. The application hang frequency has reduced drastically. Is this a correct approach? Please suggest.

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 26 Mar 2025, 19:11 last edited by
                        #13

                        No it's not a correct approach.
                        You have to find what is currently slowing down your application.
                        Like I wrote above, the most basic version of it is starting from scratch adding your elements one at a time to determine what is going wrong.
                        Another option is to instrument your application and analyse it with a tool such as Hotspot.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • V Offline
                          V Offline
                          Vidya H
                          wrote on 27 Mar 2025, 05:37 last edited by
                          #14

                          Thank you for the support. I will use this tool for further analysis.

                          1 Reply Last reply
                          0

                          12/14

                          26 Mar 2025, 08:19

                          • Login

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