Maybe bug in QScrollArea::setWidgetResizable(true)
-
Please check the following sample code:
@
#include <QApplication>
#include <QVBoxLayout>
#include <QPushButton>
#include <QCheckBox>
#include <QTextEdit>
#include <QTabWidget>
#include <QScrollArea>int main (int argc, char * argv[])
{
QApplication app(argc, argv);
QTabWidget tab;
QWidget* window = new QWidget;
QVBoxLayout* layout = new QVBoxLayout(window);
QPushButton* optsButton = new QPushButton("Options");
QPushButton* exitButton = new QPushButton("Exit");
QCheckBox* chkBox = new QCheckBox("Checkbox");
QTextEdit* textEd1 = new QTextEdit;
QTextEdit* textEd2 = new QTextEdit;
layout->addWidget(textEd1);
layout->addWidget(textEd2);
layout->addWidget(chkBox);
layout->addWidget(optsButton);
layout->addWidget(exitButton);QObject::connect(exitButton, SIGNAL(clicked()), &app, SLOT(quit()));
QScrollArea* scr = new QScrollArea;
scr->setWidget(window);
// scr->setWidgetResizable(true);tab.addTab(scr, "Tab1");
#if defined(Q_WS_S60)
tab.showMaximized();
#else
tab.show();
#endif
return app.exec();
}
@It creates the several text edits and buttons in the tab inside the scroll area widget. It works fine on s60v3 devices (I can move focus, select and insert text). But when I set 'QScrollArea::widgetResizable' to 'true', entire widget in the 'QScrollArea' doesn't response on cursor keys and doesn't allow editing.
Both 'QScrollArea' and 'QTabWidget' works fine separately.
This case is only reproducible on S60 v3 devices (I've reproduced it on E72, which is S60v3 FP2).
Is this Qt bug, or maybe I did something wrong?
-VP
-
Did you uncomment the 30th line? I tried to run this code on Simulator and observed the same result. I'm using 4.6.3 (the latest) version of Qt for Symbian.
PS: just installed Nokia Qt SDK and on non touch devices I observed the same result - can't navigate between elements.