Results 1 to 16 of 16

Thread: ScrollBar is not moving properly when I use TAB

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2007
    Posts
    16
    Thanked 1 Time in 1 Post

    Default ScrollBar is not moving properly when I use TAB

    Hi

    In my application, multiple of QLineEdit widgets are added to Vertical List(QVBoxLayout). I also enabled Vertical Scroll Bar.

    Please see attached jpeg file image. I would like to know how to solve this kind of problems.

    Thanks
    C V rao
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: ScrollBar is not moving properly when I use TAB

    Do you use a scroll area or something like that? Could you provide more details?

  3. #3
    Join Date
    May 2007
    Posts
    16
    Thanked 1 Time in 1 Post

    Default Re: ScrollBar is not moving properly when I use TAB

    Yes I used ScrollArea and set the properties to scroll area

    m_scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysO ff);
    m_scrollArea->setWidgetResizable(true);
    m_scrollArea->setLineWidth(0);
    m_scrollArea->setFixedHeight(191);
    m_scrollArea->setWidget(emailVListArea);
    m_scrollArea->setFixedSize(780,191);
    no_pixestoJump = TOP_SPACING + fromLabel->size().height() + (BUTTON_HEIGHT - EMAILAPP_BUTTON_HEIGHT) + fromEditBox->size().height()
    m_scrollArea->verticalScrollBar()->setSingleStep(no_pixestoJump);


    If I use mouse, scroll bar moving correctly means jumping no_pixestoJump up or down.
    When I use TAB same thing is not happen, it is moving incorrectly...

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: ScrollBar is not moving properly when I use TAB

    Why should it scroll if you use tab?

  5. #5
    Join Date
    May 2007
    Posts
    16
    Thanked 1 Time in 1 Post

    Default Re: ScrollBar is not moving properly when I use TAB

    My question is Children widgets of ScrollArea is not shown properly when I use TAB.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: ScrollBar is not moving properly when I use TAB

    Did you implement that somehow? What about the tab order, does it work?

  7. #7
    Join Date
    May 2007
    Posts
    16
    Thanked 1 Time in 1 Post

    Default Re: ScrollBar is not moving properly when I use TAB

    Tab order is working fine.
    If I press Vertical Scroll Bar Up/Down buttons, Scroll Area Filelds are moving X pixes Up/Down , X is an integer argument passed to verticalScrollBar()->setSingleStep(X).

    But When I use Tab ,the child widgets of scroll area are not shown properly.

    Exmple: I have 7 QLineEdit widgets in my scroll area. let say Scroll Area can hold only 5 QLineEdit widgets at any time.

    When I use Tab focus come to 1 st QLineEdit
    Again Tab, focus come to 2nd QLineEdit
    Again Tab, focus come to 3rd QLineEdit
    Again Tab, focus come to 4th QLineEdit
    Again Tab, focus come to 5th QLineEdit
    Till this point Childwidgets are not moved up. This is correct as ScrollAre hold 5 LineEdits Widgets.

    Again Tab, focus come to 6th QLineEdit.
    Expected Behaviour: First QLineEdit is showing half.
    Wanted Behaviour : First QlineEdit should go up fully. 2,3,4,5,6 QlineEdit widgets should show.

    How do I implement the above wanted behaviour?

    Thanks
    C V Rao

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: ScrollBar is not moving properly when I use TAB


  9. #9
    Join Date
    May 2007
    Posts
    16
    Thanked 1 Time in 1 Post

    Default Re: ScrollBar is not moving properly when I use TAB

    I use above function like this,

    m_scrollArea->ensureWidgetVisible(QLineEdit,100,100);

    No effect in GUI behavioour....

    How Do I use, this function QScrollArea::ensureWidgetVisible. Do I need check everytime?

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: ScrollBar is not moving properly when I use TAB

    Do you need to check what? When you want a particular widget to be visible, just call this method with appropriate parametres.

  11. #11
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: ScrollBar is not moving properly when I use TAB

    Quote Originally Posted by chikkireddi View Post
    I use above function like this,

    m_scrollArea->ensureWidgetVisible(QLineEdit,100,100);

    No effect in GUI behavioour....

    How Do I use, this function QScrollArea::ensureWidgetVisible. Do I need check everytime?
    Are you sure the widget is a direct child of the scroll area?

  12. #12
    Join Date
    May 2007
    Posts
    16
    Thanked 1 Time in 1 Post

    Default Re: ScrollBar is not moving properly when I use TAB

    The hierarchy is as follows.

    QLineEdit is added to QBoxVLayout
    QBoxVLayout is added to QWidget
    QWidget is added QScrollArea.


    So QLineEdit is child of QScrollArea.

    When I use Tab, then it should call ensureWidgetVisible(). How can I implement this?

    Thanks and Regards
    C V Rao

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.