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


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

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


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

示例1: QWidget

StandardsInformationMaterialWidget::StandardsInformationMaterialWidget(bool isIP, QGridLayout * mainGridLayout, int & row)
  : QWidget(mainGridLayout->parentWidget())
{
  QVBoxLayout * vLayout = nullptr;

  QLabel * label = nullptr;

  bool isConnected = false;

  // Measure Tags
  QFrame * line;
  line = new QFrame();
  line->setFrameShape(QFrame::HLine);
  line->setFrameShadow(QFrame::Sunken);
  mainGridLayout->addWidget(line, row++, 0, 1, 3);

  label = new QLabel();
  label->setText("Measure Tags (Optional):");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label, row++, 0);

  // Standard
  vLayout = new QVBoxLayout();

  label = new QLabel();
  label->setText("Standard: ");
  label->setObjectName("StandardsInfo");
  vLayout->addWidget(label);

  m_standard = new QComboBox();
  m_standard->setEditable(true);
  m_standard->setDuplicatesEnabled(false);
  m_standard->setFixedWidth(OSItem::ITEM_WIDTH);
  vLayout->addWidget(m_standard);

  mainGridLayout->addLayout(vLayout, row, 0);

  isConnected = connect(m_standard, &QComboBox::currentTextChanged, this, &openstudio::StandardsInformationMaterialWidget::standardChanged);
  OS_ASSERT(isConnected);

  // Standard Source
  vLayout = new QVBoxLayout();

  label = new QLabel();
  label->setText("Standard Source: ");
  label->setObjectName("StandardsInfo");
  vLayout->addWidget(label);

  m_standardSource = new QComboBox();
  m_standardSource->setEditable(true);
  m_standardSource->setDuplicatesEnabled(false);
  m_standardSource->setFixedWidth(OSItem::ITEM_WIDTH);
  vLayout->addWidget(m_standardSource);

  mainGridLayout->addLayout(vLayout, row++, 1);

  isConnected = connect(m_standardSource, &QComboBox::currentTextChanged, this, &openstudio::StandardsInformationMaterialWidget::standardSourceChanged);
  OS_ASSERT(isConnected);

  // Standards Category
  vLayout = new QVBoxLayout();

  label = new QLabel();
  label->setText("Standards Category: ");
  label->setObjectName("StandardsInfo");
  vLayout->addWidget(label);

  m_standardsCategory = new QComboBox();
  m_standardsCategory->setEditable(true);
  m_standardsCategory->setDuplicatesEnabled(false);
  m_standardsCategory->setFixedWidth(OSItem::ITEM_WIDTH);
  vLayout->addWidget(m_standardsCategory);

  mainGridLayout->addLayout(vLayout, row, 0);

  isConnected = connect(m_standardsCategory, &QComboBox::currentTextChanged, this, &openstudio::StandardsInformationMaterialWidget::standardsCategoryChanged);
  OS_ASSERT(isConnected);

  // Standards Identifier
  vLayout = new QVBoxLayout();

  label = new QLabel();
  label->setText("Standards Identifier: ");
  label->setObjectName("StandardsInfo");
  vLayout->addWidget(label);

  m_standardsIdentifier = new QComboBox();
  m_standardsIdentifier->setEditable(true);
  m_standardsIdentifier->setDuplicatesEnabled(false);
  m_standardsIdentifier->setFixedWidth(OSItem::ITEM_WIDTH);
  vLayout->addWidget(m_standardsIdentifier);

  mainGridLayout->addLayout(vLayout, row++, 1);

  isConnected = connect(m_standardsIdentifier, &QComboBox::currentTextChanged, this, &openstudio::StandardsInformationMaterialWidget::standardsIdentifierChanged);
  OS_ASSERT(isConnected);

  // Composite Framing Material
  vLayout = new QVBoxLayout();

//.........这里部分代码省略.........
开发者ID:jtanaa,项目名称:OpenStudio,代码行数:101,代码来源:StandardsInformationMaterialWidget.cpp

示例2: cfg

SplitterGUI::SplitterGUI(QWidget* parent,  QUrl fileURL, QUrl defaultDir) :
        QDialog(parent),
        userDefinedSize(0x100000), lastSelectedDevice(-1), resultCode(QDialog::Rejected),
        division(1)
{
    setModal(true);

    QGridLayout *grid = new QGridLayout(this);
    grid->setSpacing(6);
    grid->setContentsMargins(11, 11, 11, 11);

    QLabel *splitterLabel = new QLabel(this);
    splitterLabel->setText(i18n("Split the file %1 to folder:", fileURL.toDisplayString(QUrl::PreferLocalFile)));
    splitterLabel->setMinimumWidth(400);
    grid->addWidget(splitterLabel, 0 , 0);

    urlReq = new KUrlRequester(this);
    urlReq->setUrl(defaultDir);
    urlReq->setMode(KFile::Directory);
    grid->addWidget(urlReq, 1 , 0);

    QWidget *splitSizeLine = new QWidget(this);
    QHBoxLayout * splitSizeLineLayout = new QHBoxLayout;
    splitSizeLineLayout->setContentsMargins(0, 0, 0, 0);
    splitSizeLine->setLayout(splitSizeLineLayout);

    deviceCombo = new QComboBox(splitSizeLine);
    for (int i = 0; i != predefinedDevices().count(); i++)
        deviceCombo->addItem(predefinedDevices()[i].name);
    deviceCombo->addItem(i18n("User Defined"));
    splitSizeLineLayout->addWidget(deviceCombo);

    QLabel *spacer = new QLabel(splitSizeLine);
    spacer->setText(" ");
    spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
    splitSizeLineLayout->addWidget(spacer);

    QLabel *bytesPerFile = new QLabel(splitSizeLine);
    bytesPerFile->setText(i18n("Max file size:"));
    splitSizeLineLayout->addWidget(bytesPerFile);

    spinBox = new QDoubleSpinBox(splitSizeLine);
    spinBox->setMaximum(9999999999.0);
    spinBox->setMinimumWidth(85);
    spinBox->setEnabled(false);
    splitSizeLineLayout->addWidget(spinBox);

    sizeCombo = new QComboBox(splitSizeLine);
    sizeCombo->addItem(i18n("Byte"));
    sizeCombo->addItem(i18n("kByte"));
    sizeCombo->addItem(i18n("MByte"));
    sizeCombo->addItem(i18n("GByte"));
    splitSizeLineLayout->addWidget(sizeCombo);

    grid->addWidget(splitSizeLine, 2 , 0);

    overwriteCb = new QCheckBox(i18n("Overwrite files without confirmation"), this);
    grid->addWidget(overwriteCb, 3, 0);

    QFrame *separator = new QFrame(this);
    separator->setFrameStyle(QFrame::HLine | QFrame::Sunken);
    separator->setFixedHeight(separator->sizeHint().height());

    grid->addWidget(separator, 4 , 0);

    QHBoxLayout *splitButtons = new QHBoxLayout;
    splitButtons->setSpacing(6);
    splitButtons->setContentsMargins(0, 0, 0, 0);

    QSpacerItem* spacer2 = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
    splitButtons->addItem(spacer2);

    QPushButton *splitBtn = new QPushButton(this);
    splitBtn->setText(i18n("&Split"));
    splitBtn->setIcon(QIcon::fromTheme("dialog-ok"));
    splitButtons->addWidget(splitBtn);

    QPushButton *cancelBtn = new QPushButton(this);
    cancelBtn->setText(i18n("&Cancel"));
    cancelBtn->setIcon(QIcon::fromTheme("dialog-cancel"));
    splitButtons->addWidget(cancelBtn);

    grid->addLayout(splitButtons, 5 , 0);

    setWindowTitle(i18n("Krusader::Splitter"));


    KConfigGroup cfg(KSharedConfig::openConfig(), QStringLiteral("Splitter"));
    overwriteCb->setChecked(cfg.readEntry("OverWriteFiles", false));

    connect(sizeCombo, SIGNAL(activated(int)), this, SLOT(sizeComboActivated(int)));
    connect(deviceCombo, SIGNAL(activated(int)), this, SLOT(predefinedComboActivated(int)));
    connect(cancelBtn, SIGNAL(clicked()), this, SLOT(reject()));
    connect(splitBtn , SIGNAL(clicked()), this, SLOT(splitPressed()));

    predefinedComboActivated(0);
    resultCode = exec();
}
开发者ID:aremai,项目名称:krusader,代码行数:98,代码来源:splittergui.cpp

示例3: QGridLayout


//.........这里部分代码省略.........
    TBW_infattack = new ToggleButtonWidget(gbGameModes, ":/res/[email protected]");
    TBW_infattack->setWhatsThis(tr("Attacking does not end your turn."));
    glGMLayout->addWidget(TBW_infattack,3,3,1,1);

    TBW_resetweps = new ToggleButtonWidget(gbGameModes, ":/res/[email protected]");
    TBW_resetweps->setWhatsThis(tr("Weapons are reset to starting values each turn."));
    glGMLayout->addWidget(TBW_resetweps,3,4,1,1);

    TBW_perhogammo = new ToggleButtonWidget(gbGameModes, ":/res/[email protected]");
    TBW_perhogammo->setWhatsThis(tr("Each hedgehog has its own ammo. It does not share with the team."));
    glGMLayout->addWidget(TBW_perhogammo,4,0,1,1);

    TBW_nowind = new ToggleButtonWidget(gbGameModes, ":/res/[email protected]");
    TBW_nowind->setWhatsThis(tr("You will not have to worry about wind anymore."));
    glGMLayout->addWidget(TBW_nowind,4,1,1,1);

    TBW_morewind = new ToggleButtonWidget(gbGameModes, ":/res/[email protected]");
    TBW_morewind->setWhatsThis(tr("Wind will affect almost everything."));
    glGMLayout->addWidget(TBW_morewind,4,2,1,1);

    TBW_tagteam = new ToggleButtonWidget(gbGameModes, ":/res/[email protected]");
    TBW_tagteam->setWhatsThis(tr("Teams in each clan take successive turns sharing their turn time."));
    glGMLayout->addWidget(TBW_tagteam,4,3,1,1);

    TBW_bottomborder = new ToggleButtonWidget(gbGameModes, ":/res/[email protected]");
    TBW_bottomborder->setWhatsThis(tr("Add an indestructible border along the bottom"));
    glGMLayout->addWidget(TBW_bottomborder,4,4,1,1);


    // Right
    QLabel * l;

    l = new QLabel(gbBasicSettings);
    l->setText(QLabel::tr("Damage Modifier"));
    l->setWordWrap(true);
    glBSLayout->addWidget(l,0,0,1,1);
    l = new QLabel(gbBasicSettings);
    l->setFixedSize(32,32);
    l->setPixmap(QPixmap(":/res/iconDamage.png"));
    glBSLayout->addWidget(l,0,1,1,1);
    SB_DamageModifier = new QSpinBox(gbBasicSettings);
    SB_DamageModifier->setRange(10, 300);
    SB_DamageModifier->setValue(100);
    SB_DamageModifier->setSingleStep(25);
    glBSLayout->addWidget(SB_DamageModifier,0,2,1,1);

    l = new QLabel(gbBasicSettings);
    l->setText(QLabel::tr("Turn Time"));
    l->setWordWrap(true);
    glBSLayout->addWidget(l,1,0,1,1);
    l = new QLabel(gbBasicSettings);
    l->setFixedSize(32,32);
    l->setPixmap(QPixmap(":/res/iconTime.png"));
    glBSLayout->addWidget(l,1,1,1,1);
    SB_TurnTime = new QSpinBox(gbBasicSettings);
    SB_TurnTime->setRange(1, 9999);
    SB_TurnTime->setValue(45);
    SB_TurnTime->setSingleStep(15);
    glBSLayout->addWidget(SB_TurnTime,1,2,1,1);

    l = new QLabel(gbBasicSettings);
    l->setText(QLabel::tr("Initial Health"));
    l->setWordWrap(true);
    glBSLayout->addWidget(l,2,0,1,1);
    l = new QLabel(gbBasicSettings);
    l->setFixedSize(32,32);
开发者ID:GhostAlgorithm,项目名称:hw,代码行数:67,代码来源:pagescheme.cpp

示例4: image

AboutDialog::AboutDialog(QWidget *parent)
	: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
{
	setWindowTitle(tr("About"));
	setWindowIcon(QIcon(":/res/hn_logo.png"));
	setFixedSize(350, 230);
	
	
	QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok, Qt::Horizontal, this);
	connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
	
	
	QLabel *lblLogo = new QLabel(this);
	QImage image(":res/hn_logo.png");
	lblLogo->setPixmap(QPixmap::fromImage(image));
	
	
	QLabel *lblProjectname = new QLabel("<qt><b><font size=+3>Vale Do Poker</font></b></qt>", this);
	
	
	QLabel *lblVersion = new QLabel("<qt><b>" +
					tr("v. %1.%2.%3")
						.arg(VERSION_MAJOR)
						.arg(VERSION_MINOR)
						.arg(VERSION_REVISION) + "</b> <i>(" +
						QString("SVN %1").arg(VERSIONSTR_SVN) + 
					")</i></qt>",
					 this);
	
	
	QLabel *lblLicense = new QLabel(tr("protegido pela GPLv3"));
	
	QLabel *lblCopyright = new QLabel("Software baseado nos trabalhos do time &\nHoldingNuts.", this);
	
	QLabel *lblWebsite = new QLabel(this);
	lblWebsite->setText("<qt><a href=\"http://www.valedopoker.net/\">http://www.valedopoker.net/</a></qt>");
	connect(lblWebsite, SIGNAL(linkActivated(const QString&)), this, SLOT(actionHyperlink(const QString&)));
	
	
	QLabel *lblMail = new QLabel(this);
	lblMail->setText("<qt><a href=\"mailto:[email protected]\">[email protected]</a></qt>");
	connect(lblMail, SIGNAL(linkActivated(const QString&)), this, SLOT(actionHyperlink(const QString&)));
	
	
	QVBoxLayout *contentLayout = new QVBoxLayout;
	contentLayout->addWidget(lblProjectname);
	contentLayout->addWidget(lblVersion);
	contentLayout->addWidget(lblLicense);
	contentLayout->addWidget(lblCopyright);
	contentLayout->addWidget(lblWebsite);
	contentLayout->addWidget(lblMail);
	
	QHBoxLayout *baseLayout = new QHBoxLayout;
	baseLayout->addWidget(lblLogo, 30, Qt::AlignHCenter | Qt::AlignTop);
	baseLayout->addLayout(contentLayout, 70);
	
	QVBoxLayout *mainLayout = new QVBoxLayout;
	mainLayout->addLayout(baseLayout);
	mainLayout->addWidget(buttonBox, 0, Qt::AlignBottom);
	setLayout(mainLayout);
}
开发者ID:mfmarlonferrari,项目名称:maxpokerclub,代码行数:61,代码来源:AboutDialog.cpp

