Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QMediaMenu Class Reference
[QtMediaModule]

The QMediaMenu class provides a menu system for browsing media content. More...

    #include <QMediaMenu>

Inherits QListView.

Public Functions

Public Slots

Signals

Additional Inherited Members


Detailed Description

The QMediaMenu class provides a menu system for browsing media content.

The QMediaMenu class is useful for displaying media content filtered by Artist, Album, Genre etc.

    QVBoxLayout* layout = new QVBoxLayout;

    QMediaPlaylist playlist(QContentFilter(QContent::Document));
    medialist = new QMediaList(playlist);

    QMediaMenu* mainmenu = new QMediaMenu();

    layout->addWidget(mainmenu);
    setLayout(layout);

    QMediaMenuItem* a = new QMediaMenuItem(new QIcon(":icon/mediaplayer/black/music"), QString("Music"), 0);
    mainmenu->add(a);

    a->add(new QMediaMenuItem(QMediaList::Artist, medialist));
    a->add(new QMediaMenuItem(QMediaList::Album, medialist));
    a->add(new QMediaMenuItem(QMediaList::Genre, medialist));
    a->add(new QMediaMenuItem(QMediaList::Title, medialist));

    QMediaMenuItem* b = new QMediaMenuItem(new QIcon(":icon/mediaplayer/black/videos"), QString("Videos"), medialist);
    mainmenu->add(b);

    QMediaMenuItem* c = (QMediaMenuItem*) new CustomMenuItem(new QIcon(":icon/mediaplayer/black/videos"), QString("Custom"), 0);
    mainmenu->add(c);

    mainmenu->resetMenu();

dataChanged() is emitted when display content changes see signals dataChanged()


Member Function Documentation

QMediaMenu::QMediaMenu ( QWidget * parent = 0 )

Constructs a menu with parent

QMediaMenu::~QMediaMenu ()

Constructs a menu

void QMediaMenu::add ( QMediaMenuItem * item )

Add item to menu

QMediaMenuItem * QMediaMenu::current ()

Return current menu item

void QMediaMenu::playlist ( const QMediaPlaylist & plist )   [signal]

This signal is emitted when a selection has been made plist is a QMediaPlaylist containing the selection.

void QMediaMenu::refreshData ()   [slot]

Updates data and display

void QMediaMenu::remove ( QMediaMenuItem * item )

Remove item from menu

void QMediaMenu::resetMenu ()

Reset menu back to base menu


Copyright © 2009 Trolltech Trademarks
Qt Extended 4.4.3