📄 propertiesdialog.cpp
字号:
/****************************************************************************** Form implementation generated from reading ui file 'propertiesdialog.ui'**** Created: 星期四 七月 19 15:06:12 2007** by: The User Interface Compiler ($Id: qt/main.cpp 3.3.4 edited Nov 24 2003 $)**** WARNING! All changes made in this file will be lost!****************************************************************************/#include "propertiesdialog.h"#include <qvariant.h>#include <qpushbutton.h>#include <qgroupbox.h>#include <qspinbox.h>#include <qlabel.h>#include <qframe.h>#include <qlineedit.h>#include <qlayout.h>#include <qtooltip.h>#include <qwhatsthis.h>#include "../propertiesdialog.ui.h"/* * Constructs a PropertiesDialog as 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. */PropertiesDialog::PropertiesDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ){ if ( !name ) setName( "PropertiesDialog" ); PropertiesDialogLayout = new QVBoxLayout( this, 11, 6, "PropertiesDialogLayout"); PropertiesDialogLayout->setResizeMode( QLayout::Fixed ); rectGeometryGroupBox = new QGroupBox( this, "rectGeometryGroupBox" ); rectGeometryGroupBox->setFrameShape( QGroupBox::Box ); rectGeometryGroupBox->setFrameShadow( QGroupBox::Sunken ); rectGeometryGroupBox->setColumnLayout(0, Qt::Vertical ); rectGeometryGroupBox->layout()->setSpacing( 6 ); rectGeometryGroupBox->layout()->setMargin( 11 ); rectGeometryGroupBoxLayout = new QGridLayout( rectGeometryGroupBox->layout() ); rectGeometryGroupBoxLayout->setAlignment( Qt::AlignTop ); xSpinBox = new QSpinBox( rectGeometryGroupBox, "xSpinBox" ); xSpinBox->setMaxValue( 100000 ); rectGeometryGroupBoxLayout->addWidget( xSpinBox, 0, 1 ); widthLabel = new QLabel( rectGeometryGroupBox, "widthLabel" ); rectGeometryGroupBoxLayout->addWidget( widthLabel, 1, 0 ); xLabel = new QLabel( rectGeometryGroupBox, "xLabel" ); rectGeometryGroupBoxLayout->addWidget( xLabel, 0, 0 ); widthSpinBox = new QSpinBox( rectGeometryGroupBox, "widthSpinBox" ); widthSpinBox->setMaxValue( 100000 ); rectGeometryGroupBoxLayout->addWidget( widthSpinBox, 1, 1 ); rectSpacer = new QSpacerItem( 10, 20, QSizePolicy::Fixed, QSizePolicy::Minimum ); rectGeometryGroupBoxLayout->addMultiCell( rectSpacer, 0, 1, 2, 2 ); heightSpinBox = new QSpinBox( rectGeometryGroupBox, "heightSpinBox" ); heightSpinBox->setMaxValue( 100000 ); rectGeometryGroupBoxLayout->addWidget( heightSpinBox, 1, 4 ); heightLabel = new QLabel( rectGeometryGroupBox, "heightLabel" ); rectGeometryGroupBoxLayout->addWidget( heightLabel, 1, 3 ); ySpinBox = new QSpinBox( rectGeometryGroupBox, "ySpinBox" ); ySpinBox->setMaxValue( 100000 ); rectGeometryGroupBoxLayout->addWidget( ySpinBox, 0, 4 ); yLabel = new QLabel( rectGeometryGroupBox, "yLabel" ); rectGeometryGroupBoxLayout->addWidget( yLabel, 0, 3 ); PropertiesDialogLayout->addWidget( rectGeometryGroupBox ); lineGeometryGroupBox = new QGroupBox( this, "lineGeometryGroupBox" ); lineGeometryGroupBox->setColumnLayout(0, Qt::Vertical ); lineGeometryGroupBox->layout()->setSpacing( 6 ); lineGeometryGroupBox->layout()->setMargin( 11 ); lineGeometryGroupBoxLayout = new QGridLayout( lineGeometryGroupBox->layout() ); lineGeometryGroupBoxLayout->setAlignment( Qt::AlignTop ); x1SpinBox = new QSpinBox( lineGeometryGroupBox, "x1SpinBox" ); x1SpinBox->setMaxValue( 100000 ); lineGeometryGroupBoxLayout->addWidget( x1SpinBox, 0, 1 ); y1SpinBox = new QSpinBox( lineGeometryGroupBox, "y1SpinBox" ); y1SpinBox->setMaxValue( 100000 ); lineGeometryGroupBoxLayout->addWidget( y1SpinBox, 0, 4 ); x2SpinBox = new QSpinBox( lineGeometryGroupBox, "x2SpinBox" ); x2SpinBox->setMaxValue( 100000 ); lineGeometryGroupBoxLayout->addWidget( x2SpinBox, 1, 1 ); x1Label = new QLabel( lineGeometryGroupBox, "x1Label" ); lineGeometryGroupBoxLayout->addWidget( x1Label, 0, 0 ); y2SpinBox = new QSpinBox( lineGeometryGroupBox, "y2SpinBox" ); y2SpinBox->setMaxValue( 100000 ); lineGeometryGroupBoxLayout->addWidget( y2SpinBox, 1, 4 ); y2Label = new QLabel( lineGeometryGroupBox, "y2Label" ); lineGeometryGroupBoxLayout->addWidget( y2Label, 1, 3 ); y1Label = new QLabel( lineGeometryGroupBox, "y1Label" ); lineGeometryGroupBoxLayout->addWidget( y1Label, 0, 3 ); x2Label = new QLabel( lineGeometryGroupBox, "x2Label" ); lineGeometryGroupBoxLayout->addWidget( x2Label, 1, 0 ); lineSpacer = new QSpacerItem( 10, 20, QSizePolicy::Fixed, QSizePolicy::Minimum ); lineGeometryGroupBoxLayout->addMultiCell( lineSpacer, 0, 1, 2, 2 ); PropertiesDialogLayout->addWidget( lineGeometryGroupBox ); attributesGroupBox = new QGroupBox( this, "attributesGroupBox" ); attributesGroupBox->setColumnLayout(0, Qt::Vertical ); attributesGroupBox->layout()->setSpacing( 6 ); attributesGroupBox->layout()->setMargin( 11 ); attributesGroupBoxLayout = new QGridLayout( attributesGroupBox->layout() ); attributesGroupBoxLayout->setAlignment( Qt::AlignTop ); lineColorLabel = new QLabel( attributesGroupBox, "lineColorLabel" ); attributesGroupBoxLayout->addWidget( lineColorLabel, 1, 0 ); textLabel = new QLabel( attributesGroupBox, "textLabel" ); attributesGroupBoxLayout->addWidget( textLabel, 0, 0 ); fillColorLabel = new QLabel( attributesGroupBox, "fillColorLabel" ); attributesGroupBoxLayout->addWidget( fillColorLabel, 2, 0 ); lineColorLayout = new QHBoxLayout( 0, 0, 6, "lineColorLayout"); lineColorSample = new QFrame( attributesGroupBox, "lineColorSample" ); lineColorSample->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, lineColorSample->sizePolicy().hasHeightForWidth() ) ); lineColorSample->setMinimumSize( QSize( 80, 0 ) ); lineColorSample->setMaximumSize( QSize( 32767, 15 ) ); lineColorSample->setFrameShape( QFrame::Box ); lineColorSample->setFrameShadow( QFrame::Plain ); lineColorLayout->addWidget( lineColorSample ); lineColorButton = new QPushButton( attributesGroupBox, "lineColorButton" ); lineColorLayout->addWidget( lineColorButton ); attributesGroupBoxLayout->addLayout( lineColorLayout, 1, 1 ); fillColorLayout = new QHBoxLayout( 0, 0, 6, "fillColorLayout"); fillColorSample = new QFrame( attributesGroupBox, "fillColorSample" ); fillColorSample->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, fillColorSample->sizePolicy().hasHeightForWidth() ) ); fillColorSample->setMaximumSize( QSize( 32767, 15 ) ); fillColorSample->setFrameShape( QFrame::Box ); fillColorSample->setFrameShadow( QFrame::Plain ); fillColorLayout->addWidget( fillColorSample ); fillColorButton = new QPushButton( attributesGroupBox, "fillColorButton" ); fillColorLayout->addWidget( fillColorButton ); attributesGroupBoxLayout->addLayout( fillColorLayout, 2, 1 ); textLineEdit = new QLineEdit( attributesGroupBox, "textLineEdit" ); attributesGroupBoxLayout->addWidget( textLineEdit, 0, 1 ); PropertiesDialogLayout->addWidget( attributesGroupBox ); buttonLayout = new QHBoxLayout( 0, 0, 6, "buttonLayout"); buttonSpacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); buttonLayout->addItem( buttonSpacer ); okButton = new QPushButton( this, "okButton" ); okButton->setDefault( TRUE ); buttonLayout->addWidget( okButton ); cancelButton = new QPushButton( this, "cancelButton" ); buttonLayout->addWidget( cancelButton ); PropertiesDialogLayout->addLayout( buttonLayout ); languageChange(); resize( QSize(284, 371).expandedTo(minimumSizeHint()) ); clearWState( WState_Polished ); // signals and slots connections connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( cancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( lineColorButton, SIGNAL( clicked() ), this, SLOT( chooseLineColor() ) ); connect( fillColorButton, SIGNAL( clicked() ), this, SLOT( chooseFillColor() ) ); // tab order setTabOrder( xSpinBox, ySpinBox ); setTabOrder( ySpinBox, widthSpinBox ); setTabOrder( widthSpinBox, heightSpinBox ); setTabOrder( heightSpinBox, textLineEdit ); setTabOrder( textLineEdit, lineColorButton ); setTabOrder( lineColorButton, fillColorButton ); setTabOrder( fillColorButton, okButton ); setTabOrder( okButton, cancelButton );}/* * Destroys the object and frees any allocated resources */PropertiesDialog::~PropertiesDialog(){ // no need to delete child widgets, Qt does it all for us}/* * Sets the strings of the subwidgets using the current * language. */void PropertiesDialog::languageChange(){ setCaption( tr( "Properties" ) ); rectGeometryGroupBox->setTitle( tr( "Geometry" ) ); widthLabel->setText( tr( "Width:" ) ); xLabel->setText( tr( "X:" ) ); heightLabel->setText( tr( "Height:" ) ); yLabel->setText( tr( "Y:" ) ); lineGeometryGroupBox->setTitle( tr( "Geometry" ) ); x1Label->setText( tr( "X1:" ) ); y2Label->setText( tr( "Y2:" ) ); y1Label->setText( tr( "Y1:" ) ); x2Label->setText( tr( "X2:" ) ); attributesGroupBox->setTitle( tr( "Attributes" ) ); lineColorLabel->setText( tr( "Line Color:" ) ); textLabel->setText( tr( "Text:" ) ); fillColorLabel->setText( tr( "Fill Color:" ) ); lineColorButton->setText( tr( "Choose..." ) ); fillColorButton->setText( tr( "Choose..." ) ); okButton->setText( tr( "OK" ) ); cancelButton->setText( tr( "Cancel" ) );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -