Hello all.
I have an issue with scrolling.
This code works fine on the windows platform but it does not scroll on the Symbian one.
{
scrollArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
scrollArea
->setFrameStyle
( QFrame::NoFrame );
scrollWidget->setLayout(verticalLayout);
QLabel* label
= new QLabel( "After university in 1977, she joined the Radio Times as a sub-editor before moving in 1978 to the Times Higher Education Supplement as the deputy literary editor. She began freelance writing at the same time. Truss was Literary Editor of The Listener (1986–90) and was an arts and books reviewer for The Independent on Sunday before joining The Times in 1991, where first she spent six years writing television criticism, illustrated by John Minnion, followed by four years as a sports columnist. She won Columnist of the Year for her work for Woman's Journal. She now reviews books for The Sunday Times. Her book Eats, Shoots & Leaves (November 2003), about the misuse of punctuation, became a bestseller in both Britain and the United States. The book's declaration for a Zero Tolerance Approach to Punctuation is considered a rallying call for punctuation sticklers of the world. In 2005 she released a book on rudeness titled Talk to the Hand: the utter bloody rudeness of the world today (or six good reasons to stay home and bolt the door)." );
label->setWordWrap( true );
verticalLayout->addWidget(label);
scrollArea->setWidget(scrollWidget);
horizontalLayout->addWidget( scrollArea );
setLayout( horizontalLayout );
}
Widget::Widget(QWidget *parent)
: QWidget(parent)
{
QScrollArea* scrollArea = new QScrollArea( this );
scrollArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
scrollArea->setFrameStyle( QFrame::NoFrame );
QWidget* scrollWidget = new QWidget(scrollArea);
QVBoxLayout* verticalLayout = new QVBoxLayout(scrollWidget);
scrollWidget->setLayout(verticalLayout);
QLabel* label = new QLabel( "After university in 1977, she joined the Radio Times as a sub-editor before moving in 1978 to the Times Higher Education Supplement as the deputy literary editor. She began freelance writing at the same time. Truss was Literary Editor of The Listener (1986–90) and was an arts and books reviewer for The Independent on Sunday before joining The Times in 1991, where first she spent six years writing television criticism, illustrated by John Minnion, followed by four years as a sports columnist. She won Columnist of the Year for her work for Woman's Journal. She now reviews books for The Sunday Times. Her book Eats, Shoots & Leaves (November 2003), about the misuse of punctuation, became a bestseller in both Britain and the United States. The book's declaration for a Zero Tolerance Approach to Punctuation is considered a rallying call for punctuation sticklers of the world. In 2005 she released a book on rudeness titled Talk to the Hand: the utter bloody rudeness of the world today (or six good reasons to stay home and bolt the door)." );
label->setWordWrap( true );
verticalLayout->addWidget(label);
scrollArea->setWidget(scrollWidget);
QHBoxLayout* horizontalLayout = new QHBoxLayout();
horizontalLayout->addWidget( scrollArea );
setLayout( horizontalLayout );
}
To copy to clipboard, switch view to plain text mode
Seems like wrong widget has focus.
Does anybody know how to fix it. I've tried a lot of variants how to do it, google a lot but without any success.
Could you help me please?
Bookmarks