示例5: brush

OverviewWidget::OverviewWidget(QWidget* parent, NetworkEvaluator* networkEval)
    : QWidget(parent)
    , duration_(1200)
    , zoom_(1)
    , viewportWidth_(500)
    , scrollBarPosition_(0)
    , canvasRenderer_(0)
    , networkEvaluator_(networkEval)
    , currentFrame_(0)
    , fps_(30)
    , autoPreview_(false)
{
    canvasRenderer_ = 0;
    previews_.clear();
    QHBoxLayout* mainLayout = new QHBoxLayout(this);

    mainLayout->setMargin(1);
    mainLayout->setSpacing(1);
    setFixedHeight(110);

    overviewScene_ = new QGraphicsScene(this);

    overviewView_ = new OverviewView(overviewScene_, this);

    highlightBar_ = new QGraphicsRectItem();
    overviewView_->setBar(highlightBar_);
    highlightBar_->setZValue(2);
    highlightBar_->setPen(QPen(Qt::DotLine));
    QLinearGradient gradient1(0,0,0, 40 );
    gradient1.setSpread(QGradient::ReflectSpread);
    gradient1.setColorAt(0.0, QColor(20, 100 ,100, 30));
    gradient1.setColorAt(1.0, QColor(80, 100 ,100, 30));
    QBrush brush(gradient1);
    highlightBar_->setBrush(gradient1);
    overviewScene_->addItem(highlightBar_);
    highlight_ = new QGraphicsRectItem();
    highlight_->setPen(QPen(Qt::DotLine));
    QLinearGradient gradient(0,0,0, 40 );
    gradient.setSpread(QGradient::ReflectSpread);
    gradient.setColorAt(0.0, QColor(120, 100 ,100, 30));
    gradient.setColorAt(1.0, QColor(100, 100 ,100, 30));
    highlight_->setBrush(gradient);
    overviewScene_->addItem(highlight_);

    overviewView_->setStyleSheet("background:transparent");
    connect(overviewView_, SIGNAL(currentFrameChanged(int)), this, SIGNAL(currentFrameChanged(int)));
    connect(overviewView_, SIGNAL(contextMenuRequest(QPoint)), this, SLOT(contextMenuRequest(QPoint)));
    connect(overviewView_, SIGNAL(barMovement(int)), this, SIGNAL(barMovement(int)));
    connect(this, SIGNAL(offsetCorrection(int)), overviewView_, SLOT(offsetCorrection(int)));

    overviewView_->setGeometry(QRect(0, 0, duration_, 50));
    overviewView_->setSceneRect(QRect(0, 0, duration_, 50));
    overviewView_->setCurrentFrame(0);

    mainLayout->addWidget(overviewView_);
    QLabel* nameLabel = new QLabel(this);
    nameLabel->lower();
    nameLabel->move(8, 45);
    nameLabel->setText(QString::fromStdString("Overview"));

    if (canvasRenderer_) {
        const std::vector<Port*> port = canvasRenderer_->getInports();
        if (port.size() == 1) {
            if(dynamic_cast<RenderPort*>(port.at(0)) != 0)
                renderPort_ = dynamic_cast<RenderPort*>(port.at(0));
        }
    }
    setStandardRenderport();
}
开发者ID:bsmr-opengl,项目名称:voreen,代码行数:69,代码来源:overviewwidget.cpp

示例6: QWidget


//.........这里部分代码省略.........
    //
    d->l_right = new QVBoxLayout;
    tl_layout->addLayout(d->l_right, 0, 2);

    //
    // Add the palette table
    //
    d->table = new KColorTable(this);
    d->l_right->addWidget(d->table, 10);

    connect(d->table, SIGNAL(colorSelected(const QColor &, const QString &)),
            SLOT(slotColorSelected(const QColor &, const QString &)));

    connect(
        d->table,
        SIGNAL(colorDoubleClicked(const QColor &, const QString &)),
        SLOT(slotColorDoubleClicked(const QColor &, const QString &))
    );
    // Store the default value for saving time.
    d->originalPalette = d->table->name();

    //
    // a little space between
    //
    d->l_right->addSpacing(10);

    QHBoxLayout *l_hbox = new QHBoxLayout();
    d->l_right->addItem(l_hbox);

    //
    // The add to custom colors button
    //
    QPushButton *addButton = new QPushButton(this);
    addButton->setText(tr("&Add to Custom Colors"));
    l_hbox->addWidget(addButton, 0, Qt::AlignLeft);
    connect(addButton, SIGNAL(clicked()), SLOT(slotAddToCustomColors()));

    //
    // The color picker button
    //
    QPushButton* button = new QPushButton(this);
    button->setIcon(QIcon("color-picker"));
    int commonHeight = addButton->sizeHint().height();
    button->setFixedSize(commonHeight, commonHeight);
    l_hbox->addWidget(button, 0, Qt::AlignHCenter);
    connect(button, SIGNAL(clicked()), SLOT(slotColorPicker()));

    //
    // a little space between
    //
    d->l_right->addSpacing(10);

    //
    // and now the entry fields and the patch (=colored box)
    //
    QGridLayout *l_grid = new QGridLayout();
    d->l_right->addLayout(l_grid);

    l_grid->setColumnStretch(2, 1);

    label = new QLabel(this);
    label->setText(tr("Name:"));
    l_grid->addWidget(label, 0, 1, Qt::AlignLeft);

    d->colorName = new QLabel(this);
    l_grid->addWidget(d->colorName, 0, 2, Qt::AlignLeft);
开发者ID:Geekking,项目名称:lima,代码行数:67,代码来源:kcolordialog.cpp

示例7: ModelObjectInspectorView

