Beispiel #1
0
void BlackWidget::initWidget()
{
    curlDownlaod = new CurlUpload();
    runPath = QCoreApplication::applicationDirPath();
    runPath.append("/platforms/image/" );

    widgetTitle = new QWidget(this);
    label_title = new QLabel(widgetTitle);
    pushButton_cancel = new QPushButton(widgetTitle);
    tableView = new PagingTableView(this);    
    pushButton_checkBox = new QPushButton(tableView);
    pushButton_checkBox->setCheckable(true);

    connect(tableView, &PagingTableView::updateView, this, &BlackWidget::show_black);
    connect(pushButton_checkBox, &QPushButton::clicked, tableView, &PagingTableView::checkBoxIsAll);
    connect(pushButton_cancel, &QPushButton::clicked, this, &BlackWidget::cancelBlackMush);
    connect(tableView, &PagingTableView::currentRow, this, &BlackWidget::cancelBlack);

    connect(tableView, &PagingTableView::play, this, &BlackWidget::play);

    QHeaderView *headerView = tableView->tableView->horizontalHeader();
    QRect rect = headerView->geometry();
    QRect checkBoxRect = QRect(rect.x()+8, rect.y()+12, 16, 16);
    pushButton_checkBox->setGeometry(checkBoxRect);

    widgetTitle->setFixedHeight(60);
    pushButton_cancel->setFixedWidth(90);
    pushButton_cancel->setFixedHeight(36);
    pushButton_cancel->setText("批量取消");
    widgetTitle->setStyleSheet("border-bottom: 1px solid rgb(201, 201, 201);");

    title_layout = new QHBoxLayout();
    title_layout->addWidget(label_title);
    title_layout->addStretch();
    title_layout->addWidget(pushButton_cancel);
    title_layout->setContentsMargins(20, 0, 24, 0);
    title_layout->setSpacing(0);

    widgetTitle->setLayout(title_layout);

    tableView_layout = new QVBoxLayout();
    vLayout = new QVBoxLayout();

    tableView_layout->addWidget(tableView);
    tableView_layout->setContentsMargins(12, 0, 12, 0);
    tableView_layout->setSpacing(0);

    vLayout->addWidget(widgetTitle);
    vLayout->addLayout(tableView_layout);
    vLayout->setContentsMargins(0, 0, 0, 0);
    vLayout->setSpacing(0);

    this->setLayout(vLayout);
}
Beispiel #2
0
SongsQueryWideget::SongsQueryWideget(QWidget *parent)
    : QWidget(parent),
      _sql(NULL)
{    
    initWidget();
    readAndSetStyleSheet();
    initWidgetValue();    

    connect(pushButton_export_excel, &QPushButton::clicked, this, &SongsQueryWideget::export_excel_clicked);
    connect(pushButton_searchSinger, &QPushButton::clicked, this, &SongsQueryWideget::search_singer_clicked);
    connect(pushButton_searchSong, &QPushButton::clicked, this, &SongsQueryWideget::search_song_clicked);
    connect(pushButton_startCalendar, &QPushButton::clicked, this, &SongsQueryWideget::calendar_start_clicked);
    connect(pushButton_endCalendar, &QPushButton::clicked, this, &SongsQueryWideget::calendar_end_clicked);

    connect(calendarStart, &QCalendarWidget::selectionChanged, this, &SongsQueryWideget::setStartDateTime);
    connect(calendarEnd, &QCalendarWidget::selectionChanged, this, &SongsQueryWideget::setEndDateTime);

    connect(tableView_songsQuery, &PagingTableView::updateView, this, &SongsQueryWideget::setMediaValue);
    connect(tableView_songsQuery, &PagingTableView::currentRow, this, &SongsQueryWideget::setSongInfo);
    connect(tableView_songsQuery, &PagingTableView::matchMusic, this, &SongsQueryWideget::setMatchMusic);
    connect(tableView_songsQuery, &PagingTableView::play, this, &SongsQueryWideget::play);
    connect(tableView_songsQuery, &PagingTableView::dele, this, &SongsQueryWideget::deleteMedia);

    connect(comboBox_Language, SIGNAL(currentIndexChanged(QString)), this, SLOT(combobox_currentIndexChanged(QString)));
    connect(comboBox_type, SIGNAL(currentIndexChanged(QString)), this, SLOT(combobox_currentIndexChanged(QString)));
    connect(comboBox_resolution, SIGNAL(currentIndexChanged(QString)), this, SLOT(combobox_currentIndexChanged(QString)));
    connect(comboBox_quality, SIGNAL(currentIndexChanged(QString)), this, SLOT(combobox_currentIndexChanged(QString)));
    connect(comboBox_source, SIGNAL(currentIndexChanged(QString)), this, SLOT(combobox_currentIndexChanged(QString)));
    connect(comboBox_version, SIGNAL(currentIndexChanged(QString)), this, SLOT(combobox_currentIndexChanged(QString)));
    connect(comboBox_rthym, SIGNAL(currentIndexChanged(QString)), this, SLOT(combobox_currentIndexChanged(QString)));
    connect(comboBox_pitch, SIGNAL(currentIndexChanged(QString)), this, SLOT(combobox_currentIndexChanged(QString)));

    initFlag = false;

    pushButton_searchSinger->setShortcut(QKeySequence::InsertParagraphSeparator);
    pushButton_searchSinger->setShortcut(Qt::Key_Enter);
    pushButton_searchSinger->setShortcut(Qt::Key_Return);
//    pushButton_searchSong->setShortcut(QKeySequence::InsertLineSeparator);
//    pushButton_searchSong->setShortcut(Qt::Key_Enter);
//    pushButton_searchSong->setShortcut(Qt::Key_Return);
    pushButton_searchSong->setDefault(true);


    tableView_songsQuery->setShowCheckBox();
    tableView_songsQuery->setQueryMediaDelegate();
    pushButton_checkBox = new QPushButton(tableView_songsQuery);
    pushButton_checkBox->setCheckable(true);
    connect(pushButton_checkBox, &QPushButton::clicked, tableView_songsQuery, &PagingTableView::checkBoxIsAll);
    QHeaderView *headerView = tableView_songsQuery->tableView->horizontalHeader();
    QRect rect = headerView->geometry();
    QRect checkBoxRect = QRect(rect.x()+8, rect.y()+12, 16, 16);
    pushButton_checkBox->setGeometry(checkBoxRect);
    pushButton_checkBox->setObjectName("CheckBoxButton");

    connect(pushButton_addBlack, &QPushButton::clicked, this, &SongsQueryWideget::add_black);


    setTab_order();

#ifndef YQC_TECH
    pushButton_export_excel->setHidden(true);
#else
    pushButton_export_excel->setHidden(false);
#endif
}