Here there is a good working example of how to embed Nokia's GalleryCore library widgets to invoke the pictures grid and select an item:
https://meego.gitorious.org/meegotou...inesslogic.cpp
https://meego.gitorious.org/meegotou...usinesslogic.h
Basically, create an image content provider as in:
https://meego.gitorious.org/meegotou...ntprovider.cpp
https://meego.gitorious.org/meegotou...tentprovider.h
https://meego.gitorious.org/meegotou...ntprovider_p.h
And, then, create a GalleryModel feeded with this image content provider:
Code:
...
m_GalleryModel = new GalleryModel (this);
m_ImageContentProvider = new ImageContentProvider (*m_GalleryModel);
m_GalleryModel->addContentProvider (m_ImageContentProvider);
m_GalleryGridPage = new GalleryGridPage (*m_GalleryModel);
m_GalleryGridPage->setMemorySavingMode (true);
m_GalleryGridPage->setStyleName(
QLatin1String("CommonApplicationPageInverted"));
m_GalleryGridPage->selectItem();
...
connect (m_GalleryGridPage, SIGNAL(itemSelected(QUrl)),
this, SLOT(onGridPageItemSelected(QUrl)));
connect (m_GalleryGridPage, SIGNAL(singleSelectionCancelled()),
this, SLOT(onGridPageCancelled()));
...
Then, make the GalleryPage to appear in this way:
Code:
...
if (m_GalleryGridPage)
m_GalleryGridPage->sheet().appear (
MApplication::instance()->activeWindow(),
MSceneWindow::KeepWhenDone);
...
Then, just handle the emitted signals:
Code:
...
void
MyObject::onGridPageItemSelected (
QUrl url)
{
// Whatever I want to do with the "url"
}
void
MyObject::onGridPageCancelled ()
{
if (m_GalleryGridPage)
m_GalleryGridPage->sheet().disappear();
}
...