BuildingStoryInspectorView::BuildingStoryInspectorView(const openstudio::model::Model& model, QWidget * parent )
  : ModelObjectInspectorView(model, true, parent)
{
  QWidget* hiddenWidget = new QWidget();
  this->stackedWidget()->insertWidget(0, hiddenWidget);

  QWidget* visibleWidget = new QWidget();
  this->stackedWidget()->insertWidget(1, visibleWidget);

  this->stackedWidget()->setCurrentIndex(0);

  QGridLayout* mainGridLayout = new QGridLayout();
  mainGridLayout->setContentsMargins(7,7,7,7);
  mainGridLayout->setSpacing(14);
  visibleWidget->setLayout(mainGridLayout);

  // name
  QVBoxLayout* vLayout = new QVBoxLayout();

  QLabel* label = new QLabel();
  label->setText("Name: ");
  label->setStyleSheet("QLabel { font: bold; }");
  vLayout->addWidget(label);

  m_nameEdit = new OSLineEdit();
  vLayout->addWidget(m_nameEdit);

  mainGridLayout->addLayout(vLayout,0,0,1,2, Qt::AlignTop);

  // floor height and floor to floor height
  //vLayout = new QVBoxLayout();

  //label = new QLabel();
  //label->setText("Floor Height: ");
  //label->setStyleSheet("QLabel { font: bold; }");
  //vLayout->addWidget(label);

  //m_floorHeightEdit = new OSQuantityEdit(m_isIP);
  //isConnected = connect(this, SIGNAL(toggleUnitsClicked(bool)), , SLOT(onUnitSystemChange(bool)));
  //OS_ASSERT(isConnected);
  //vLayout->addWidget(m_floorHeightEdit);

  //mainGridLayout->addLayout(vLayout,1,0, Qt::AlignTop|Qt::AlignLeft);

  //vLayout = new QVBoxLayout();

  //label = new QLabel();
  //label->setText("Floor To Floor Height: ");
  //label->setStyleSheet("QLabel { font: bold; }");
  //vLayout->addWidget(label);

  //m_floorToFloorHeightEdit = new OSQuantityEdit(m_isIP);
  //isConnected = connect(this, SIGNAL(toggleUnitsClicked(bool)), , SLOT(onUnitSystemChange(bool)));
  //OS_ASSERT(isConnected);
  //vLayout->addWidget(m_floorToFloorHeightEdit);

  //mainGridLayout->addLayout(vLayout,1,1, Qt::AlignTop|Qt::AlignLeft);

  // default construction and schedule sets
  vLayout = new QVBoxLayout();

  label = new QLabel();
  label->setText("Default Construction Set: ");
  label->setStyleSheet("QLabel { font: bold; }");
  vLayout->addWidget(label);

  // this controller will be owned by the drop zone
  m_defaultConstructionSetVectorController = new BuildingStoryDefaultConstructionSetVectorController();
  m_defaultConstructionSetDropZone = new OSDropZone(m_defaultConstructionSetVectorController);
  m_defaultConstructionSetDropZone->setMinItems(0);
  m_defaultConstructionSetDropZone->setMaxItems(1);
  m_defaultConstructionSetDropZone->setItemsAcceptDrops(true);
  vLayout->addWidget(m_defaultConstructionSetDropZone);

  mainGridLayout->addLayout(vLayout,1,0);

  vLayout = new QVBoxLayout();

  label = new QLabel();
  label->setText("Default Schedule Set: ");
  label->setStyleSheet("QLabel { font: bold; }");
  vLayout->addWidget(label);

  // this controller will be owned by the drop zone
  m_defaultScheduleSetVectorController = new BuildingStoryDefaultScheduleSetVectorController();
  m_defaultScheduleSetDropZone = new OSDropZone(m_defaultScheduleSetVectorController);
  m_defaultScheduleSetDropZone->setMinItems(0);
  m_defaultScheduleSetDropZone->setMaxItems(1);
  m_defaultScheduleSetDropZone->setItemsAcceptDrops(true);
  vLayout->addWidget(m_defaultScheduleSetDropZone);

  mainGridLayout->addLayout(vLayout,1,1);

  // rendering color
  m_renderingColorWidget = new RenderingColorWidget();
  mainGridLayout->addWidget(m_renderingColorWidget,2,0,1,2, Qt::AlignTop|Qt::AlignLeft);

  // spaces
  //vLayout = new QVBoxLayout();

//.........这里部分代码省略.........
开发者ID:CraigCasey,项目名称:OpenStudio,代码行数:101,代码来源:BuildingStoryInspectorView.cpp

示例8: rx

Donate::Donate(QWidget *parent) : QDialog(parent)
{
    resize(400, 0);
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

    // Initialize "Thanks" section:

    QString thanks = QString("<hr>%1:<br>").arg(tr("Thank you for your support"));

    QRegExp rx("\\((.+)\\)");
    rx.setMinimal(true);

    QFile inputFile(APPDIR + "/authors.txt");
    if (inputFile.open(QIODevice::ReadOnly)) {

        QTextStream stream(&inputFile);

        while (!stream.atEnd()) {

            QString line = stream.readLine();

            if (line == "Supported by:") {
                while (!line.isEmpty() && !stream.atEnd()) {
                    line = stream.readLine();
                    line = line.replace(rx, "(<a href=\"\\1\">\\1</a>)");
                    thanks += line + "<br>";
                }
                thanks.chop(8);
                break;
            }
        }

        inputFile.close();
    }

    // Create GUI:

    QGridLayout *grid = new QGridLayout(this);
    QLabel *donators = new QLabel(this);
    donators->setAlignment(Qt::AlignCenter);
    donators->setTextFormat(Qt::RichText);
    donators->setOpenExternalLinks(true);
    donators->setText(thanks);

    QLabel *titlePayPal = new QLabel("PayPal", this);
    QLabel *titleBitCoin = new QLabel("BitCoin", this);
    QLineEdit *fieldPayPal = new QLineEdit(PAYPAL, this);
    QLineEdit *fieldBitCoin = new QLineEdit(BITCOIN, this);
    fieldPayPal->setReadOnly(true);
    fieldBitCoin->setReadOnly(true);
    fieldPayPal->setCursor(Qt::IBeamCursor);
    fieldBitCoin->setCursor(Qt::IBeamCursor);

    QToolButton *btnPayPal = new QToolButton(this);
    QToolButton *btnBitCoin = new QToolButton(this);
    btnPayPal->setIcon(QIcon(":/gfx/actions/copy.png"));
    btnBitCoin->setIcon(QIcon(":/gfx/actions/copy.png"));
    btnPayPal->setToolTip(tr("Copy to Clipboard"));
    btnBitCoin->setToolTip(tr("Copy to Clipboard"));

    QPushButton *btnOk = new QPushButton("OK", this);

    grid->addWidget(titlePayPal, 0, 0);
    grid->addWidget(fieldPayPal, 0, 1);
    grid->addWidget(btnPayPal, 0, 2);
    grid->addWidget(titleBitCoin, 1, 0);
    grid->addWidget(fieldBitCoin, 1, 1);
    grid->addWidget(btnBitCoin, 1, 2);
    grid->addWidget(btnOk, 2, 1);
    grid->addWidget(donators, 3, 1);

    connect(btnPayPal, SIGNAL(clicked()), this, SLOT(copyPayPal()));
    connect(btnBitCoin, SIGNAL(clicked()), this, SLOT(copyBitCoin()));
    connect(btnOk, SIGNAL(clicked()), this, SLOT(accept()));
}
开发者ID:nimloc,项目名称:apk-icon-editor,代码行数:75,代码来源:dialogs.cpp

示例9: QWidget

FlickrWidget::FlickrWidget(QWidget* parent, KIPI::Interface *iface, const QString& serviceName)
            : QWidget(parent)
{
    setObjectName("FlickrWidget");

    QVBoxLayout* flickrWidgetLayout = new QVBoxLayout(this);

    m_photoView         = 0; //new KHTMLPart(splitter);
    KSeparator *line    = new KSeparator(Qt::Horizontal, this);
    m_tab               = new KTabWidget(this);
    QLabel *headerLabel = new QLabel(this);
    headerLabel->setOpenExternalLinks(true);
    headerLabel->setFocusPolicy(Qt::NoFocus);
    if (serviceName == "23hq")
        headerLabel->setText(i18n("<b><h2><a href='http://www.23hq.com'>"
                                  "<font color=\"#7CD164\">23hq</font>"
                                  " Export"
                                  "</h2></b>"));
    else
        headerLabel->setText(i18n("<b><h2><a href='http://www.flickr.com'>"
                                  "<font color=\"#0065DE\">flick</font>"
                                  "<font color=\"#FF0084\">r</font></a>"
                                  " Export"
                                  "</h2></b>"));

    // -------------------------------------------------------------------

    m_imglst  = new KIPIPlugins::ImagesList(iface, m_tab);
    m_imglst->setAllowRAW(true);
    m_imglst->loadImagesFromCurrentSelection();
    m_imglst->listView()->setWhatsThis(i18n("This is the list of images to upload on your Flickr account."));

    QWidget* settingsBox           = new QWidget(m_tab);
    QVBoxLayout* settingsBoxLayout = new QVBoxLayout(settingsBox);

    QGridLayout* albumsSettingsLayout = new QGridLayout();
    QLabel* albumLabel = new QLabel(i18n("PhotoSet:"), settingsBox);
    m_newAlbumBtn = new QPushButton(settingsBox);
    m_newAlbumBtn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    m_newAlbumBtn->setText(i18n("&New PhotoSet"));
    m_albumsListComboBox = new KComboBox(settingsBox);
    albumsSettingsLayout->addWidget(albumLabel, 0, 0, 1, 1);
    albumsSettingsLayout->addWidget(m_albumsListComboBox, 0, 1, 1, 1);
    albumsSettingsLayout->addWidget(m_newAlbumBtn, 0, 2, 1, 1);
    albumsSettingsLayout->setColumnStretch(1, 10);
	
    QGridLayout* tagsLayout  = new QGridLayout();
    QLabel* tagsLabel        = new QLabel(i18n("Added Tags: "), settingsBox);
    m_tagsLineEdit           = new KLineEdit(settingsBox);
    m_exportHostTagsCheckBox = new QCheckBox(settingsBox);
    m_exportHostTagsCheckBox->setText(i18n("Use Host Application Tags"));
    m_stripSpaceTagsCheckBox = new QCheckBox(settingsBox);
    m_stripSpaceTagsCheckBox->setText(i18n("Strip Space From Host Application Tags"));
    m_tagsLineEdit->setToolTip(i18n("Enter here new tags separated by space."));

    tagsLayout->addWidget(tagsLabel,                0, 0);
    tagsLayout->addWidget(m_tagsLineEdit,           0, 1);
    tagsLayout->addWidget(m_exportHostTagsCheckBox, 1, 1);
    tagsLayout->addWidget(m_stripSpaceTagsCheckBox, 2, 1);

    // ------------------------------------------------------------------------

    QGroupBox* optionsBox         = new QGroupBox(i18n("Override Default Options"), settingsBox);
    QGridLayout* optionsBoxLayout = new QGridLayout(optionsBox);

    m_publicCheckBox = new QCheckBox(optionsBox);
    m_publicCheckBox->setText(i18nc("As in accessible for people", "Public (anyone can see them)"));

    m_familyCheckBox = new QCheckBox(optionsBox);
    m_familyCheckBox->setText(i18n("Visible to Family"));

    m_friendsCheckBox = new QCheckBox(optionsBox);
    m_friendsCheckBox->setText(i18n("Visible to Friends"));

    m_resizeCheckBox = new QCheckBox(optionsBox);
    m_resizeCheckBox->setText(i18n("Resize photos before uploading"));
    m_resizeCheckBox->setChecked(false);

    m_dimensionSpinBox = new QSpinBox(optionsBox);
    m_dimensionSpinBox->setMinimum(0);
    m_dimensionSpinBox->setMaximum(5000);
    m_dimensionSpinBox->setSingleStep(10);
    m_dimensionSpinBox->setValue(600);
    m_dimensionSpinBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    m_dimensionSpinBox->setEnabled(false);

    QLabel* resizeLabel   = new QLabel(i18n("Maximum dimension (pixels):"), optionsBox);

    m_imageQualitySpinBox = new QSpinBox(optionsBox);
    m_imageQualitySpinBox->setMinimum(0);
    m_imageQualitySpinBox->setMaximum(100);
    m_imageQualitySpinBox->setSingleStep(1);
    m_imageQualitySpinBox->setValue(85);
    m_imageQualitySpinBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    // NOTE: The term Compression factor may be to technical to write in the label
    QLabel* imageQualityLabel = new QLabel(i18n("JPEG Image Quality (higher is better):"), optionsBox);

    optionsBoxLayout->addWidget(m_publicCheckBox,      0, 0, 1, 4);
    optionsBoxLayout->addWidget(m_familyCheckBox,      1, 0, 1, 4);
//.........这里部分代码省略.........
开发者ID:ruphy,项目名称:kipi-plugins,代码行数:101,代码来源:flickrwidget.cpp

示例10: TAAWidget

CustomerSearch::CustomerSearch(QWidget *parent, const char *name, Qt::WFlags f)
    : TAAWidget(parent, f)
{
    // A simple (in appearance) widget that will allow the user to
    // search for, and select, a customer.
    //
    // The layout will look like so:
    //
    //  Query: [ Search Box         ] [Search] [Clear]
    //  +---------+----------+-----------------------+
    //  + Cust ID | Login ID | Account Name          |
    //  +         |          |                       |
    //  +---------+----------+-----------------------+
    //
    // When the user types something in the search box and presses enter
    // or clicks the search button, the widget will do a search on the
    // customer database against the search text and fill in the list.
    // When the user clicks or scrolls onto an entry, itemHighlighted()
    // will be emitted with the customer ID.  When the user double clicks
    // or presses enter on an entry itemSelected() will be emitted with
    // the customer ID.


    searchText = new QLineEdit(this, "SearchText");
    searchText->setMaxLength(80);
    connect(searchText, SIGNAL(returnPressed()), this, SLOT(startSearch()));
    
    QLabel  *queryLabel = new QLabel(this, "Query Label");
    queryLabel->setText("&Query:");
    queryLabel->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
    queryLabel->setBuddy(searchText);

    searchButton = new QPushButton(this, "SearchButton");
    searchButton->setText("Search");
    connect(searchButton, SIGNAL(clicked()), this, SLOT(startSearch()));

    QPushButton *clearButton = new QPushButton(this, "Clear Button");
    clearButton->setText("C&lear");
    connect(clearButton, SIGNAL(clicked()), this, SLOT(clearSearch()));

    custList = new Q3ListView(this, "SearchResults");
    custList->setMargin(2);
    custList->setAllColumnsShowFocus(true);
    custList->setRootIsDecorated(true);
    custList->addColumn("Account Name");
    custList->addColumn("LoginID");
    custList->addColumn("Cust ID");
    connect(custList, SIGNAL(currentChanged(Q3ListViewItem *)), this, SLOT(itemHighlighted(Q3ListViewItem *)));
    connect(custList, SIGNAL(doubleClicked(Q3ListViewItem *)), this, SLOT(itemSelected(Q3ListViewItem *)));
    connect(custList, SIGNAL(returnPressed(Q3ListViewItem *)), this, SLOT(itemSelected(Q3ListViewItem *)));

    Q3BoxLayout *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 0, 0);
    Q3BoxLayout *sl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 0);
    sl->addSpacing(3);
    sl->addWidget(queryLabel, 0);
    sl->addSpacing(3);
    sl->addWidget(searchText, 1);
    sl->addSpacing(3);
    sl->addWidget(searchButton, 0);
    sl->addWidget(clearButton, 0);
    ml->addLayout(sl, 0);
    ml->addSpacing(3);
    ml->addWidget(custList, 1);

}
开发者ID:gottafixthat,项目名称:tacc,代码行数:65,代码来源:CustomerSearch.cpp

