#include <qapplication.h>
#include <qpushbutton.h>
#include <qfont.h>
class MyWidget : public QWidget
{
public:
MyWidget( QWidget *parent=0, const char *name=0 );
};
MyWidget::MyWidget( QWidget *parent, const char *name )
: QWidget( parent, name )
{
// setMinimumSize( 200, 120 );
//setMaximumSize( 200, 120 );
//QPushButton *quit = new QPushButton( "Quit", this, "quit" );
QPushButton *quit = new QPushButton( "quit", this );
quit->setGeometry( 62, 40, 75, 30 );
quit->setFont( QFont( "Times", 18, QFont::Bold ) );
connect( quit, SIGNAL(clicked()), qApp, SLOT(quit()) );
}
int main( int argc, char **argv )
{
QApplication a( argc, argv );
MyWidget w;
w.setGeometry( 100, 100, 200, 120 );
//a.setMainWidget( &w );
w.show();
return a.exec();
}
错误是
“QWidget::QWidget(QWidget *,Qt::WindowFlags)”: 不能将参数 2 从“const char *”转换为“Qt::WindowFlags”
qq_遁去的一_1
森林海
郎朗坤
哆啦的时光机
随时随地看视频慕课网APP