📄 myparameter.cpp
字号:
/************************************************************************************************************************************************************** **** equal III the graphic builder **** **** Copyright (C) 2003 Oleksiy Pylypenko **** **** This file may be distributed and/or modified under the terms of the **** GNU General Public License version 2 as published by the Free Software **** Foundation and appearing in the file license included in the **** packaging of this file. **** **** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE **** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. **** **** Contact earthman@inbox.ru if any conditions of this licensing are **** not clear to you. **** **** ********************************************************************************* *****************************************************************************/#include <qlayout.h>#include <qlabel.h>#include <qvalidator.h>#include "myparameter.h"void myParameter::clear(void){ paramEdit->setText("1"); setParameter(0);}myParameter::myParameter( QWidget *parent) : QWidget( parent ){ QBoxLayout *topLayout = new QVBoxLayout( this , 2 ); paramEdit = new QLineEdit(this); paramEdit->setFixedWidth(50); paramEdit->setValidator(new QDoubleValidator(this)); topLayout->setStretchFactor(paramEdit,1); QBoxLayout *lineLayout = new QHBoxLayout( topLayout , 2 ); lineLayout->addWidget(new QLabel(tr("Parameter change step:"),this)); lineLayout->addWidget(paramEdit,2); topLayout->addWidget(new QLabel(tr("To change parameter use Alt+Up/Alt+Down"),this),1); paramLabel = 0; clear();// this->connect(this,SIGNAL(update()),SIGNAL(update()));}void myParameter::setParameter(double value){ aparameter = value; if(paramLabel) paramLabel->setText(QString(" t = %1").arg(aparameter)); update();}double myParameter::parameter(void){ return aparameter;}void myParameter::changed(void){ update();}double myParameter::step(void){ return paramEdit->text().toDouble();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -