本文整理汇总了C++中setUnit函数的典型用法代码示例。如果您正苦于以下问题:C++ setUnit函数的具体用法?C++ setUnit怎么用?C++ setUnit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setUnit函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: KFilePlugin
KPngPlugin::KPngPlugin(QObject *parent, const char *name,
const QStringList &args)
: KFilePlugin(parent, name, args)
{
kdDebug(7034) << "png plugin\n";
// set up our mime type
KFileMimeTypeInfo* info = addMimeTypeInfo( "image/png" );
KFileMimeTypeInfo::GroupInfo* group = 0;
KFileMimeTypeInfo::ItemInfo* item = 0;
// comment group
group = addGroupInfo(info, "Comment", i18n("Comment"));
addVariableInfo(group, QVariant::String, 0);
// technical group
group = addGroupInfo(info, "Technical", i18n("Technical Details"));
item = addItemInfo(group, "Dimensions", i18n("Dimensions"), QVariant::Size);
setHint( item, KFileMimeTypeInfo::Size );
setUnit(item, KFileMimeTypeInfo::Pixels);
item = addItemInfo(group, "BitDepth", i18n("Bit Depth"), QVariant::Int);
setUnit(item, KFileMimeTypeInfo::BitsPerPixel);
addItemInfo(group, "ColorMode", i18n("Color Mode"), QVariant::String);
addItemInfo(group, "Compression", i18n("Compression"), QVariant::String);
addItemInfo(group, "InterlaceMode", i18n("Interlace Mode"),QVariant::String);
}
开发者ID:serghei,项目名称:kde3-kdegraphics,代码行数:30,代码来源:kfile_png.cpp
示例2: KFilePlugin
KRgbPlugin::KRgbPlugin(QObject *parent, const QStringList &args) :
KFilePlugin(parent, args)
{
KFileMimeTypeInfo* info = addMimeTypeInfo("image/x-rgb");
KFileMimeTypeInfo::GroupInfo* group = 0;
KFileMimeTypeInfo::ItemInfo* item;
group = addGroupInfo(info, "Comment", i18n("Comment"));
item = addItemInfo(group, "ImageName", i18n("Name"), QVariant::String);
setAttributes(item, KFileMimeTypeInfo::Modifiable);
setHint(item, KFileMimeTypeInfo::Description);
group = addGroupInfo(info, "Technical", i18n("Technical Details"));
item = addItemInfo(group, "Dimensions", i18n("Dimensions"), QVariant::Size);
setHint(item, KFileMimeTypeInfo::Size);
setUnit(item, KFileMimeTypeInfo::Pixels);
item = addItemInfo(group, "BitDepth", i18n("Bit Depth"), QVariant::Int);
setUnit(item, KFileMimeTypeInfo::BitsPerPixel);
item = addItemInfo(group, "ColorMode", i18n("Color Mode"), QVariant::String);
item = addItemInfo(group, "Compression", i18n("Compression"), QVariant::String);
item = addItemInfo(group, "SharedRows",
i18nc("percentage of avoided vertical redundancy (the higher the better)",
"Shared Rows"), QVariant::String);
}
开发者ID:KDE,项目名称:kdegraphics-strigi-analyzer,代码行数:32,代码来源:kfile_rgb.cpp
示例3: QamFlightInstrument
QamTachymeter::QamTachymeter(QWidget* parent ) : QamFlightInstrument(parent)
{
m_class = "QamTachymeter" ;
setLabel(QString("TURBINE"), TURBINE ) ;
setUnit(QString("x 1000"), TURBINE ) ;
setMinMax(0, 40000, TURBINE ) ;
setThresholds(32000, 35000, TURBINE ) ;
setValue(0, TURBINE ) ;
m_radius[TURBINE] = QFI_RADIUS ;
m_start[TURBINE] = 120 ;
m_span[TURBINE] = 300 ;
m_min[TURBINE] = 0 ;
m_max[TURBINE] = 40 ;
m_step[TURBINE] = m_span[TURBINE] / ( m_max[TURBINE] - m_min[TURBINE] ) ;
setLabel(QString("ROTOR"), ROTOR ) ;
setUnit(QString("t/mn x 100"), ROTOR ) ;
setMinMax(0, 450, ROTOR ) ;
setThresholds(280, 420, ROTOR ) ;
setValue(0, ROTOR ) ;
m_radius[ROTOR] = 0.6 * QFI_RADIUS ;
m_start[ROTOR] = 120 ;
m_span[ROTOR] = 320 ;
m_min[ROTOR] = 0 ;
m_max[ROTOR] = 45 ;
m_step[ROTOR] = m_span[ROTOR] / ( m_max[ROTOR] - m_min[ROTOR] ) ;
// animation des aiguilles (pour tests)
setAdjustable(100, 0, TURBINE ) ;
// connect(this, SIGNAL( selectChanged() ), this, SLOT( selectChanged() ) ) ;
}
开发者ID:menu-a,项目名称:llf-snir,代码行数:35,代码来源:qamtachymeter.cpp
示例4: setUnit
void NumberValue::setType(const NumberValue &n) {
type = n.type;
if (n.type == DIMENSION)
setUnit(n.getUnit());
else if (n.type == PERCENTAGE)
tokens.front().type = Token::PERCENTAGE;
else if (n.type == NUMBER) {
setUnit("");
}
}
开发者ID:jkasky,项目名称:clessc,代码行数:10,代码来源:NumberValue.cpp
示例5: setUnit
void EditorSession::setCourse(Course *course)
{
if (m_course == course) {
return;
}
m_course = course;
if (m_course && !m_course->unitList().isEmpty()) {
setUnit(m_course->unitList().first());
} else {
setUnit(nullptr);
}
emit courseChanged();
}
开发者ID:cordlandwehr,项目名称:artikulate,代码行数:13,代码来源:editorsession.cpp
示例6: KFilePlugin
KRpmPlugin::KRpmPlugin(QObject *parent,
const QStringList &args)
: KFilePlugin(parent, args)
{
KFileMimeTypeInfo* info = addMimeTypeInfo( "application/x-rpm" );
KFileMimeTypeInfo::GroupInfo* group = 0L;
group = addGroupInfo(info, "General", i18n("General"));
KFileMimeTypeInfo::ItemInfo* item;
item = addItemInfo(group, "Name", i18n("Name"), QVariant::String);
item = addItemInfo(group, "Version", i18n("Version"), QVariant::String);
item = addItemInfo(group, "Release", i18n("Release"), QVariant::Int);
item = addItemInfo(group, "Summary", i18n("Summary"), QVariant::String);
setAttributes ( item, KFileMimeTypeInfo::Description );
item = addItemInfo(group, "Group", i18n("Group"), QVariant::String);
item = addItemInfo(group, "Size", i18n("Size"), QVariant::Int);
setUnit ( item, KFileMimeTypeInfo::Bytes );
item = addItemInfo(group, "Vendor", i18n("Vendor"), QVariant::String );
item = addItemInfo(group, "Packager", i18n("Packager"), QVariant::String );
item = addItemInfo(group, "Archive Offset", i18n("Archive Offset"), QVariant::Int);
item = addItemInfo(group, "Comment", i18n("Comment"), QVariant::String);
setAttributes( item, KFileMimeTypeInfo::MultiLine );
group = addGroupInfo(info, "All tags", i18n("All tags"));
addVariableInfo(group, QVariant::String, 0);
}
开发者ID:KDE,项目名称:kdeadmin-strigi-analyzers,代码行数:27,代码来源:kfile_rpm.cpp
示例7: QLabel
void Variometer::createSettings(QGridLayout *layout) {
QLabel *unitsLabel = new QLabel("Unit", layout->parentWidget());
layout->addWidget(unitsLabel, layout->rowCount(), 0);
VelocityUnitComboBox *unitsCombo = new VelocityUnitComboBox(layout->parentWidget(), units);
connect(unitsCombo, SIGNAL(unitSelected(VelocityUnit)), this, SLOT(setUnit(VelocityUnit)));
layout->addWidget(unitsCombo);
QLabel *maxLabel = new QLabel("Maximum value", layout->parentWidget());
layout->addWidget(maxLabel);
NumberInputLineEdit *maxValueEdit = new NumberInputLineEdit(layout->parentWidget());
maxValueEdit->setText(QString::number(maxValue));
layout->addWidget(maxValueEdit);
connect(maxValueEdit, SIGNAL(valueChangedFloat(float)), this, SLOT(setMaxValue(float)));
QLabel *scaleLabel = new QLabel("Scale numbers", layout->parentWidget());
layout->addWidget(scaleLabel);
NumberInputLineEdit *scaleValueEdit = new NumberInputLineEdit(layout->parentWidget());
scaleValueEdit->setText(QString::number(numberScale));
layout->addWidget(scaleValueEdit);
connect(scaleValueEdit, SIGNAL(valueChangedFloat(float)), this, SLOT(setNumberScale(float)));
QCheckBox *totalCheckbox = new QCheckBox("Total energy", layout->parentWidget());
totalCheckbox->setChecked(isTotalEnergy);
layout->addWidget(totalCheckbox);
connect(totalCheckbox, SIGNAL(clicked(bool)), this, SLOT(setIsTotalEnergy(bool)));
}
开发者ID:bobgates,项目名称:ExtPlane-Panel,代码行数:27,代码来源:variometer.cpp
示例8: getUnit
void NumberValue::verifyUnits(const NumberValue& n) {
if (type == Value::DIMENSION && n.type == Value::DIMENSION &&
getUnit().compare(n.getUnit()) != 0) {
setValue(convert(n.getUnit()));
setUnit(n.getUnit());
}
}
开发者ID:BramvdKroef,项目名称:clessc,代码行数:7,代码来源:NumberValue.cpp
示例9: utFind
/*
* Return the unit corresponding to a unit-specification.
*
*/
int
utFind(
char *spec,
utUnit *up)
{
int status;
ut_unit* unit = ut_parse(unitSystem, spec, UT_ASCII);
if (unit == NULL) {
status = ut_get_status();
if (status == UT_BAD_ARG) {
status = UT_EINVALID;
}
else if (status == UT_SYNTAX) {
status = UT_ESYNTAX;
}
else if (status == UT_UNKNOWN) {
status = UT_EUNKNOWN;
}
else if (status == UT_OS) {
status = UT_EALLOC;
}
}
else {
status = setUnit(up, unit);
}
return status;
}
开发者ID:sdebionne,项目名称:UDUNITS-2,代码行数:33,代码来源:udunits-1.c
示例10: RS_Document
/**
* Default constructor.
*/
RS_Graphic::RS_Graphic(RS_EntityContainer* parent)
: RS_Document(parent),
layerList(),
blockList(true)
#ifdef RS_CAM
, camData()
#endif
{
RS_SETTINGS->beginGroup("/Defaults");
setUnit(RS_Units::stringToUnit(RS_SETTINGS->readEntry("/Unit", "None")));
RS_SETTINGS->endGroup();
RS2::Unit unit = getUnit();
if (unit==RS2::Inch) {
addVariable("$DIMASZ", 0.1, 40);
addVariable("$DIMEXE", 0.05, 40);
addVariable("$DIMEXO", 0.025, 40);
addVariable("$DIMGAP", 0.025, 40);
addVariable("$DIMTXT", 0.1, 40);
} else {
addVariable("$DIMASZ",
RS_Units::convert(2.5, RS2::Millimeter, unit), 40);
addVariable("$DIMEXE",
RS_Units::convert(1.25, RS2::Millimeter, unit), 40);
addVariable("$DIMEXO",
RS_Units::convert(0.625, RS2::Millimeter, unit), 40);
addVariable("$DIMGAP",
RS_Units::convert(0.625, RS2::Millimeter, unit), 40);
addVariable("$DIMTXT",
RS_Units::convert(2.5, RS2::Millimeter, unit), 40);
}
setModified(false);
}
开发者ID:jacklibj,项目名称:2.0.5.0-1-community.src,代码行数:38,代码来源:rs_graphic.cpp
示例11: m_state
KWFrameGeometry::KWFrameGeometry(FrameConfigSharedState *state)
: m_state(state),
m_frame(0),
m_topOfPage(0),
m_blockSignals(false),
m_originalGeometryLock(false)
{
m_state->addUser();
widget.setupUi(this);
setUnit(m_state->document()->unit());
widget.width->setMinimum(0.0);
widget.height->setMinimum(0.0);
widget.leftMargin->setMinimum(0.0);
widget.rightMargin->setMinimum(0.0);
widget.bottomMargin->setMinimum(0.0);
widget.topMargin->setMinimum(0.0);
widget.keepAspect->setKeepAspectRatio(m_state->keepAspectRatio());
connect(widget.leftMargin, SIGNAL(valueChangedPt(qreal)), this, SLOT(syncMargins(qreal)));
connect(widget.rightMargin, SIGNAL(valueChangedPt(qreal)), this, SLOT(syncMargins(qreal)));
connect(widget.bottomMargin, SIGNAL(valueChangedPt(qreal)), this, SLOT(syncMargins(qreal)));
connect(widget.topMargin, SIGNAL(valueChangedPt(qreal)), this, SLOT(syncMargins(qreal)));
connect(widget.width, SIGNAL(valueChangedPt(qreal)), this, SLOT(widthChanged(qreal)));
connect(widget.height, SIGNAL(valueChangedPt(qreal)), this, SLOT(heightChanged(qreal)));
connect(m_state, SIGNAL(keepAspectRatioChanged(bool)), widget.keepAspect, SLOT(setKeepAspectRatio(bool)));
connect(widget.keepAspect, SIGNAL(keepAspectRatioChanged(bool)), this, SLOT(updateAspectRatio(bool)));
connect(widget.positionSelector, SIGNAL(positionSelected(KFlake::Position)),
this, SLOT(setGeometryAlignment(KFlake::Position)));
}
开发者ID:KDE,项目名称:koffice,代码行数:34,代码来源:KWFrameGeometry.cpp
示例12: setTitle
void Thermometer::setParameter(QString title, float percentage, float startScale, float endScale, QString unit)
{
setTitle(title);
setPercentage(percentage);
setScale(startScale, endScale);
setUnit(unit);
}
开发者ID:sanxzkid,项目名称:QtMeters,代码行数:7,代码来源:thermomether.cpp
示例13: setUnit
void Variometer::loadSettings(QSettings &settings) {
PanelItem::loadSettings(settings);
QString unitname = settings.value("unit").toString();
VelocityUnit unit = Units::velocityUnitForName(unitname);
setUnit(unit);
setMaxValue(settings.value("maxvalue", 300).toDouble());
setIsTotalEnergy(settings.value("totalenergy", false).toBool());
}
开发者ID:Nicolou,项目名称:ExtPlane-Panel,代码行数:8,代码来源:variometer.cpp
示例14: clear
PPPStats::PPPStats()
{
clear();
timer = new QTimer;
ppp_connection_time = new QTime;
setUnit(0);
connect(timer, SIGNAL(timeout()), SLOT(timerClick()));
}
开发者ID:nzarko,项目名称:kalgdial,代码行数:8,代码来源:pppstats.cpp
示例15: switch
void Fight::socketFight()
{
switch( _socket->getCla2() ) {
case C_FIGHT_INIT:
logEE( "Should not happen (C_FIGHT_INIT in Fight)" );
break;
case C_FIGHT_CREATURE:
_isCreature = true;
setOpponent( _game->getLord( 0 ) );
break;
case C_FIGHT_LORD: {
GenericLord * lord = _game->getLord( _socket->readChar() );
lord->setBaseCharac( ATTACK, _socket->readChar() );
lord->setBaseCharac( DEFENSE, _socket->readChar() );
setOpponent( lord );
} break;
case C_FIGHT_CELL:
socketFightCell();
break;
case C_FIGHT_UNIT: {
uchar cla = _socket->readChar();
uchar num = _socket->readChar();
GenericFightUnit * unit = new GenericFightUnit();
uchar race = _socket->readChar();
uchar level = _socket->readChar();
unit->setCreature( race, level );
unit->setNumber( _socket->readInt() );
unit->setMove( _socket->readChar() );
unit->setHealth( _socket->readInt() );
setUnit( unit, (CLASS_FIGHTER)cla, num );
} break;
case C_FIGHT_MODUNIT:
socketFightModify();
break;
case C_FIGHT_MOVE:
socketFightMove();
break;
case C_FIGHT_ENDMOVE:
_isActive = false;
_map->clearPath();
break;
case C_FIGHT_ACTIVE:{
uchar cla = _socket->readChar();
uchar num = _socket->readChar();
setActive( (CLASS_FIGHTER)cla, num );
}
break;
case C_FIGHT_DAMAGE:
socketFightDamage();
break;
case C_FIGHT_END: {
updateUnits();
showFightResults( _socket->readChar() );
emit sig_quit();
}
break;
}
}
开发者ID:q4a,项目名称:attal,代码行数:58,代码来源:fight.cpp
示例16: setUnit
void Variometer::loadSettings(QSettings &settings) {
NeedleInstrument::loadSettings(settings);
QString unitname = settings.value("unit").toString();
VelocityUnit unit = Units::velocityUnitForName(unitname);
setUnit(unit);
setMaxValue(settings.value("maxvalue", 300).toFloat());
setNumberScale(settings.value("scalevalue", 1.).toFloat());
setIsTotalEnergy(settings.value("totalenergy", false).toBool());
}
开发者ID:bobgates,项目名称:ExtPlane-Panel,代码行数:9,代码来源:variometer.cpp
示例17: addMimeTypeInfo
void KPnmPlugin::makeMimeTypeInfo(const QString& mimetype)
{
KFileMimeTypeInfo* info = addMimeTypeInfo( mimetype );
KFileMimeTypeInfo::GroupInfo* group = 0;
KFileMimeTypeInfo::ItemInfo* item = 0;
group = addGroupInfo(info, "General", i18n("General"));
addItemInfo(group, "Format", i18n("Format"), QVariant::String);
item = addItemInfo(group, "Dimensions", i18n("Dimensions"), QVariant::Size);
setUnit(item, KFileMimeTypeInfo::Pixels);
item = addItemInfo(group, "BitDepth", i18n("Bit Depth"), QVariant::Int);
setUnit(item, KFileMimeTypeInfo::BitsPerPixel);
addItemInfo(group, "Comment", i18n("Comment"), QVariant::String);
}
开发者ID:KDE,项目名称:kdegraphics-strigi-analyzer,代码行数:19,代码来源:kfile_pnm.cpp
示例18: units
bool MERefValue<DimValue>::setUnit(QString unit)
{
int iUnit = units().indexOf(unit);
if(iUnit==-1)
return false;
else
setUnit(iUnit);
return true;
}
开发者ID:SemiSQ,项目名称:OpenModelica,代码行数:10,代码来源:MERefValue.cpp
示例19: setUnit
void DurationSpinBox::stepUnitUp()
{
//kDebug(planDbg())<<m_unit<<">"<<m_maxunit;
if ( m_unit > m_maxunit ) {
setUnit( static_cast<Duration::Unit>(m_unit - 1) );
// line may change length, make sure cursor stays within unit
lineEdit()->setCursorPosition( lineEdit()->displayText().length() - suffix().length() );
emit unitChanged( m_unit );
}
}
开发者ID:crayonink,项目名称:calligra-2,代码行数:10,代码来源:kptdurationspinbox.cpp
示例20: QWidget
KoPageLayoutWidget::KoPageLayoutWidget(QWidget *parent, const KoPageLayout &layout)
: QWidget(parent)
, d(new Private)
{
d->widget.setupUi(this);
d->pageLayout = layout;
d->marginsEnabled = true;
d->allowSignals = true;
d->orientationGroup = new QButtonGroup(this);
d->orientationGroup->addButton(d->widget.portrait, KoPageFormat::Portrait);
d->orientationGroup->addButton(d->widget.landscape, KoPageFormat::Landscape);
QButtonGroup *group2 = new QButtonGroup(this);
group2->addButton(d->widget.singleSided);
group2->addButton(d->widget.facingPages);
// the two sets of labels we use might have different lengths; make sure this does not create a 'jumping' ui
d->widget.facingPages->setChecked(true);
facingPagesChanged();
int width = qMax(d->widget.leftLabel->width(), d->widget.rightLabel->width());
d->widget.singleSided->setChecked(true);
facingPagesChanged();
width = qMax(width, qMax(d->widget.leftLabel->width(), d->widget.rightLabel->width()));
d->widget.leftLabel->setMinimumSize(QSize(width, 5));
d->widget.units->addItems(KoUnit::listOfUnitNameForUi(KoUnit::HidePixel));
d->widget.sizes->addItems(KoPageFormat::localizedPageFormatNames());
setPageSpread(false);
connect(d->widget.sizes, SIGNAL(currentIndexChanged(int)), this, SLOT(sizeChanged(int)));
connect(d->widget.units, SIGNAL(currentIndexChanged(int)), this, SLOT(unitChanged(int)));
connect(group2, SIGNAL(buttonClicked (int)), this, SLOT(facingPagesChanged()));
connect(d->orientationGroup, SIGNAL(buttonClicked (int)), this, SLOT(orientationChanged()));
connect(d->widget.width, SIGNAL(valueChangedPt(qreal)), this, SLOT(optionsChanged()));
connect(d->widget.height, SIGNAL(valueChangedPt(qreal)), this, SLOT(optionsChanged()));
connect(d->widget.topMargin, SIGNAL(valueChangedPt(qreal)), this, SLOT(marginsChanged()));
connect(d->widget.bottomMargin, SIGNAL(valueChangedPt(qreal)), this, SLOT(marginsChanged()));
connect(d->widget.bindingEdgeMargin, SIGNAL(valueChangedPt(qreal)), this, SLOT(marginsChanged()));
connect(d->widget.pageEdgeMargin, SIGNAL(valueChangedPt(qreal)), this, SLOT(marginsChanged()));
connect(d->widget.width, SIGNAL(valueChangedPt(qreal)), this, SLOT(optionsChanged()));
connect(d->widget.height, SIGNAL(valueChangedPt(qreal)), this, SLOT(optionsChanged()));
setUnit(KoUnit(KoUnit::Millimeter));
setPageLayout(layout);
if (layout.format == 0) // make sure we always call this during startup, even if the A3 (index=0) was chosen
sizeChanged(layout.format);
showTextDirection(false);
/* disable advanced page layout features by default */
d->widget.facingPageLabel->setVisible(false);
d->widget.facingPages->setVisible(false);
d->widget.singleSided->setVisible(false);
d->widget.stylesLabel->setVisible(false);
d->widget.pageStyle->setVisible(false);
}
开发者ID:abhishekmurthy,项目名称:Calligra,代码行数:55,代码来源:KoPageLayoutWidget.cpp
注:本文中的setUnit函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论