当前位置: 首页>>代码示例>>C++>>正文


C++ QLabel::setObjectName方法代码示例

本文整理汇总了C++中QLabel::setObjectName方法的典型用法代码示例。如果您正苦于以下问题:C++ QLabel::setObjectName方法的具体用法?C++ QLabel::setObjectName怎么用?C++ QLabel::setObjectName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QLabel的用法示例。


在下文中一共展示了QLabel::setObjectName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QVBoxLayout

LoadView::LoadView(QWidget* parent):DropArea( parent )
{

    QVBoxLayout *layout = new QVBoxLayout( this );

    layout->addWidget( tempAccountLbl = new QLabel(
        "<center>Ceci est un compte administrateur temporaire<br>"
        "Veuillez<ol><li>Enregistrer vos coordonnées dans le système en cliquant sur <strong>\"Ajouter\"</strong></li>"
        "<li>Vous rendre dans <strong>\"Réglages\"</strong> afin de créer votre compte administrateur</li></ol></center>"
        ));
    tempAccountLbl->setObjectName( "tempAccountLbl" );
    tempAccountLbl->hide();
    connect( &Socket::sock(), SIGNAL(loggedAsTempAdmin()), SLOT(onLoggedAsTempAdmin()) );
    connect( &Socket::sock(), SIGNAL(loggedAsUser()), SLOT(onLogged()) );
    connect( &Socket::sock(), SIGNAL(loggedAsAdmin()), SLOT(onLogged()) );

    QLabel *loadImageLbl = new QLabel( "Pour commencer" );
    loadImageLbl->setObjectName("loadImageLbl");
    layout->addWidget(loadImageLbl);

    layout->addStretch(0);

    QHBoxLayout *hLayout;
    layout->addLayout( hLayout = new QHBoxLayout() );

        QFrame *dropZone = new QFrame( this );
        dropZone->setObjectName( "dropZone" );
        hLayout->addWidget( dropZone, Qt::AlignCenter );

        QVBoxLayout *dropZoneLayout = new QVBoxLayout( dropZone );
        QLabel *deposezFichierLbl = new QLabel( dropZone );
        deposezFichierLbl->setObjectName( "deposezFichierLbl" );
        deposezFichierLbl->setText( 
        "<center>"
        "Chargez une ou plusieurs photos depuis votre ordinateur"
        "</center>"
        );
        dropZoneLayout->addWidget( deposezFichierLbl, 1, Qt::AlignCenter );

        QPushButton *browseImagesBtn = new QPushButton( dropZone );
        browseImagesBtn->setText( "Séléctionnez des Images" );
        browseImagesBtn->setObjectName( "browseImagesBtn" );
        dropZoneLayout->addWidget( browseImagesBtn, 1, Qt::AlignCenter );

        connect( browseImagesBtn, SIGNAL( clicked() ), SLOT( onBrowseImages() ) );
    
    layout->addStretch(0);

}
开发者ID:riless,项目名称:smoky,代码行数:49,代码来源:LoadView.cpp

示例2: ShowStatusLabels

void QmitkToolTrackingStatusWidget::ShowStatusLabels()
{
  RemoveGuiLabels(); 

  if(m_NavigationDatas == NULL || m_NavigationDatas->size() <= 0)
    return;


  m_StatusLabels = new QVector<QLabel*>();
  mitk::NavigationData* navData;
  QLabel* label;


  for(unsigned int i = 0; i < m_NavigationDatas->size(); i++)
  {
    navData = m_NavigationDatas->at(i).GetPointer();

    QString name(navData->GetName());
   
    label = new QLabel(name, this);
    label->setObjectName(name);
    label->setAlignment(m_Alignment | Qt::AlignVCenter);
    label->setFrameStyle(QFrame::Panel | QFrame::Sunken);

    m_StatusLabels->append(label);
    if (m_Style == QmitkToolTrackingStatusWidget::VerticalUpperStyle) m_Controls->m_VerticalLayout->addWidget(m_StatusLabels->at(i));
    else m_Controls->m_GridLayout->addWidget(m_StatusLabels->at(i),0,i);
    
  }
}
开发者ID:david-guerrero,项目名称:MITK,代码行数:30,代码来源:QmitkToolTrackingStatusWidget.cpp

示例3: QLabel

QWidget *SketchAreaWidget::separator(QWidget* parent) {
	QLabel *separator = new QLabel(parent);
	separator->setPixmap(QPixmap(":/resources/images/toolbar_icons/toolbar_separator.png"));
    separator->setStyleSheet("margin-left: 1px; margin-right: 1px;");
    separator->setObjectName("ToolBarSeparator");
	return separator;
}
开发者ID:BrainsoftLtd,项目名称:fritzing-app,代码行数:7,代码来源:sketchareawidget.cpp

示例4: QGridLayout

