本文整理汇总了C++中Fixture::fixtureDef方法的典型用法代码示例。如果您正苦于以下问题:C++ Fixture::fixtureDef方法的具体用法?C++ Fixture::fixtureDef怎么用?C++ Fixture::fixtureDef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fixture
的用法示例。
在下文中一共展示了Fixture::fixtureDef方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: status
/*********************************************************************
* Status
*********************************************************************/
QString ChannelsGroup::status(Doc *doc) const
{
QString info;
QString title("<TR><TD CLASS='hilite' COLSPAN='3'><CENTER>%1</CENTER></TD></TR>");
info += "<TABLE COLS='3' WIDTH='100%'>";
// Fixture title
info += title.arg(name());
/********************************************************************
* Channels
********************************************************************/
// Title row
info += QString("<TR><TD CLASS='subhi'>%1</TD>").arg(tr("Fixture"));
info += QString("<TD CLASS='subhi'>%1</TD>").arg(tr("Channel"));
info += QString("<TD CLASS='subhi'>%1</TD></TR>").arg(tr("Description"));
foreach (SceneValue value, m_channels)
{
Fixture *fixture = doc->fixture(value.fxi);
const QLCFixtureDef *def = fixture->fixtureDef();
QString chInfo("<TR><TD>%1</TD><TD>%2</TD><TD>%3</TD></TR>");
if (def != NULL)
{
info += chInfo.arg(fixture->name()).arg(value.channel + 1)
.arg(def->channels().at(value.channel)->name());
}
else
{
info += chInfo.arg(fixture->name()).arg(value.channel + 1)
.arg(QString(tr("Channel %1")).arg(value.channel));
}
}
示例2: loader
void Fixture_Test::loader()
{
QBuffer buffer;
buffer.open(QIODevice::WriteOnly | QIODevice::Text);
QXmlStreamWriter xmlWriter(&buffer);
xmlWriter.writeStartElement("Fixture");
xmlWriter.writeTextElement("Channels", "18");
xmlWriter.writeTextElement("Name", "Foobar");
xmlWriter.writeTextElement("Universe", "3");
xmlWriter.writeTextElement("Model", "Foobar");
xmlWriter.writeTextElement("Mode", "Foobar");
xmlWriter.writeTextElement("Manufacturer", "Foobar");
xmlWriter.writeTextElement("ID", "42");
xmlWriter.writeTextElement("Address", "21");
xmlWriter.writeEndDocument();
xmlWriter.setDevice(NULL);
buffer.close();
buffer.open(QIODevice::ReadOnly | QIODevice::Text);
QXmlStreamReader xmlReader(&buffer);
xmlReader.readNextStartElement();
QVERIFY(m_doc != NULL);
QVERIFY(m_doc->fixtures().size() == 0);
QVERIFY(Fixture::loader(xmlReader, m_doc) == true);
QVERIFY(m_doc->fixtures().size() == 1);
QVERIFY(m_doc->fixture(0) == NULL); // No ID auto-assignment
Fixture* fxi = m_doc->fixture(42);
QVERIFY(fxi != NULL);
QVERIFY(fxi->name() == "Foobar");
QVERIFY(fxi->channels() == 18);
QVERIFY(fxi->address() == 21);
QVERIFY(fxi->universe() == 3);
QVERIFY(fxi->fixtureDef() != NULL);
QVERIFY(fxi->fixtureMode() != NULL);
}
示例3: init
void ConsoleChannel::init()
{
Fixture* fxi = m_doc->fixture(m_fixture);
//Q_ASSERT(fxi != NULL);
new QVBoxLayout(this);
layout()->setSpacing(0);
layout()->setContentsMargins(0, 2, 0, 2);
if (fxi != NULL)
{
m_presetButton = new QToolButton(this);
m_presetButton->setStyle(AppUtil::saneStyle());
layout()->addWidget(m_presetButton);
layout()->setAlignment(m_presetButton, Qt::AlignHCenter);
m_presetButton->setIconSize(QSize(32, 32));
m_presetButton->setMinimumSize(QSize(32, 32));
m_presetButton->setMaximumSize(QSize(32, 32));
m_presetButton->setFocusPolicy(Qt::NoFocus);
/* Create a menu only if channel has sophisticated contents */
if (fxi->fixtureDef() != NULL && fxi->fixtureMode() != NULL)
initMenu();
else
m_presetButton->setStyleSheet("QToolButton { border-image: url(:/intensity.png) 0 0 0 0 stretch stretch; }");
}
/* Value edit */
m_spin = new QSpinBox(this);
m_spin->setRange(0, UCHAR_MAX);
m_spin->setValue(0);
m_spin->setMinimumWidth(25);
m_spin->setButtonSymbols(QAbstractSpinBox::NoButtons);
m_spin->setStyle(AppUtil::saneStyle());
layout()->addWidget(m_spin);
m_spin->setAlignment(Qt::AlignCenter);
m_spin->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
layout()->setAlignment(m_spin, Qt::AlignHCenter);
/* Value slider */
m_slider = new ClickAndGoSlider(this);
m_slider->setInvertedAppearance(false);
m_slider->setRange(0, UCHAR_MAX);
m_slider->setPageStep(1);
m_slider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
m_slider->setFocusPolicy(Qt::NoFocus);
connect(m_slider, SIGNAL(controlClicked()),
this, SLOT(slotControlClicked()));
m_slider->setMinimumWidth(25);
m_slider->setMaximumWidth(40);
m_slider->setStyleSheet(
"QSlider::groove:vertical { background: transparent; width: 32px; } "
"QSlider::handle:vertical { "
"background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #ddd, stop:0.45 #888, stop:0.50 #000, stop:0.55 #888, stop:1 #999);"
"border: 1px solid #5c5c5c;"
"border-radius: 4px; margin: 0 -1px; height: 20px; }"
"QSlider::handle:vertical:hover {"
"background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #eee, stop:0.45 #999, stop:0.50 #ff0000, stop:0.55 #999, stop:1 #ccc);"
"border: 1px solid #000; }"
"QSlider::add-page:vertical { background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #78d, stop: 1 #97CDEC );"
"border: 1px solid #5288A7; margin: 0 13px; }"
"QSlider::sub-page:vertical { background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #888, stop: 1 #ddd );"
"border: 1px solid #8E8A86; margin: 0 13px; }"
"QSlider::handle:vertical:disabled { background: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #ddd, stop:0.45 #888, stop:0.50 #444, stop:0.55 #888, stop:1 #999);"
"border: 1px solid #666; }"
);
layout()->addWidget(m_slider);
//layout()->setAlignment(m_slider, Qt::AlignHCenter);
/* Channel number label */
m_label = new QLabel(this);
m_label->setMinimumWidth(25);
m_label->setMaximumWidth(80);
layout()->addWidget(m_label);
m_label->setAlignment(Qt::AlignCenter);
m_label->setText(QString::number(m_channel + 1));
m_label->setFocusPolicy(Qt::NoFocus);
m_label->setWordWrap(true);
/* Set tooltip */
if (fxi == NULL || fxi->isDimmer() == true)
{
setToolTip(tr("Intensity"));
}
else
{
const QLCChannel* ch = fxi->channel(m_channel);
Q_ASSERT(ch != NULL);
setToolTip(QString("%1").arg(ch->name()));
}
connect(m_spin, SIGNAL(valueChanged(int)), this, SLOT(slotSpinChanged(int)));
connect(m_slider, SIGNAL(valueChanged(int)), this, SLOT(slotSliderChanged(int)));
connect(this, SIGNAL(toggled(bool)), this, SLOT(slotChecked(bool)));
//.........这里部分代码省略.........