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
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
Do you use a scroll area or something like that? Could you provide more details?
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...
Why should it scroll if you use tab?
My question is Children widgets of ScrollArea is not shown properly when I use TAB.
Did you implement that somehow? What about the tab order, does it work?
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
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?
Do you need to check what? When you want a particular widget to be visible, just call this method with appropriate parametres.
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