MainPage::MainPage() : ui(new Ui::MainPage) { ui->setupUi(this); ui->sectionsTable->hideColumn(0); connect(ui->sectionsTable, SIGNAL(clicked(QModelIndex)), this, SLOT(showPhotos(QModelIndex))); connect(ui->photosList, SIGNAL(clicked(QModelIndex)), this, SLOT(showPhoto(QModelIndex))); connect(ui->addSectionButton, SIGNAL(clicked()), this, SIGNAL(addSection())); connect(ui->addPhotoButton, SIGNAL(clicked()), this, SIGNAL(addPhoto())); }
Browser::Browser(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, flags) , gallery(0) , stack(0) , artistView(0) , albumArtistView(0) , albumView(0) , songView(0) , photoView(0) { gallery = new QDocumentGallery; artistView = new ArtistView(QDocumentGallery::Artist, gallery); connect(artistView, SIGNAL(showAlbums(QVariant,QString)), this, SLOT(showAlbums(QVariant,QString))); connect(artistView, SIGNAL(showSongs(QVariant,QString)), this, SLOT(showSongs(QVariant,QString))); albumArtistView = new ArtistView(QDocumentGallery::AlbumArtist, gallery); connect(albumArtistView, SIGNAL(showAlbums(QVariant,QString)), this, SLOT(showAlbums(QVariant,QString))); connect(albumArtistView, SIGNAL(showSongs(QVariant,QString)), this, SLOT(showSongs(QVariant,QString))); albumView = new AlbumView(gallery); connect(albumView, SIGNAL(showSongs(QVariant,QString)), this, SLOT(showSongs(QVariant,QString))); songView = new SongView(gallery); photoView = new PhotoView(gallery); stack = new QStackedWidget; stack->addWidget(artistView); stack->addWidget(albumArtistView); stack->addWidget(albumView); stack->addWidget(songView); stack->addWidget(photoView); menuBar()->addAction(tr("Artists"), this, SLOT(showArtists())); menuBar()->addAction(tr("Album Artists"), this, SLOT(showAlbumArtists())); menuBar()->addAction(tr("Albums"), this, SLOT(showAlbums())); menuBar()->addAction(tr("Songs"), this, SLOT(showSongs())); menuBar()->addAction(tr("Photos"), this, SLOT(showPhotos())); setCentralWidget(stack); #ifdef Q_WS_MAEMO_5 setAttribute(Qt::WA_Maemo5StackedWindow); #endif }