📄 playersdialog.cc
字号:
/****************************************************************************** Form implementation generated from reading ui file 'playersdialog.ui'**** Created: Wed Feb 7 00:21:49 2001** by: The User Interface Compiler (uic)**** WARNING! All changes made in this file will be lost!****************************************************************************/#include "playersdialog.hh"#include <qcheckbox.h>#include <qgroupbox.h>#include <qlabel.h>#include <qlineedit.h>#include <qpushbutton.h>#include <qslider.h>#include <qlayout.h>#include <qvariant.h>#include <qtooltip.h>#include <qwhatsthis.h>/* * Constructs a QPlayersDialog which is a child of 'parent', with the * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */QPlayersDialog::QPlayersDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ){ if ( !name ) setName( "QPlayersDialog" ); resize( 410, 235 ); setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, sizePolicy().hasHeightForWidth() ) ); setMinimumSize( QSize( 410, 235 ) ); setBaseSize( QSize( 300, 300 ) ); QFont f( font() ); f.setFamily( "lucidatypewriter" ); setFont( f ); setCaption( tr( "Players" ) ); QWidget* privateLayoutWidget = new QWidget( this, "Layout14" ); privateLayoutWidget->setGeometry( QRect( 10, 5, 392, 185 ) ); Layout14 = new QVBoxLayout( privateLayoutWidget ); Layout14->setSpacing( 6 ); Layout14->setMargin( 0 ); GroupBox2 = new QGroupBox( privateLayoutWidget, "GroupBox2" ); QFont GroupBox2_font( GroupBox2->font() ); GroupBox2_font.setBold( TRUE ); GroupBox2->setFont( GroupBox2_font ); GroupBox2->setTitle( tr( "Player 1" ) ); QWidget* privateLayoutWidget_2 = new QWidget( GroupBox2, "Layout11" ); privateLayoutWidget_2->setGeometry( QRect( 5, 20, 380, 25 ) ); Layout11 = new QHBoxLayout( privateLayoutWidget_2 ); Layout11->setSpacing( 6 ); Layout11->setMargin( 0 ); TextLabel1 = new QLabel( privateLayoutWidget_2, "TextLabel1" ); TextLabel1->setMinimumSize( QSize( 50, 0 ) ); QFont TextLabel1_font( TextLabel1->font() ); TextLabel1_font.setBold( FALSE ); TextLabel1->setFont( TextLabel1_font ); TextLabel1->setText( tr( "Name" ) ); Layout11->addWidget( TextLabel1 ); name1 = new QLineEdit( privateLayoutWidget_2, "name1" ); name1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)4, name1->sizePolicy().hasHeightForWidth() ) ); QFont name1_font( name1->font() ); name1_font.setBold( FALSE ); name1->setFont( name1_font ); name1->setCursor( QCursor( 4 ) ); Layout11->addWidget( name1 ); human1 = new QCheckBox( privateLayoutWidget_2, "human1" ); QFont human1_font( human1->font() ); human1_font.setBold( FALSE ); human1->setFont( human1_font ); human1->setBackgroundOrigin( QCheckBox::WidgetOrigin ); human1->setText( tr( "Human" ) ); human1->setChecked( TRUE ); Layout11->addWidget( human1 ); QWidget* privateLayoutWidget_3 = new QWidget( GroupBox2, "Layout5" ); privateLayoutWidget_3->setGeometry( QRect( 5, 50, 380, 31 ) ); Layout5 = new QHBoxLayout( privateLayoutWidget_3 ); Layout5->setSpacing( 6 ); Layout5->setMargin( 0 ); TextLabel1_2 = new QLabel( privateLayoutWidget_3, "TextLabel1_2" ); TextLabel1_2->setMinimumSize( QSize( 50, 0 ) ); QFont TextLabel1_2_font( TextLabel1_2->font() ); TextLabel1_2_font.setBold( FALSE ); TextLabel1_2->setFont( TextLabel1_2_font ); TextLabel1_2->setText( tr( "Skill" ) ); Layout5->addWidget( TextLabel1_2 ); skill1 = new QSlider( privateLayoutWidget_3, "skill1" ); skill1->setEnabled( FALSE ); skill1->setCursor( QCursor( 6 ) ); skill1->setMinValue( 1 ); skill1->setMaxValue( 10 ); skill1->setPageStep( 1 ); skill1->setValue( 1 ); skill1->setOrientation( QSlider::Horizontal ); skill1->setTickmarks( QSlider::Right ); skill1->setTickInterval( 1 ); Layout5->addWidget( skill1 ); Layout14->addWidget( GroupBox2 ); GroupBox2_2 = new QGroupBox( privateLayoutWidget, "GroupBox2_2" ); QFont GroupBox2_2_font( GroupBox2_2->font() ); GroupBox2_2_font.setBold( TRUE ); GroupBox2_2->setFont( GroupBox2_2_font ); GroupBox2_2->setTitle( tr( "Player 2" ) ); QWidget* privateLayoutWidget_4 = new QWidget( GroupBox2_2, "Layout11_2" ); privateLayoutWidget_4->setGeometry( QRect( 5, 20, 380, 25 ) ); Layout11_2 = new QHBoxLayout( privateLayoutWidget_4 ); Layout11_2->setSpacing( 6 ); Layout11_2->setMargin( 0 ); TextLabel1_4 = new QLabel( privateLayoutWidget_4, "TextLabel1_4" ); TextLabel1_4->setMinimumSize( QSize( 50, 0 ) ); QFont TextLabel1_4_font( TextLabel1_4->font() ); TextLabel1_4_font.setBold( FALSE ); TextLabel1_4->setFont( TextLabel1_4_font ); TextLabel1_4->setText( tr( "Name" ) ); Layout11_2->addWidget( TextLabel1_4 ); name2 = new QLineEdit( privateLayoutWidget_4, "name2" ); name2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)4, name2->sizePolicy().hasHeightForWidth() ) ); QFont name2_font( name2->font() ); name2_font.setBold( FALSE ); name2->setFont( name2_font ); name2->setCursor( QCursor( 4 ) ); Layout11_2->addWidget( name2 ); human2 = new QCheckBox( privateLayoutWidget_4, "human2" ); QFont human2_font( human2->font() ); human2_font.setBold( FALSE ); human2->setFont( human2_font ); human2->setBackgroundOrigin( QCheckBox::WidgetOrigin ); human2->setText( tr( "Human" ) ); human2->setChecked( TRUE ); Layout11_2->addWidget( human2 ); QWidget* privateLayoutWidget_5 = new QWidget( GroupBox2_2, "Layout5_3" ); privateLayoutWidget_5->setGeometry( QRect( 5, 50, 380, 31 ) ); Layout5_3 = new QHBoxLayout( privateLayoutWidget_5 ); Layout5_3->setSpacing( 6 ); Layout5_3->setMargin( 0 ); TextLabel1_2_3 = new QLabel( privateLayoutWidget_5, "TextLabel1_2_3" ); TextLabel1_2_3->setMinimumSize( QSize( 50, 0 ) ); QFont TextLabel1_2_3_font( TextLabel1_2_3->font() ); TextLabel1_2_3_font.setBold( FALSE ); TextLabel1_2_3->setFont( TextLabel1_2_3_font ); TextLabel1_2_3->setText( tr( "Skill" ) ); Layout5_3->addWidget( TextLabel1_2_3 ); skill2 = new QSlider( privateLayoutWidget_5, "skill2" ); skill2->setEnabled( FALSE ); skill2->setCursor( QCursor( 6 ) ); skill2->setMinValue( 1 ); skill2->setMaxValue( 10 ); skill2->setPageStep( 1 ); skill2->setValue( 1 ); skill2->setTracking( FALSE ); skill2->setOrientation( QSlider::Horizontal ); skill2->setTickmarks( QSlider::Right ); skill2->setTickInterval( 1 ); Layout5_3->addWidget( skill2 ); Layout14->addWidget( GroupBox2_2 ); QWidget* privateLayoutWidget_6 = new QWidget( this, "Layout15" ); privateLayoutWidget_6->setGeometry( QRect( 225, 195, 182, 36 ) ); Layout15 = new QHBoxLayout( privateLayoutWidget_6 ); Layout15->setSpacing( 6 ); Layout15->setMargin( 0 ); b_OK = new QPushButton( privateLayoutWidget_6, "b_OK" ); QFont b_OK_font( b_OK->font() ); b_OK_font.setPointSize( 10 ); b_OK->setFont( b_OK_font ); b_OK->setText( tr( "&Ok" ) ); b_OK->setOn( FALSE ); b_OK->setOn( FALSE ); Layout15->addWidget( b_OK ); b_Cancel = new QPushButton( privateLayoutWidget_6, "b_Cancel" ); QFont b_Cancel_font( b_Cancel->font() ); b_Cancel_font.setPointSize( 10 ); b_Cancel->setFont( b_Cancel_font ); b_Cancel->setText( tr( "Cancel" ) ); Layout15->addWidget( b_Cancel ); // signals and slots connections connect( b_Cancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( b_OK, SIGNAL( clicked() ), this, SLOT( applyChanges() ) ); connect( b_OK, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( human1, SIGNAL( toggled(bool) ), skill1, SLOT( setDisabled(bool) ) ); connect( human2, SIGNAL( toggled(bool) ), skill2, SLOT( setDisabled(bool) ) );}/* * Destroys the object and frees any allocated resources */QPlayersDialog::~QPlayersDialog(){ // no need to delete child widgets, Qt does it all for us}/* * Main event handler. Reimplemented to handle application * font changes */bool QPlayersDialog::event( QEvent* ev ){ bool ret = QDialog::event( ev ); if ( ev->type() == QEvent::ApplicationFontChange ) { QFont GroupBox2_font( GroupBox2->font() ); GroupBox2_font.setBold( TRUE ); GroupBox2->setFont( GroupBox2_font ); QFont TextLabel1_font( TextLabel1->font() ); TextLabel1_font.setBold( FALSE ); TextLabel1->setFont( TextLabel1_font ); QFont name1_font( name1->font() ); name1_font.setBold( FALSE ); name1->setFont( name1_font ); QFont human1_font( human1->font() ); human1_font.setBold( FALSE ); human1->setFont( human1_font ); QFont TextLabel1_2_font( TextLabel1_2->font() ); TextLabel1_2_font.setBold( FALSE ); TextLabel1_2->setFont( TextLabel1_2_font ); QFont GroupBox2_2_font( GroupBox2_2->font() ); GroupBox2_2_font.setBold( TRUE ); GroupBox2_2->setFont( GroupBox2_2_font ); QFont TextLabel1_4_font( TextLabel1_4->font() ); TextLabel1_4_font.setBold( FALSE ); TextLabel1_4->setFont( TextLabel1_4_font ); QFont name2_font( name2->font() ); name2_font.setBold( FALSE ); name2->setFont( name2_font ); QFont human2_font( human2->font() ); human2_font.setBold( FALSE ); human2->setFont( human2_font ); QFont TextLabel1_2_3_font( TextLabel1_2_3->font() ); TextLabel1_2_3_font.setBold( FALSE ); TextLabel1_2_3->setFont( TextLabel1_2_3_font ); QFont b_OK_font( b_OK->font() ); b_OK_font.setPointSize( 10 ); b_OK->setFont( b_OK_font ); QFont b_Cancel_font( b_Cancel->font() ); b_Cancel_font.setPointSize( 10 ); b_Cancel->setFont( b_Cancel_font ); } return ret;}void QPlayersDialog::applyChanges(){ qWarning( "QPlayersDialog::applyChanges(): Not implemented yet!" );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -