欧卡2中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

需要三步,才能开始

只需两步,慢速开始

欧卡2入门方向盘选莱仕达V9莱仕达折叠便携游戏方向盘支架欢迎地图Mod入驻
查看: 6882|回复: 0
收起左侧

[编程] QVbox: No such file or directory

[复制链接]
知行 发表于 2013-8-23 18:49 | 显示全部楼层 |阅读模式
再QT4的编译环境中编Qt3的教程家庭价值时候,出现qvbox.h”: No such file or directory
The QVBox class is now only available as Q3VBox in Qt 4. You can achieve the same result as QVBox by creating a QWidget with a vertical layout:
网上是这样解决的:
#include <qapplication.h>
#include <qpushbutton.h>
#include <qfont.h>
#include <qboxlayout.h>

int main( int argc, char **argv )
{
    QApplication a( argc, argv );

    QWidget window;               //定义一窗口
    window.resize(200,120);    //窗口大小

    QVBoxLayout layout;         //竖着排设计类

    QPushButton quit( "Quit", &window );                                                //退出按钮
    quit.setFont( QFont( "Times", 18, QFont::Bold ) );                             //字体
    QObject::connect( &quit, SIGNAL(clicked()), &a, SLOT(quit()) );      // 按钮按下既是退出信号

    layout.addWidget(&quit);                          //
   
    window.setLayout(&layout);                      //
    window.show();

    return a.exec();
}
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

联系我们|手机版|欧卡2中国 ( 湘ICP备11020288号-1 )

GMT+8, 2024-5-17 17:38 , Processed in 0.044106 second(s), 8 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表