zoukankan      html  css  js  c++  java
  • QT学习之路--创建一个对话框

      Q_OBJECT:这是一个宏,凡是定义信号槽的类都必须声明这个宏.

      函数tr()全名是QObject::tr(),被他处理过的字符串可以使用工具提取出来翻译成其他语言,也就是做国际化使用。

    对于QT学习之路:Qt学习之路(7):创建一个对话框(上)这个程序。编译出现

     invalid use of incomplete type ‘class QPushButton’
      findButton->setEnabled(!text.isEmpty());
                ^
    In file included from /usr/include/qt5/QtWidgets/QDialog:1:0,
                     from finddialog.h:4,
                     from finddialog.cpp:3:
    /usr/include/qt5/QtWidgets/qdialog.h:52:7: error: forward declaration of ‘class QPushButton’
     class QPushButton;


    解决办法:  

    1.he error should come from your .pro file since your are using Qt5 you should include:

    QT += widgets

    Change all instances of

    #include <QtGui>

    to

    #include <QtWidgets>

     函数 tr()全名是
    QObject::tr(),被它处理的字符串可以使用工具提取出来翻译成其他语言,也就是做国际化使用。

    字符串中的&代表快捷键。

  • 相关阅读:
    HIVE的基本操作
    sqoop数据迁移
    工作流调度器azkaban
    C/s模式与B/S模式
    自动装箱和拆箱所带来的问题(1)“==”问题
    线程死锁
    模拟售票
    线程之间的通信
    线程同步引发的安全问题
    sql server 与 mysql在自定以数据类型的区别
  • 原文地址:https://www.cnblogs.com/Caden-liu8888/p/5916390.html
Copyright © 2011-2022 走看看