QT signal

    connect(ui.exitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
    connect(ui.aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
    //ui.editStyleAction产生triggered信号,触发this的editStyleSheet()方法
    connect(ui.editStyleAction,SIGNAL(triggered()),this,SLOT(editStyleSheet()));

 

void MainWindow::editStyleSheet(){
        styleSheetEditor->show();
        styleSheetEditor->activateWindow();
}

你可能感兴趣的:(Signal)