void PluginView::onItemActivated(const QModelIndex &index) { QVariantMap type = index.data(PluginNavModel::ValueRole).toMap(); if (type.isEmpty()) { showSearchDialog(); } else if (type.value("type") == Resources::CATEGORY) { showCategories(index.data(PluginNavModel::NameRole).toString(), type.value("id").toString()); } else if (type.value("type") == Resources::PLAYLIST) { showPlaylists(index.data(PluginNavModel::NameRole).toString(), type.value("id").toString()); } else if (type.value("type") == Resources::USER) { showUsers(index.data(PluginNavModel::NameRole).toString(), type.value("id").toString()); } else { showVideos(index.data(PluginNavModel::NameRole).toString(), type.value("id").toString()); } }
CVideoWindow::CVideoWindow(QWidget* parent, Qt::WFlags flags) { this->parent = parent; ui.setupUi(this); flags |= Qt::FramelessWindowHint; setWindowFlags(flags); QPalette plt = palette(); plt.setColor(QPalette::Background, QColor("black")); setPalette(plt); setGeometry(0, 0, 720, 576); videoButtonlist.append(ui.video_1); videoButtonlist.append(ui.video_2); videoButtonlist.append(ui.video_3); videoButtonlist.append(ui.video_4); videoButtonlist.append(ui.video_5); videoButtonlist.append(ui.video_6); interestLabelList.append(ui.interest_1); interestLabelList.append(ui.interest_2); interestLabelList.append(ui.interest_3); interestLabelList.append(ui.interest_4); interestLabelList.append(ui.interest_5); interestLabelList.append(ui.interest_6); haveLabelList.append(ui.have_1); haveLabelList.append(ui.have_2); haveLabelList.append(ui.have_3); haveLabelList.append(ui.have_4); haveLabelList.append(ui.have_5); haveLabelList.append(ui.have_6); videoLayoutList.append(ui.verticalLayout_1); videoLayoutList.append(ui.verticalLayout_2); videoLayoutList.append(ui.verticalLayout_3); videoLayoutList.append(ui.verticalLayout_4); videoLayoutList.append(ui.verticalLayout_5); videoLayoutList.append(ui.verticalLayout_6); connect(ui.nextButton, SIGNAL(clicked()), this, SLOT(addPages())); connect(ui.nextButton, SIGNAL(clicked()), this, SLOT(showVideos())); connect(ui.previousButton, SIGNAL(clicked()), this, SLOT(subPages())); connect(ui.previousButton, SIGNAL(clicked()), this, SLOT(showVideos())); CConfig::PAGE = 0; showVideos(); connect(ui.backButton, SIGNAL(clicked()), parent, SLOT(backFromContent())); foreach (QToolButton* everyone, videoButtonlist) { QFont font("Microsoft YaHei", 18); font.setBold(true); everyone->setFont(font); if (CConfig::isPlay) { connect(everyone, SIGNAL(clicked()), this, SLOT(play())); } else { connect(everyone, SIGNAL(clicked()), this, SLOT(choose())); } }