zoukankan      html  css  js  c++  java
  • 报错18:28:21: Debugging starts QLayout: Attempting to add QLayout ““ to MainWindow “MainWindow“, which

    18:28:21: Debugging starts
    QLayout: Attempting to add QLayout “” to MainWindow “MainWindow”, which already has a layout

    问题原因:
    If MainWindow is a QMainWindow and you build centralWidget in MainWindow just call setCentralWidget(centralWidget);

    You can’t set a layout on a QMainWindow because it already has one that makes all the work for dock widgets etc.

    QMainWindow 本身已经有一个layout了,不能再设置layout了。
    之所以报错,是因为在QMainWindow中某个成员函数中,使用了:

    QGridLayout *t_gridLayout_map = new QGridLayout(this);
    改进措施:
    QGridLayout *t_gridLayout_map = new QGridLayout();
    去掉this之后,OK!!!
    ————————————————
    版权声明:本文为CSDN博主「老王123456789」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/weixin_43577616/article/details/115769477

  • 相关阅读:
    实现毛玻璃效果
    iOS-调用系统的短信和发送邮件功能,实现短信分享和邮件分享
    集成环信
    HTTP 方法:GET 对比 POST
    虚拟DOM
    javascript的回调函数 同步 异步
    jQuery中的Deferred和promise
    web性能
    JSONP
    java
  • 原文地址:https://www.cnblogs.com/laowang001/p/14668354.html
Copyright © 2011-2022 走看看