本文整理汇总了C++中QLCDNumber::setObjectName方法的典型用法代码示例。如果您正苦于以下问题:C++ QLCDNumber::setObjectName方法的具体用法?C++ QLCDNumber::setObjectName怎么用?C++ QLCDNumber::setObjectName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QLCDNumber
的用法示例。
在下文中一共展示了QLCDNumber::setObjectName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addWidget
void CSensorView::addWidget(QString var_name, QPoint var_pos)
{
bool isExist=false;
int indExistant=0;
for(int ind=0;ind<listeAddedSignals.size();ind++)
if(listeAddedSignals.at(ind)->addedSignalName.compare(var_name)==0)
{
isExist=true;
indExistant=ind;
}
QVariant property_value=m_application->m_data_center->getDataProperty(var_name,"Type");
QString mime_property=property_value.toString();
int type;
if(mime_property.isEmpty())
type=mime_default;
else if(mime_property.compare("sensor_tor")==0)
type=mime_sensor_tor;
else if(mime_property.compare("computed_signal")==0)
type=mime_computed_signal;
else
type=mime_default;
QLed * newLed;
QLCDNumber * newLCDNumber;
switch(type)
{
case mime_default:
case mime_computed_signal:
newLCDNumber =new QLCDNumber(m_ihm.ui.viewWidget);
newLCDNumber->setObjectName(var_name);
newLCDNumber->move(var_pos);
newLCDNumber->setVisible(true);
if (isExist)
{
listeAddedSignals.at(indExistant)->addedLCDNumber=newLCDNumber;
listeAddedSignals.at(indExistant)->addedSignalPosition.setX(var_pos.x());
listeAddedSignals.at(indExistant)->addedSignalPosition.setY(var_pos.y());
}
else
listeAddedSignals << new viewWidget(var_name,var_pos,type,newLCDNumber);
//qDebug() << "LCDNumber" << var_name << "ajouté";
break;
case mime_sensor_tor:
newLed = new QLed(m_ihm.ui.viewWidget);
newLed->setObjectName(var_name);
newLed->setMinimumSize(20,20);
newLed->setMaximumSize(20,20);
newLed->setValue(true);
newLed->move(var_pos);
newLed->setVisible(true);
if (isExist)
{
listeAddedSignals.at(indExistant)->addedLed=newLed;
listeAddedSignals.at(indExistant)->addedSignalPosition.setX(var_pos.x());
listeAddedSignals.at(indExistant)->addedSignalPosition.setY(var_pos.y());
}
else
listeAddedSignals << new viewWidget(var_name,var_pos,type,newLed);
//qDebug() << "Led" << var_name << "ajouté";
break;
default:
break;
}
}
示例2: main
int main( int argc, char **argv )
{
QApplication app( argc, argv );
#ifndef QSA_NO_EDITOR
QWidget widget;
QSProject project;
QVBoxLayout *vboxLayout = new QVBoxLayout(&widget);
// some help text
QLabel *help = new QLabel("Right-click on any of the buttons to edit "
"its properties.");
vboxLayout->addWidget(help);
QWidget *hboxWidget = new QWidget;
QHBoxLayout *hboxLayout = new QHBoxLayout(hboxWidget);
vboxLayout->addWidget(hboxWidget);
// create two sample widgets
QGroupBox *lcdGroup = new QGroupBox( "lcd");
hboxLayout->addWidget(lcdGroup);
QVBoxLayout *lcdgroupLayout = new QVBoxLayout(lcdGroup);
QLCDNumber *lcd = new QLCDNumber;
lcd->setObjectName("lcd");
lcdgroupLayout->addWidget(lcd);
project.addObject(lcd);
lcdgroupLayout->addWidget(new QLabel("Properties: <ul><li>value</li>"
"<li>setHexMode()</li><li>...</li></ul>"));
QGroupBox *editGroup = new QGroupBox( "edit");
hboxLayout->addWidget(editGroup);
QVBoxLayout *editgroupLayout = new QVBoxLayout(editGroup);
QLineEdit *edit = new QLineEdit;
edit->setObjectName("edit");
edit->setText( "text" );
editgroupLayout->addWidget(edit);
project.addObject(edit);
editgroupLayout->addWidget(new QLabel("Properties: <ul><li>text</li><li>maxLength</li>"
"<li>clear()</li><li>...</li></ul>"));
QWidget *buttonWidget = new QWidget;
QVBoxLayout *buttonLayout = new QVBoxLayout(buttonWidget);
hboxLayout->addWidget(buttonWidget);
// add script buttons
ScriptButton *button1 = new ScriptButton(&project, "Increase Counter", 0, "button1");
buttonLayout->addWidget(button1);
button1->setScriptCode( "Application.lcd.value++;" );
ScriptButton *button2 = new ScriptButton(&project, "Reset Counter", 0, "button2");
buttonLayout->addWidget(button2);
button2->setScriptCode( "Application.lcd.value = 0;" );
ScriptButton *button3 = new ScriptButton(&project, "Convert to uppercase", 0, "button3");
buttonLayout->addWidget(button3);
button3->setScriptCode( "Application.edit.text = Application.edit.text.upper();" );
QPushButton *button4 = new QPushButton("&Quit");
button4->setObjectName("button4");
buttonLayout->addStretch(-1);
buttonLayout->addWidget(button4);
QObject::connect(button4, SIGNAL(clicked()), &app, SLOT(quit()));
// teach interpreter about widgets
project.interpreter()->addWrapperFactory( new WidgetWrapperFactory() );
project.interpreter()->addObjectFactory( new QtNamespaceProvider() );
widget.show();
#else
QMessageBox::information( 0, "Disabled feature",
"QSA Editor has been disabled. Reconfigure to enable",
QMessageBox::Ok );
#endif
return app.exec();
}
示例3: setupUi
void setupUi(QMainWindow *Detection)
{
if (Detection->objectName().isEmpty())
Detection->setObjectName(QString::fromUtf8("Detection"));
Detection->resize(729, 480);
actionE_xit = new QAction(Detection);
actionE_xit->setObjectName(QString::fromUtf8("actionE_xit"));
action_Load_Map = new QAction(Detection);
action_Load_Map->setObjectName(QString::fromUtf8("action_Load_Map"));
action_Connect = new QAction(Detection);
action_Connect->setObjectName(QString::fromUtf8("action_Connect"));
action_Disconnect = new QAction(Detection);
action_Disconnect->setObjectName(QString::fromUtf8("action_Disconnect"));
centralWidget = new QWidget(Detection);
centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
gridLayoutWidget = new QWidget(centralWidget);
gridLayoutWidget->setObjectName(QString::fromUtf8("gridLayoutWidget"));
gridLayoutWidget->setGeometry(QRect(0, 0, 721, 421));
gridLayout = new QGridLayout(gridLayoutWidget);
gridLayout->setSpacing(6);
gridLayout->setContentsMargins(11, 11, 11, 11);
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
gridLayout->setSizeConstraint(QLayout::SetNoConstraint);
gridLayout->setVerticalSpacing(5);
gridLayout->setContentsMargins(0, 0, 0, 0);
ugvFeedLabel = new QLabel(gridLayoutWidget);
ugvFeedLabel->setObjectName(QString::fromUtf8("ugvFeedLabel"));
QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(ugvFeedLabel->sizePolicy().hasHeightForWidth());
ugvFeedLabel->setSizePolicy(sizePolicy);
gridLayout->addWidget(ugvFeedLabel, 1, 2, 1, 1);
connectionButton = new QCommandLinkButton(gridLayoutWidget);
connectionButton->setObjectName(QString::fromUtf8("connectionButton"));
gridLayout->addWidget(connectionButton, 0, 2, 1, 1);
uavFeedLabel = new QLabel(gridLayoutWidget);
uavFeedLabel->setObjectName(QString::fromUtf8("uavFeedLabel"));
sizePolicy.setHeightForWidth(uavFeedLabel->sizePolicy().hasHeightForWidth());
uavFeedLabel->setSizePolicy(sizePolicy);
uavFeedLabel->setMaximumSize(QSize(16777215, 16777215));
gridLayout->addWidget(uavFeedLabel, 1, 0, 1, 1);
ugvMapLabel = new QLabel(gridLayoutWidget);
ugvMapLabel->setObjectName(QString::fromUtf8("ugvMapLabel"));
QSizePolicy sizePolicy1(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding);
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
sizePolicy1.setHeightForWidth(ugvMapLabel->sizePolicy().hasHeightForWidth());
ugvMapLabel->setSizePolicy(sizePolicy1);
gridLayout->addWidget(ugvMapLabel, 1, 3, 1, 1);
horizontalLayout_4 = new QHBoxLayout();
horizontalLayout_4->setSpacing(6);
horizontalLayout_4->setObjectName(QString::fromUtf8("horizontalLayout_4"));
label_2 = new QLabel(gridLayoutWidget);
label_2->setObjectName(QString::fromUtf8("label_2"));
horizontalLayout_4->addWidget(label_2);
uavTakeoffLandButton = new QPushButton(gridLayoutWidget);
uavTakeoffLandButton->setObjectName(QString::fromUtf8("uavTakeoffLandButton"));
horizontalLayout_4->addWidget(uavTakeoffLandButton);
gridLayout->addLayout(horizontalLayout_4, 2, 0, 1, 1);
horizontalLayout_2 = new QHBoxLayout();
horizontalLayout_2->setSpacing(6);
horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2"));
label = new QLabel(gridLayoutWidget);
label->setObjectName(QString::fromUtf8("label"));
horizontalLayout_2->addWidget(label);
ugvSpeedLCD = new QLCDNumber(gridLayoutWidget);
ugvSpeedLCD->setObjectName(QString::fromUtf8("ugvSpeedLCD"));
ugvSpeedLCD->setFrameShape(QFrame::Box);
horizontalLayout_2->addWidget(ugvSpeedLCD);
gridLayout->addLayout(horizontalLayout_2, 4, 2, 1, 1);
horizontalLayout_6 = new QHBoxLayout();
horizontalLayout_6->setSpacing(6);
horizontalLayout_6->setObjectName(QString::fromUtf8("horizontalLayout_6"));
label_3 = new QLabel(gridLayoutWidget);
label_3->setObjectName(QString::fromUtf8("label_3"));
horizontalLayout_6->addWidget(label_3);
ugvSpeakerButton = new QPushButton(gridLayoutWidget);
//.........这里部分代码省略.........