TemplateLogoWidget::TemplateLogoWidget() {

	// Init components
	gridLayout = new QGridLayout(this);

	// Set layout
	setLayout(gridLayout);

	// Set ID
	setObjectName("templateLogoWidget");

	// Create logo
	QLabel *logoLabel = new QLabel(this);
	logoLabel->setObjectName("templateLogo");
	logoLabel->setPixmap(QPixmap(":/PowerGrid/Resources/logo.png"));

	// Configure widget
	setContentsMargins(60, 60, 60, 60);

	// Add components
	gridLayout->addWidget(logoLabel, 0, 0);

	// Resize grid
	gridLayout->setRowStretch(1, 1);
}
开发者ID:amirbawab,项目名称:PowerGrid,代码行数:25,代码来源:TemplateLogoWidget.cpp

示例5: slotIdentifyScreens

void BGDialog::slotIdentifyScreens()
{
    // Taken from PositionTab::showIdentify in kdebase/kcontrol/kicker/positiontab_impl.cpp
    for (unsigned s = 0; s < m_numScreens; s++) {
        QLabel *screenLabel = new QLabel(0, Qt::X11BypassWindowManagerHint);
        screenLabel->setObjectName("Screen Identify");

        QFont identifyFont(KGlobalSettings::generalFont());
        identifyFont.setPixelSize(100);
        screenLabel->setFont(identifyFont);

        screenLabel->setFrameStyle(QFrame::Panel);
        screenLabel->setFrameShadow(QFrame::Plain);

        screenLabel->setAlignment(Qt::AlignCenter);
        screenLabel->setNum(int(s + 1));
        // BUGLET: we should not allow the identification to be entered again
        //         until the timer fires.
        QTimer::singleShot(1500, screenLabel, SLOT(deleteLater()));

        QPoint screenCenter(QApplication::desktop()->screenGeometry(s).center());
        QRect targetGeometry(QPoint(0, 0), screenLabel->sizeHint());
        targetGeometry.moveCenter(screenCenter);

        screenLabel->setGeometry(targetGeometry);

        screenLabel->show();
    }
}
开发者ID:aarontc,项目名称:kde-workspace,代码行数:29,代码来源:bgdialog.cpp

示例6: saveRecoveringFile

Q_TK_USING_CONSTANTS

void mfRecovererThread::saveRecoveringFile( mfObject * mfo )
{
     if ( !mfo ) return;

     // Only one recovery at time
     if ( isRunning() ) return;
     stopped = false;
     m_Object = mfo;

     // put an icon into statusbar
     if ( !iconSetted )
     {
          iconSetted = true;
          QLabel * lbl = new QLabel ( mfCore::mainWindow() );
          lbl->setObjectName( "crashicon" );
          lbl->setPixmap( tkTheme::icon(ICONCRASHRECOVER).pixmap(16,16) );
          lbl->setToolTip( QCoreApplication::translate( "mfRecovererThread",
                           "Crash recovering is in action.\n"
                           "Recover your datas after a system or software crash." ) );
          mfCore::mainWindow()->statusBar()->addPermanentWidget( lbl, 0 );
     }

     // Let's go with low priority
     start( LowPriority );
}
开发者ID:Dinesh-Ramakrishnan,项目名称:freemedforms,代码行数:27,代码来源:mfRecovererThread.cpp

示例7: refreshData

void MainWindow::refreshData()
{
  MultimeterAdapter::ReadingsList readings = adapter->getCurrentReadings();

  QList<QLabel *> labels = ui->currentReadings->findChildren<QLabel*>("reading");

  while(readings.count() > labels.count())
  {
    QLabel *label = new QLabel();
    label->setObjectName("reading");
    ui->currentReadings->layout()->addWidget(label);
    labels.append(label);
  }

  while(readings.count() < labels.count())
  {
    delete labels.takeLast();
  }

  for (int i = 0; i < labels.count(); i++)
  {
      QLabel* label = labels.at(i);

      label->setText(QString("%1 %2").arg(readings.at(i).second,5,'f',4).arg(SampleSeries::toString(readings.at(i).first)));

      QPalette palette;

      palette.setColor(QPalette::WindowText, getColor(readings.at(i).first));
      label->setPalette(palette);
  }

  ui->plot->replot();
}
开发者ID:amesser,项目名称:mmgui,代码行数:33,代码来源:mainwindow.cpp

示例8: createLayout

