Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在项目中有两种形式:mainwindow.ui和mydialog.ui。 每个都有 .hpp 和 cpp 文件。 mainwindow.cpp文件有QList对象。 我按下主窗口窗体上的按钮,出现模态mydialog窗体。 然后我按下mydialog表单上的按钮并运行。on_btnCreate_clicked()
QList
on_btnCreate_clicked()
是否可以访问插槽中的QList对象?on_btnCreate_clicked()
如果是,那么如何?
void MainWindow::on_btnCreate_clicked() { MyDialog dialog; dialog.setList(m_qList); // add member setList to your MyDialog class dialog.exec(); }