示例11: on_btn_search_clicked

void MainWindow::on_btn_search_clicked()
{
    QSqlQuery query;
    ui->statusBar->showMessage( tr("Search Button clicked"),2000);
    int numC=ui->tableWidget_resultat->rowCount();
    for(;numC>=0;numC--){
        ui->tableWidget_resultat->removeRow(numC);
    }

    QString str=ui->lineEdit_search->text();
    bool boo;
    if(str.compare("")==0)
    {
        boo=query.exec("select * from TPatient");
        if(!boo)
        {
            qDebug() << query.lastError().text();
            qDebug() << "can't find !\n";
        }
     }
    else
    {
        QString sql="select * from TPatient where Nom='"+str+"' or Id='"+str+"' or Prenom='"+str+"' or DateConsultation='"+str+"'";
        boo=query.exec(sql);
        if(!boo)
        {
            qDebug() << query.lastError().text();
        }

    }
    int i=0;
    for(; query.next(); i++)
    {
        ui->tableWidget_resultat->insertRow(i);
        ui->tableWidget_resultat->setItem( i, 0, new QTableWidgetItem(query.value(0).toString()));
        ui->tableWidget_resultat->setItem( i, 1, new QTableWidgetItem(query.value(1).toString()));
        ui->tableWidget_resultat->setItem( i, 2, new QTableWidgetItem(query.value(2).toString()));
        ui->tableWidget_resultat->setItem( i, 3, new QTableWidgetItem(query.value(8).toString()));
        ui->tableWidget_resultat->setItem( i, 4, new QTableWidgetItem(query.value(9).toString()+" mn"));

        QLabel *modifier = new QLabel();
        modifier->setText("      Modifier");
        modifier->setCursor(Qt::PointingHandCursor);
        QPalette pa;
        pa.setColor(QPalette::Text,Qt::blue);
        modifier->setPalette(pa);
        ui->tableWidget_resultat->setCellWidget(i,5,modifier);


        QLabel *supprimer=new QLabel();
        supprimer->setText("     Supprimer");
        supprimer->setCursor(Qt::PointingHandCursor);
        QPalette pa2;
        pa2.setColor(QPalette::Text,Qt::red);
        supprimer->setPalette(pa2);
        ui->tableWidget_resultat->setCellWidget(i,6,supprimer);

    }
    if(i==0){
        ui->tableWidget_resultat->insertRow(0);
        ui->tableWidget_resultat->setItem(0, 0, new QTableWidgetItem("No record"));
    }
}
开发者ID:pholien,项目名称:QtProjet,代码行数:63,代码来源:vue_mainwindow.cpp

