Example #1
0
//    if(ui->listWidget_2->item(originalRowIndex)->text()!=originalText){
//        ui->listWidget_2->setCurrentRow(0);
//        return;
//    }
//    ui->listWidget_2->setCurrentRow(originalRowIndex);
        ui->listWidget_2->setCurrentRow(0);
}

void MainWindow::initSignalsAndSlots()
{
    //双击表格某单元格,根据该行id,从数据库里读取信息
    connect(ui->tableWidget,SIGNAL(cellDoubleClicked(int,int)),this,SLOT(showText(int,int)));
    connect(ui->tableWidget,SIGNAL(cellClicked(int,int)),this,SLOT(updateTheRightSideBar(int,int)));
    connect(ui->menu_action_add_file,SIGNAL(triggered()),this,SLOT(addFile()));

    connect(ui->menu_action_remove_file,SIGNAL(triggered()),this,SLOT(removeDocument()));
    connect(ui->menu_action_add_category,SIGNAL(triggered()),this,SLOT(addCategory()));
    connect(ui->menu_action_remove_category,SIGNAL(triggered()),this,SLOT(removeCategory()));
    connect(ui->menu_action_change_category,SIGNAL(triggered()),this,SLOT(changeCategory()));
    connect(ui->menu_action_manual_input,SIGNAL(triggered()),this,SLOT(manual_input()));
    connect(ui->menu_action_addto_favorite,SIGNAL(triggered()),this,SLOT(add_to_favorite()));
    connect(ui->menu_action_remove_favorite,SIGNAL(triggered()),this,SLOT(remove_outof_favorite()));
    connect(searchSquare,SIGNAL(returnPressed()),this,SLOT(search()));
    connect(ui->menu_action_about,SIGNAL(triggered()),this,SLOT(about()));

    connect(ui->menu_action_open_file,SIGNAL(triggered()),this,SLOT(openFile()));
}

void MainWindow::showText(int a, int b)
{
    QMessageBox::about(this,"Tsignal",ui->tableWidget->item(a,b)->text());
void pTabbedWorkspace::removeDocument( QObject* o )
{ removeDocument( qobject_cast<QWidget*>( o ) ); }