void CollapsibleInspectorHeader::createLayout()
{
  setContentsMargins(0,0,0,0);
  setFixedHeight(50);
  setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Fixed);
  setObjectName("CollapsibleInspectorHeader");
  setCheckable(true);

  QHBoxLayout * mainHLayout = new QHBoxLayout();
  mainHLayout->setContentsMargins(0,0,0,0);
  mainHLayout->setSpacing(10);
  setLayout(mainHLayout);

  // Arrow
  m_arrowLabel = new QLabel();
  mainHLayout->addWidget(m_arrowLabel);

  // Name
  QLabel * textLabel = new QLabel(m_text);
  textLabel->setWordWrap(false);
  textLabel->setObjectName("H2");
  mainHLayout->addWidget(textLabel);

  // Stretch
  mainHLayout->addStretch();

  bool isConnected = connect(this,SIGNAL(toggled(bool)),
                             this,SLOT(on_toggled(bool)));
  OS_ASSERT(isConnected);

  setChecked(false);
}
开发者ID:ORNL-BTRIC,项目名称:OpenStudio,代码行数:32,代码来源:CollapsibleInspector.cpp

示例9: QWidget

blProjectNewFormWidgetLabel::blProjectNewFormWidgetLabel(QWidget *parent) :
    QWidget(parent)
{

    layout = new QVBoxLayout;

    // title
    QLabel *title = new QLabel(tr("Label Extraction"));
    title->setObjectName("blLabelFormHeader1");
    layout->addWidget(title);

    // CheckBoxes
    m_checkBoxFolders = new QCheckBox(tr("Folders"));
    m_checkBoxDate = new QCheckBox(tr("Created Date"));

    layout->addWidget(m_checkBoxDate);
    layout->addWidget(m_checkBoxFolders);

    // View
    QPushButton *viewButton = new QPushButton(tr("View"));
    viewButton->setObjectName("btnPrimary");
    layout->addWidget(viewButton,0, Qt::AlignRight);
    connect(viewButton, SIGNAL(clicked()), this, SLOT(emitView()));

    this->setLayout(layout);
}
开发者ID:sylvainprigent,项目名称:BioImageLab,代码行数:26,代码来源:blProjectNewFormWidgetLabel.cpp

示例10: QWidget

URLWatcherPlugin::URLWatcherPlugin()
{
	viewer_ = new QWidget();
	QVBoxLayout *vboxLayout;
	QFrame *frame;
	QLabel *label;
	vboxLayout = new QVBoxLayout(viewer_);
	vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
	frame = new QFrame(viewer_);
	frame->setObjectName(QString::fromUtf8("frame"));
	frame->setFrameShape(QFrame::StyledPanel);
	frame->setFrameShadow(QFrame::Raised);
	viewerText_ = new QTextEdit(frame);
	viewerText_->setObjectName(QString::fromUtf8("text"));
	viewerText_->setReadOnly(true);

	

	label = new QLabel(viewer_);
	label->setObjectName(QString::fromUtf8("label"));
	label->setText("URLs");
	vboxLayout->addWidget(label);
	vboxLayout->addWidget(viewerText_);
	viewer_->show();
}
开发者ID:AlekSi,项目名称:Jabbin,代码行数:25,代码来源:urlwatcherplugin.cpp

示例11: QFileDialog

ImportDialog::ImportDialog(QWidget* parent) :
    QFileDialog(parent, WINDOW_NAME, DESKTOP_LOCATION, NULL),
    _importButton(IMPORT_BUTTON_NAME, this),
    _cancelButton(CANCEL_BUTTON_NAME, this),
    fileAccepted(false) {

    setOption(QFileDialog::DontUseNativeDialog, true);
    setFileMode(QFileDialog::ExistingFile);
    setViewMode(QFileDialog::Detail);

#ifdef Q_OS_MAC
    QString cmdString = ("Command");
#else
    QString cmdString = ("Control");
#endif
    QLabel* infoLabel = new QLabel(QString(INFO_LABEL_TEXT).arg(cmdString));
    infoLabel->setObjectName("infoLabel");

    QGridLayout* gridLayout = (QGridLayout*) layout();
    gridLayout->addWidget(infoLabel, 2, 0, 2, 1);
    gridLayout->addWidget(&_cancelButton, 2, 1, 2, 1);
    gridLayout->addWidget(&_importButton, 2, 2, 2, 1);

    setImportTypes();
    setLayout();

    connect(&_importButton, SIGNAL(pressed()), SLOT(import()));
    connect(this, SIGNAL(currentChanged(QString)), SLOT(saveCurrentFile(QString)));

    connect(&_cancelButton, SIGNAL(pressed()), SLOT(close()));
    connect(this, SIGNAL(currentChanged(QString)), SLOT(saveCurrentFile(QString)));
}
开发者ID:BogusCurry,项目名称:hifi,代码行数:32,代码来源:ImportDialog.cpp

示例12: createLayout