示例12: QWidget

ProfileForm::ProfileForm(QWidget *parent) :
    QWidget(parent)
{
    bodyUI = new Ui::IdentitySettings;
    bodyUI->setupUi(this);
    core = Core::getInstance();

    head = new QWidget(this);
    QHBoxLayout* headLayout = new QHBoxLayout();
    head->setLayout(headLayout);

    QLabel* imgLabel = new QLabel();
    headLayout->addWidget(imgLabel);

    QLabel* nameLabel = new QLabel();
    QFont bold;
    bold.setBold(true);
    nameLabel->setFont(bold);
    headLayout->addWidget(nameLabel);
    headLayout->addStretch(1);

    nameLabel->setText(tr("User Profile"));
    imgLabel->setPixmap(QPixmap(":/img/settings/identity.png").scaledToHeight(40, Qt::SmoothTransformation));

    // tox
    toxId = new ClickableTE();
    toxId->setReadOnly(true);
    toxId->setFrame(false);
    toxId->setFont(Style::getFont(Style::Small));
    toxId->setToolTip(bodyUI->toxId->toolTip());

    QVBoxLayout *toxIdGroup = qobject_cast<QVBoxLayout*>(bodyUI->toxGroup->layout());
    toxIdGroup->replaceWidget(bodyUI->toxId, toxId);
    bodyUI->toxId->hide();

    bodyUI->qrLabel->setWordWrap(true);

    profilePicture = new MaskablePixmapWidget(this, QSize(64, 64), ":/img/avatar_mask.svg");
    profilePicture->setPixmap(QPixmap(":/img/contact_dark.svg"));
    profilePicture->setClickable(true);
    connect(profilePicture, SIGNAL(clicked()), this, SLOT(onAvatarClicked()));
    QHBoxLayout *publicGrouplayout = qobject_cast<QHBoxLayout*>(bodyUI->publicGroup->layout());
    publicGrouplayout->insertWidget(0, profilePicture);
    publicGrouplayout->insertSpacing(1, 7);

    timer.setInterval(750);
    timer.setSingleShot(true);
    connect(&timer, &QTimer::timeout, this, [=]() {bodyUI->toxIdLabel->setText(bodyUI->toxIdLabel->text().replace(" ✔", "")); hasCheck = false;});

    connect(bodyUI->toxIdLabel, SIGNAL(clicked()), this, SLOT(copyIdClicked()));
    connect(toxId, SIGNAL(clicked()), this, SLOT(copyIdClicked()));
    connect(core, &Core::idSet, this, &ProfileForm::setToxId);
    connect(core, &Core::statusSet, this, &ProfileForm::onStatusSet);
    connect(bodyUI->userName, SIGNAL(editingFinished()), this, SLOT(onUserNameEdited()));
    connect(bodyUI->statusMessage, SIGNAL(editingFinished()), this, SLOT(onStatusMessageEdited()));
    connect(bodyUI->loadButton, &QPushButton::clicked, this, &ProfileForm::onLoadClicked);
    connect(bodyUI->renameButton, &QPushButton::clicked, this, &ProfileForm::onRenameClicked);
    connect(bodyUI->exportButton, &QPushButton::clicked, this, &ProfileForm::onExportClicked);
    connect(bodyUI->deleteButton, &QPushButton::clicked, this, &ProfileForm::onDeleteClicked);
    connect(bodyUI->importButton, &QPushButton::clicked, this, &ProfileForm::onImportClicked);
    connect(bodyUI->newButton, &QPushButton::clicked, this, &ProfileForm::onNewClicked);

    connect(core, &Core::avStart, this, &ProfileForm::disableSwitching);
    connect(core, &Core::avStarting, this, &ProfileForm::disableSwitching);
    connect(core, &Core::avInvite, this, &ProfileForm::disableSwitching);
    connect(core, &Core::avRinging, this, &ProfileForm::disableSwitching);
    connect(core, &Core::avCancel, this, &ProfileForm::enableSwitching);
    connect(core, &Core::avEnd, this, &ProfileForm::enableSwitching);
    connect(core, &Core::avEnding, this, &ProfileForm::enableSwitching);
    connect(core, &Core::avPeerTimeout, this, &ProfileForm::enableSwitching);
    connect(core, &Core::avRequestTimeout, this, &ProfileForm::enableSwitching);

    connect(core, &Core::usernameSet, this, [=](const QString& val) { bodyUI->userName->setText(val); });
    connect(core, &Core::statusMessageSet, this, [=](const QString& val) { bodyUI->statusMessage->setText(val); });

    for (QComboBox* cb : findChildren<QComboBox*>())
    {
            cb->installEventFilter(this);
            cb->setFocusPolicy(Qt::StrongFocus);
    }
}
开发者ID:4myPAL,项目名称:qTox,代码行数:81,代码来源:profileform.cpp

示例13: QMainWindow

Interface::Interface(QString& configFile):
    QMainWindow(),
    _h_milli(210.0),
    _w_milli(297.0),
    _focal(750.0),
    _camNum(0),
    _isImageLoaded(false),
    _configFileName(configFile)
{
    //showMaximized();
    resize(1200, 900);
    setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, size(), qApp->desktop()->availableGeometry()));
    QString dir = dataPath() + "icons/";

    // Create a Viewer with shadows management
    _poseViewer = new PoseViewer(this, "viewer", 0);
    setCentralWidget(_poseViewer.get());
#if APPLY_CULL_MASK
    _poseViewer->getOsgViewer()->getCamera()->setCullMask(0x8);
#endif
    _poseViewer->addEventHandler(new osgViewer::StatsHandler);

    _pick = new PoLAR::TabBoxPickHandler(false); // create pick handler
    _poseViewer->addEventHandler(new DraggerManipulationHandler());

    QObject::connect(_poseViewer.get(), SIGNAL(shown()), this, SLOT(readConfigFile()), Qt::QueuedConnection);

    _imageFileDialog = new LoadImageDialog;
    _imageFileDialog->setOption(QFileDialog::DontUseNativeDialog);
    QObject::connect(_imageFileDialog, SIGNAL(closed(double, double)), this, SLOT(getImageData(double, double)));

    _toolbar = new QToolBar(this);
    addToolBar(Qt::LeftToolBarArea, _toolbar);
    _toolbar->setOrientation(Qt::Vertical);

    _statuslabel = new QLabel(_toolbar);
    _statuslabel->setText(*(new QString("Tools")));

    _toolbar->addAction(QIcon(dir+"exit.png"), QString("Quit"), this, SLOT(exit()));

    QAction *loadImgAct = new QAction(QIcon(dir+"img.png"), tr("Load reference image"), this);
    loadImgAct->setStatusTip(tr("Load reference image"));
    QObject::connect(loadImgAct, SIGNAL(triggered()), _imageFileDialog, SLOT(show()));
    _toolbar->addAction(loadImgAct);

    _toolbar->addAction(QIcon(dir+"object.png"), QString("Add 3D object"), this, SLOT(loadObject()));

    _toolbar->addAction(QIcon(dir+"scene.png"), QString("Manipulate 3D object"), this, SLOT(manipulateObject()));
    // Combo Box to permit to choose the type of dragger to use for object edition
    _draggerCombo = new QComboBox(this);
    _draggerCombo->addItem("TabBox dragger");
    _draggerCombo->addItem("Trackball dragger");
    _draggerCombo->addItem("TranslateAxis dragger");
    _draggerCombo->addItem("ScaleAxis dragger");
    _draggerCombo->addItem("RotateSphere dragger");
    //_draggerCombo->addItem("Vertex dragger");
    _toolbar->addWidget(_draggerCombo);

    QObject::connect(_draggerCombo, SIGNAL(activated(int)), this, SLOT(draggerComboSlot(int)));

    _dragger = new osgManipulator::TabBoxDragger;

    QPushButton *stopButton = new QPushButton(QString("Stop manipulate object"), this);
    _toolbar->addWidget(stopButton);
    QObject::connect(stopButton, SIGNAL(pressed()), this, SLOT(stopManipulateObject()));
    QPushButton *resetButton = new QPushButton(QString("Reset object manipulation"), this);
    _toolbar->addWidget(resetButton);
    QObject::connect(resetButton, SIGNAL(pressed()), this, SLOT(resetObjectManipulation()));

    QLabel* labelW = new QLabel(_toolbar);
    labelW->setText(*(new QString("Webcam #:")));
    _toolbar->addWidget(labelW);
    _camNumBox = new QSpinBox(_toolbar);
    _camNumBox->setRange(0,19);
    _camNumBox->setSingleStep(1);
    _camNumBox->setValue(_camNum);
    _toolbar->addWidget(_camNumBox);
    QObject::connect(_camNumBox, SIGNAL(valueChanged(int)), this, SLOT(webcamNumChanged(int)));

    QLabel* labelF = new QLabel(_toolbar);
    labelF->setText(*(new QString("Focal:")));
    _toolbar->addWidget(labelF);
    _focalBox = new QSpinBox(_toolbar);
    _focalBox->setRange(0,5000);
    _focalBox->setSingleStep(1);
    _focalBox->setValue(_focal);
    _toolbar->addWidget(_focalBox);
    QObject::connect(_focalBox, SIGNAL(valueChanged(int)), this, SLOT(focalChanged(int)));

    QLabel* labelScale = new QLabel(_toolbar);
    labelScale->setText(QString("Model scale:"));
    _toolbar->addWidget(labelScale);
    _scaleBox = new QDoubleSpinBox(_toolbar);
    _scaleBox->setRange(0.001, 1000.0);
    _scaleBox->setSingleStep(0.001);
    _scaleBox->setValue(1.0);
    _toolbar->addWidget(_scaleBox);
    QObject::connect(_scaleBox, SIGNAL(valueChanged(double)), this, SLOT(scaleChanged(double)));

    QPushButton *goButton = new QPushButton(QString("Launch video"), this);
//.........这里部分代码省略.........
开发者ID:ConfusedReality,项目名称:pkg_augmented-reality_polAR,代码行数:101,代码来源:Interface.cpp

示例14: QLabel

