wkjack 2014-09-11 09:07 采纳率: 0%
浏览 4594

QT 如何在其他cpp文件中调用Mainwindow中的单文本框

MainWindow w2;

QString Starttime = w2.starttime->text();
QString Endtime= w2.endtime->text();
报错信息如下:
src/plot.cpp: In member function 'void Plot::saveToFile()':
src/plot.cpp:222: error: invalid use of incomplete type 'struct QLineEdit'
src/plot.h:17: error: forward declaration of 'struct QLineEdit'
src/plot.cpp:223: error: invalid use of incomplete type 'struct QLineEdit'
src/plot.h:17: error: forward declaration of 'struct QLineEdit'

  • 写回答

1条回答 默认 最新

  • Jan5 2014-10-21 17:51
    关注

    1、建立父子关系
    http://blog.chinaunix.net/uid-29650836-id-4430171.html
    2、使用信号与槽机制
    http://blog.chinaunix.net/uid-29650836-id-4530957.html

    以上链接仅供参考。

    评论

报告相同问题?

悬赏问题

  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