从QT中的对话框访问主窗口
access main window from dialog in qt
在主窗口中,他们的laneDit_1和对话框中的landit_2。单击按钮后,对话框窗口将打开。现在,我需要LENEDIT_2在主窗口中获取landedit_1的值。
(主窗口类是MainWindow
,对话框窗口类是dialog
)
我试图这样做,但是它给出了一个错误 error: ISO C++ forbids declaration of 'MainWindow' with no type
对话框
MainWindow *main; //declair a pointer to the main window
dialog.cpp
lineEdit_2->setText(main->lineEdit_1->text());
这里有什么错误。
我会非常感谢任何建议。谢谢。
void dialog::lineText(QString text){
lineEdit_text = text; //let lineEdit_text be a QString member in your
//dialog class. Pass the text before calling
//setVisible() in the client code
}
相关文章:
- Qt:从另一个窗口访问公共对象
- Qt5 ui,多个窗口:如何从窗口 1 访问窗口 2 中的 UI 对象
- 在窗口过程包装器中阅读访问违规
- 读取访问违规当前为0xCDCDCDCD,链接列表窗口
- 将WM_CHANGEUISTATE发送到窗口应用程序后,当用鼠标访问菜单时,助记符不会显示在系统菜单上
- SFML FPS访问窗口事件的问题
- 从QT中的对话框访问主窗口
- 如何从窗口功能外部访问wm_command
- 如何从另一个窗口访问窗口的小部件
- Qt C++从另一个类访问窗口方法
- 是否可以访问wxHaskell中的底层窗口类型
- 如何在另一个窗口中访问主窗口的值?(Qt 5.0.2)
- 检查用户名是否有权访问窗口上的文件夹
- 在 Visual Studio 的即时窗口中访问'cmath'函数
- 从另一个小部件访问主窗口中的文本框
- 通过按钮访问父窗口小部件的变量
- Qt-如何从另一个子窗口或小工具访问主窗口
- Qt:如何访问在主窗口上按id拖动的元素
- 从窗口类访问应用程序变量的正确/可接受的设计是什么
- 如何访问窗口的内部位图