SearchView::SearchView(QWidget *parent) : QWidget(parent) {

    QFont biggerFont = FontUtils::big();
    QFont smallerFont = FontUtils::smallBold();

#if defined(APP_MAC) | defined(APP_WIN)
    // speedup painting since we'll paint the whole background
    // by ourselves anyway in paintEvent()
    setAttribute(Qt::WA_OpaquePaintEvent);
#endif

    QBoxLayout *mainLayout = new QVBoxLayout();
    mainLayout->setMargin(0);
    mainLayout->setSpacing(0);

    // hidden message widget
    message = new QLabel(this);
    message->hide();
    mainLayout->addWidget(message);

#ifdef APP_DEMO
    QLabel *buy = new QLabel(this);
    buy->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
    buy->setText(QString("<a style='color:palette(text);text-decoration:none' href='%1'>%2</a>").arg(
            QString(Constants::WEBSITE) + "#download",
            tr("Get the full version").toUpper()
            ));
    buy->setOpenExternalLinks(true);
    buy->setMargin(7);
    buy->setAlignment(Qt::AlignRight);
    buy->setStyleSheet("QLabel {"
                       "background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #CCD6E0, stop: 1 #ADBCCC);"
                       "border-bottom-left-radius: 8px;"
                       "border-bottom-right-radius: 8px;"
                       "font-size: 10px;"
                       "margin-right: 50px;"
                       "}");
    mainLayout->addWidget(buy, 0, Qt::AlignRight);
#endif

    mainLayout->addStretch();
    mainLayout->addSpacing(PADDING);

    QBoxLayout *hLayout = new QHBoxLayout();
    hLayout->setAlignment(Qt::AlignCenter);
    mainLayout->addLayout(hLayout);

    QLabel *logo = new QLabel(this);
    logo->setPixmap(QPixmap(":/images/app.png"));
    hLayout->addWidget(logo, 0, Qt::AlignTop);
    hLayout->addSpacing(PADDING);

    QVBoxLayout *layout = new QVBoxLayout();
    layout->setAlignment(Qt::AlignCenter);
    hLayout->addLayout(layout);

    QLabel *welcomeLabel =
            new QLabel("<h1 style='font-weight:normal'>" +
                       tr("Welcome to <a href='%1'>%2</a>,")
                       // .replace("<a ", "<a style='color:palette(text)'")
                       .replace("<a href", "<a style='text-decoration:none; color:palette(text); font-weight:bold' href")
                       .arg(Constants::WEBSITE, Constants::APP_NAME)
                       + "</h1>", this);
    welcomeLabel->setOpenExternalLinks(true);
    layout->addWidget(welcomeLabel);

    layout->addSpacing(PADDING / 2);

    QBoxLayout *tipLayout = new QHBoxLayout();
    tipLayout->setSpacing(10);

    //: "Enter", as in "type". The whole frase says: "Enter a keyword to start watching videos"
    QLabel *tipLabel = new QLabel(tr("Enter"), this);
    tipLabel->setFont(biggerFont);
    tipLayout->addWidget(tipLabel);

    typeCombo = new QComboBox(this);
    typeCombo->addItem(tr("a keyword"));
    typeCombo->addItem(tr("a channel"));
    typeCombo->setFont(biggerFont);
    connect(typeCombo, SIGNAL(currentIndexChanged(int)), SLOT(searchTypeChanged(int)));
    tipLayout->addWidget(typeCombo);

    tipLabel = new QLabel(tr("to start watching videos."), this);
    tipLabel->setFont(biggerFont);
    tipLayout->addWidget(tipLabel);
    layout->addLayout(tipLayout);

    layout->addSpacing(PADDING / 2);

    QHBoxLayout *searchLayout = new QHBoxLayout();
    searchLayout->setAlignment(Qt::AlignVCenter);

    queryEdit = new SearchLineEdit(this);
    queryEdit->setFont(biggerFont);
    queryEdit->setMinimumWidth(queryEdit->fontInfo().pixelSize()*15);
    queryEdit->sizeHint();
    queryEdit->setFocus(Qt::OtherFocusReason);
    connect(queryEdit, SIGNAL(search(const QString&)), this, SLOT(watch(const QString&)));
    connect(queryEdit, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged(const QString &)));
//.........这里部分代码省略.........
开发者ID:JennYung,项目名称:minitube,代码行数:101,代码来源:SearchView.cpp

示例15: ModelObjectInspectorView

IlluminanceMapInspectorView::IlluminanceMapInspectorView(bool isIP, const openstudio::model::Model& model, QWidget * parent )
  : ModelObjectInspectorView(model, true, parent)
{
  m_isIP = isIP;

  QWidget* hiddenWidget = new QWidget();
  this->stackedWidget()->insertWidget(0, hiddenWidget);

  QWidget* visibleWidget = new QWidget();
  this->stackedWidget()->insertWidget(1, visibleWidget);

  this->stackedWidget()->setCurrentIndex(0);

  QGridLayout* mainGridLayout = new QGridLayout();
  mainGridLayout->setContentsMargins(7,7,7,7);
  mainGridLayout->setSpacing(14);
  visibleWidget->setLayout(mainGridLayout);

  // name
  QVBoxLayout* vLayout = new QVBoxLayout();

  QLabel* label = new QLabel();
  label->setText("Name: ");
  label->setStyleSheet("QLabel { font: bold; }");
  vLayout->addWidget(label);

  m_nameEdit = new OSLineEdit();
  vLayout->addWidget(m_nameEdit);

  mainGridLayout->addLayout(vLayout,0,0,1,2, Qt::AlignTop);

  // x, y, and z
  vLayout = new QVBoxLayout();

  label = new QLabel();
  label->setText("X Coordinate: ");
  label->setStyleSheet("QLabel { font: bold; }");
  vLayout->addWidget(label);

  m_xCoordinateEdit = new OSQuantityEdit(m_isIP);
  connect(this, &IlluminanceMapInspectorView::toggleUnitsClicked, m_xCoordinateEdit, &OSQuantityEdit::onUnitSystemChange);
  vLayout->addWidget(m_xCoordinateEdit);

  mainGridLayout->addLayout(vLayout,1,0, Qt::AlignTop|Qt::AlignLeft);

  vLayout = new QVBoxLayout();

  label = new QLabel();
  label->setText("Y Coordinate: ");
  label->setStyleSheet("QLabel { font: bold; }");
  vLayout->addWidget(label);

  m_yCoordinateEdit = new OSQuantityEdit(m_isIP);
  connect(this, &IlluminanceMapInspectorView::toggleUnitsClicked, m_yCoordinateEdit, &OSQuantityEdit::onUnitSystemChange);
  vLayout->addWidget(m_yCoordinateEdit);

  mainGridLayout->addLayout(vLayout,1,1, Qt::AlignTop|Qt::AlignLeft);

  vLayout = new QVBoxLayout();

  label = new QLabel();
  label->setText("Z Coordinate: ");
  label->setStyleSheet("QLabel { font: bold; }");
  vLayout->addWidget(label);

  m_zCoordinateEdit = new OSQuantityEdit(m_isIP);
  connect(this, &IlluminanceMapInspectorView::toggleUnitsClicked, m_zCoordinateEdit, &OSQuantityEdit::onUnitSystemChange);
  vLayout->addWidget(m_zCoordinateEdit);

  mainGridLayout->addLayout(vLayout,1,2, Qt::AlignTop|Qt::AlignLeft);

  // psi, theta, and phi
  vLayout = new QVBoxLayout();

  label = new QLabel();
  label->setText("Psi Rotation About X: ");
  label->setStyleSheet("QLabel { font: bold; }");
  vLayout->addWidget(label);

  m_psiRotationEdit = new OSQuantityEdit(m_isIP);
  connect(this, &IlluminanceMapInspectorView::toggleUnitsClicked, m_psiRotationEdit, &OSQuantityEdit::onUnitSystemChange);
  vLayout->addWidget(m_psiRotationEdit);

  mainGridLayout->addLayout(vLayout,2,0, Qt::AlignTop|Qt::AlignLeft);

  vLayout = new QVBoxLayout();

  label = new QLabel();
  label->setText("Theta Rotation About Y: ");
  label->setStyleSheet("QLabel { font: bold; }");
  vLayout->addWidget(label);

  m_thetaRotationEdit = new OSQuantityEdit(m_isIP);
  connect(this, &IlluminanceMapInspectorView::toggleUnitsClicked, m_thetaRotationEdit, &OSQuantityEdit::onUnitSystemChange);
  vLayout->addWidget(m_thetaRotationEdit);

  mainGridLayout->addLayout(vLayout,2,1, Qt::AlignTop|Qt::AlignLeft);

  vLayout = new QVBoxLayout();

//.........这里部分代码省略.........
开发者ID:ChengXinDL,项目名称:OpenStudio,代码行数:101,代码来源:IlluminanceMapInspectorView.cpp


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