void CollapsibleInspectorHeader::createLayout()
{
  setContentsMargins(0,0,0,0);
  setFixedHeight(50);
  setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Fixed);
  setObjectName("CollapsibleInspectorHeader");
  setCheckable(true);

  QHBoxLayout * mainHLayout = new QHBoxLayout();
  mainHLayout->setContentsMargins(10,0,10,0);
  mainHLayout->setSpacing(7);
  setLayout(mainHLayout);

  // Arrow
  m_arrowLabel = new QLabel();
  mainHLayout->addWidget(m_arrowLabel, 0, Qt::AlignLeft);

  // Name
  QLabel * textLabel = new QLabel(m_text);
  textLabel->setWordWrap(false);
  textLabel->setObjectName("H2");
  mainHLayout->addWidget(textLabel, 0, Qt::AlignLeft);

  // Stretch
  mainHLayout->addStretch();

  connect(this, &CollapsibleInspectorHeader::toggled, this, &CollapsibleInspectorHeader::on_toggled);

  setChecked(false);
}
开发者ID:pepsi7959,项目名称:OpenStudio,代码行数:30,代码来源:CollapsibleInspector.cpp

示例13: lendMedium

/**
 * @brief MainWindow::lendMedium fügt Ausleih-Relation in Datenbank ein und passt UI an
 * @param mediumID ID des auszuleihenden Mediums
 * @param personID ID der Person, die Medium ausleiht
 */
void MainWindow::lendMedium(int mediumID, int personID){
    /// Zur Datenbank hinzufügen
    lendlib->addLendEntry(mediumID, personID);
    /// ins UI einfügen:
    QString mediumIDs = QString::number(mediumID);
    QString personIDs = QString::number(personID);
    QString mediumS = lendlib->getMediumEntry(mediumID)->getTitle();
    QString personS = lendlib->getPersonEntry(personID)->getFullName();
    /// - sowohl in Medienliste
    ui->allMediaScroll->findChild<QLabel*>("lendee"+mediumIDs)->setText(personS);
    ui->allMediaScroll->findChild<QPushButton*>("retlend"+mediumIDs)->setText("Zurück geben");
    ui->allMediaScroll->findChild<QPushButton*>("retlend"+mediumIDs)->setToolTip("Gebe Medium "+mediumIDs+" zurück.");
    QString type = "";
    MType mType =  lendlib->getMediumEntry(mediumID)->getType();
    switch (mType){
    case book:
        type=" (Buch)";
        break;
    case cd:
        type=" (CD)";
        break;
    case dvd:
        type=" (DVD)";
        break;
    default:
        break;
    }
    QLabel *lentItem = new QLabel(mediumS+type);
    lentItem->setObjectName("lentItem"+mediumIDs);
    /// als auch in Personenliste
    ui->allPersonsScroll->findChild<QWidget*>("lent"+personIDs)->layout()->addWidget(lentItem);
}
开发者ID:Nos-,项目名称:htw,代码行数:37,代码来源:mainwindow.cpp

示例14: populateStore

void MainWindow::populateStore()
{

    int row = 0;
    int i = 0;
    for(auto item : store) {
        QString name(item.first.c_str());
        QString price(QString::number(item.second));
        QPushButton *button = new QPushButton(name);
        QLabel *label = new QLabel("$"+price);
        button->setObjectName(name);
        label->setObjectName(price);
        shopSignalMapper->setMapping(button, name);
        connect(button, SIGNAL(clicked()), shopSignalMapper, SLOT(map()));
        label->setAlignment(Qt::AlignCenter);
        ui->shopLayout->addWidget(button, row, i, Qt::AlignCenter);
        ui->shopLayout->addWidget(label, row+1, i, Qt::AlignCenter);
        QSize widgetSize(50, 50);
        button->setFixedSize(widgetSize);
        label->setFixedSize(widgetSize);
        i++;
        if(i == 9) {
            i = 0;
            row += 2;
        }
    }
}
开发者ID:vladimiroff,项目名称:regularity,代码行数:27,代码来源:mainwindow.cpp

示例15: QVBoxLayout

void tst_QWidget_window::tst_updateWinId_QTBUG40681()
{
    QWidget w;
    QVBoxLayout *vl = new QVBoxLayout(&w);
    QLabel *lbl = new QLabel("HELLO1");
    lbl->setAttribute(Qt::WA_NativeWindow);
    lbl->setObjectName("label1");
    vl->addWidget(lbl);
    w.setMinimumWidth(200);

    w.show();

    QVERIFY(QTest::qWaitForWindowExposed(&w));

    QCOMPARE(lbl->winId(), lbl->windowHandle()->winId());

     // simulate screen change and notification
    QWindow *win = w.windowHandle();
    w.windowHandle()->destroy();
    lbl->windowHandle()->destroy();
    w.windowHandle()->create();
    lbl->windowHandle()->create();
    QWindowPrivate *p = qt_window_private(win);
    p->emitScreenChangedRecursion(win->screen());

    QCOMPARE(lbl->winId(), lbl->windowHandle()->winId());
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:27,代码来源:tst_qwidget_window.cpp


注:本文中的QLabel::setObjectName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。