Hi All
This is my first time to ask questions here. Thanks for your time.
Here is one question I have while doing the UI layout under MTF, please help
to provide your idea.
The goal : Slide the view and then show the hidden components under
setGeometry.
Issue : Use MLinearLayoutPolicy can slide to show the hidden components but
using setGeometry bounces it back.
Here is a simple code for my question.
#include <MApplication>
#include <MApplicationPage>
#include <MApplicationWindow>
#include <MLabel>
#include <MLinearLayoutPolicy>
#include <MLayout>
#include <QObject>
int main(int argc, char **argv)
{
MApplication app(argc, argv);
MApplicationWindow window;
MApplicationPage page;
page.setPanningDirection(Qt::Horizontal | Qt::Vertical);
/* Create a MLayout that we set the policies for */
MLayout *layout = new MLayout(page.centralWidget());
MLinearLayoutPolicy *linearPolicy = new MLinearLayoutPolicy(layout,
Qt::Vertical);
#if 1
for (int i = 0; i < 20; ++i)
{
MLabel *label = new MLabel(QString("Item %1").arg(i + 1));
label->setAlignment(Qt::AlignCenter);
//if (i < 3) // But only add the first 3 items to the linear policy
linearPolicy->addItem(label);
}
#else
for (int i = 0; i < 20; ++i)
{
MLabel *label = new MLabel(QString("Item %1").arg(i +
1),page.centralWidget());\
label->setGeometry(QRectF(100,i*40,200,30));
}
#endif
page.appear();
window.show();
return app.exec();
}
_______________________________________________
MeeGo-dev mailing list
[email protected]
http://lists.meego.com/listinfo/meego-dev