mainwindow.cpp

来自「gx 公司的2410-ep qt试验源代吗。 还有说明文档。」· C++ 代码 · 共 30 行

CPP
30
字号
/****************************************************************************
** $Id: /sample/3/mainwindow.cpp   2.3.2   edited 2004-10-12 $
**
** Copyright (C) 2004-2005 OURSELEC AS.  All rights reserved.
**
** This file is part of an example program for Qt.  This example
** program may be used, distributed and modified without limitation.
**
*****************************************************************************/
#include "mainwindow.h"

MainWindow::MainWindow( QWidget *parent, const char *name):
		QWidget( parent, name )
{
	QFont f( "Helvetica", 14, QFont::Bold );
    	setFont( f );
	AddButton = new QPushButton( "Add", this );
	AddButton->setGeometry( 50, 15, 90, 40 );
	SubButton = new QPushButton( "Sub", this );
	SubButton->setGeometry( 50, 70, 90, 40 );

	counter = new Counter( this );
	counter->setGeometry( 50, 125, 90, 40 );

	QObject::connect( AddButton, SIGNAL( clicked() ),
			counter, SLOT( IncCounter() ) );
	QObject::connect( SubButton, SIGNAL( clicked() ),
			counter, SLOT( DecCounter() ) );
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?