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


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

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


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

示例1: QFrame

ProceduralLevelGenerator::ProceduralLevelGenerator( QWidget* parent, GL2DProceduralLevel* params )
   : QFrame( parent )
   , m_params( params )
   , m_root( params->getParent() )
{
   QVBoxLayout* layout = new QVBoxLayout( this );
   setLayout( layout );

   QToolBar* toolbar = new QToolBar( this );
   {
      layout->addWidget( toolbar );

      QAction* generateLevelAction = toolbar->addAction( QIcon( ":/TamyEditor/Resources/Icons/Editor/play.png" ), "Generate level" );
      connect( generateLevelAction, SIGNAL( triggered() ), this, SLOT( generateScene() ) );
   }
   
   QFrame* statusBar = new QFrame( this );
   {
      layout->addWidget( statusBar );

      QHBoxLayout* statusBarLayout = new QHBoxLayout( statusBar );
      statusBarLayout->setSpacing( 0 );
      statusBarLayout->setMargin( 0 );
      statusBar->setLayout( statusBarLayout );

      QLabel* statusLabel = new QLabel( "Status: ", this );
      statusLabel->setMaximumWidth( 100 );
      statusBarLayout->addWidget( statusLabel );

      m_status = new QLabel( this );
      statusBarLayout->addWidget( m_status );
   }
}
开发者ID:dabroz,项目名称:Tamy,代码行数:33,代码来源:ProceduralLevelGenerator.cpp

示例2: setView

void npc_text_view::setView(int id)
{
    setLayout(new QVBoxLayout{});
    std::multimap<int,std::tuple<float,QString,QString>> * l_map = m_dbcache->get_npc_text_resource();
    // loop through all the texts and present with probability
    for(auto it = l_map->lower_bound(id); it != l_map->upper_bound(id); ++it)
    {
        float   p = std::get<0>((*it).second);
        QString t0 = std::get<1>((*it).second);
        QString t1 = std::get<2>((*it).second);
        int a = (t0.length()!=0) + (t1.length()!=0)*2;
        int c = (t0.length()!=0) + (t1.length()!=0);
        QGroupBox * box = new QGroupBox(QString::number(p*100) + QString("%"));
        box->setLayout(new QHBoxLayout{});
        layout()->addWidget(box);
        switch(c)
        {
        case 1: // Present only one of the texts
        {
            QLabel * label = new QLabel{};
            label->setMaximumWidth(400);
            label->setWordWrap(true);
            label->setFrameStyle(QFrame::Panel | QFrame::Sunken);
            box->layout()->addWidget(label);
            if(a==1) // t0 isnt empty
            {
                label->setText(t0);
            }
            if(a==2) // t1 isnt empty
            {
                label->setText(t1);
            }
            label->setAlignment(Qt::AlignCenter);
            break;
        }
        case 2: // Present both of the texts
        {
            QLabel * label0 = new QLabel{t0};
            label0->setMaximumWidth(400);
            label0->setWordWrap(true);
            QLabel * labelOR = new QLabel{" or "};
            labelOR->setMaximumWidth(20);
            QLabel * label1 = new QLabel{t1};
            label1->setMaximumWidth(400);
            label1->setWordWrap(true);
            label0->setFrameStyle(QFrame::Panel | QFrame::Sunken);
            label1->setFrameStyle(QFrame::Panel | QFrame::Sunken);
            box->layout()->addWidget(label0);
            box->layout()->addWidget(labelOR);
            box->layout()->addWidget(label1);
            break;
        }
        default:
            break;
        }
    }
}
开发者ID:Herman-H,项目名称:wow_db_editor,代码行数:57,代码来源:dbwidgets.cpp

示例3: initialize

void SearchControl::initialize()
{
	QHBoxLayout * layoutSearch = new QHBoxLayout();
	QVBoxLayout * layout = new QVBoxLayout();
	QHBoxLayout * layoutTracks = new QHBoxLayout();
	QHBoxLayout * layoutAnnotations = new QHBoxLayout();
	
	QPushButton * clearButton = new QPushButton("Clear");
	QCheckBox * caseCheckBox = new QCheckBox("Match case");
	lineEdit = new QLineEdit();
	labelResultsTracks = new StatusLabel();
	labelResultsAnnotations = new StatusLabel();
	
	QLabel * labelTracks = new QLabel(tr("tracks"));
	QLabel * labelAnnotations = new QLabel(tr("annotations"));
	
	labelResultsAnnotations->setMinimumWidth(100);
	labelResultsAnnotations->setMaximumWidth(100);
	labelAnnotations->setMinimumWidth(100);
	labelAnnotations->setMaximumWidth(100);
	labelResultsTracks->setMinimumWidth(100);
	labelResultsTracks->setMaximumWidth(100);
	labelTracks->setMinimumWidth(100);
	labelTracks->setMaximumWidth(100);
	labelResultsTracks->setMinimumHeight(19);
	labelResultsAnnotations->setMinimumHeight(19);
	
	layoutSearch->addWidget(lineEdit);
	layoutSearch->addWidget(clearButton);
	layout->addLayout(layoutSearch);
	layout->addWidget(caseCheckBox);
	layoutTracks->addWidget(labelResultsTracks);
	layoutTracks->addWidget(labelTracks);
	layoutTracks->setAlignment(Qt::AlignLeft);
	layoutAnnotations->addWidget(labelResultsAnnotations);
	layoutAnnotations->addWidget(labelAnnotations);
	layoutAnnotations->setAlignment(Qt::AlignLeft);
	layout->addLayout(layoutTracks);
	layout->addLayout(layoutAnnotations);
	
	qDeleteAll(children());
	delete this->layout();
	setLayout(layout);
	
	connect(lineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged(const QString &)));
	connect(clearButton, SIGNAL(clicked()), this, SLOT(clear()));
	connect(caseCheckBox, SIGNAL(stateChanged(int)), this, SLOT(matchCaseChaged(int)));
	
	matchCase = false;
	setWindowTitle("Find");
	adjustSize();
}
开发者ID:marbl,项目名称:gingr,代码行数:52,代码来源:SearchControl.cpp

示例4: QHBox

void Wizard::setupPage1()
{
    page1 = new QHBox( this );
    page1->setSpacing(8);

    QLabel *info = new QLabel( page1 );
    info->setPalette( yellow );
    info->setText( "Enter your personal\n"
                   "key here.\n\n"
                   "Your personal key\n"
                   "consists of 4 digits" );
    info->setIndent( 8 );
    info->setMaximumWidth( info->sizeHint().width() );

    QVBox *page = new QVBox( page1 );

    QHBox *row1 = new QHBox( page );

    (void)new QLabel( "Key:", row1 );

    key = new QLineEdit( row1 );
    key->setMaxLength( 4 );
    key->setValidator( new QIntValidator( 9999, 0, key ) );

    connect( key, SIGNAL( textChanged( const QString & ) ), this, SLOT( keyChanged( const QString & ) ) );

    addPage( page1, "Personal Key" );

    setNextEnabled( page1, FALSE );
    setHelpEnabled( page1, FALSE );
}
开发者ID:opieproject,项目名称:qte-opie,代码行数:31,代码来源:wizard.cpp

示例5: EdLevelSoundThumbnail

EdLevelResourceSound::EdLevelResourceSound (const FilePath &path)
{
    
    EdLevelSoundThumbnail *item = new EdLevelSoundThumbnail(this);
    item->setSound(path);
    item->setMaximumWidth(128);
    item->setMinimumWidth(128);
    item->setMaximumHeight(128);
    item->setMinimumHeight(128);

    QLabel *title = new QLabel(this);
    title->setMaximumWidth(200);
    title->setMinimumWidth(200);
    title->setText(path.file_name().c_str());
    
    QGridLayout *layout = new QGridLayout;
    layout->setContentsMargins(2,2,2,2);
    layout->setHorizontalSpacing(0);
    layout->setVerticalSpacing(0);
    layout->setColumnStretch(1,1);
    layout->addWidget(item,1,0);
    layout->addWidget(title,0,0);

    setLayout(layout);
    
    setMinimumHeight(15+2+128);
    setMinimumWidth(200);
    setMaximumWidth(200);
}
开发者ID:9heart,项目名称:DT3,代码行数:29,代码来源:EdLevelResourceSound.cpp

示例6: QWidget

LibraryScannerDlg::LibraryScannerDlg(QWidget * parent, Qt::WindowFlags f)
        : QWidget(parent, f),
          m_bCancelled(false) {

    setWindowIcon(QIcon(":/images/ic_mixxx_window.png"));

    QVBoxLayout* pLayout = new QVBoxLayout(this);

    setWindowTitle(tr("Library Scanner"));
    QLabel* pLabel = new QLabel(tr("It's taking Mixxx a minute to scan your music library, please wait..."),this);
    pLayout->addWidget(pLabel);

    QPushButton* pCancel = new QPushButton(tr("Cancel"), this);
    connect(pCancel, SIGNAL(clicked()),
            this, SLOT(slotCancel()));
    pLayout->addWidget(pCancel);

    QLabel* pCurrent = new QLabel(this);
    pCurrent->setMaximumWidth(600);
    pCurrent->setWordWrap(true);
    connect(this, SIGNAL(progress(QString)),
            pCurrent, SLOT(setText(QString)));
    pLayout->addWidget(pCurrent);
    setLayout(pLayout);

    m_timer.start();
}
开发者ID:CorgiMan,项目名称:mixxx,代码行数:27,代码来源:libraryscannerdlg.cpp

示例7: setNeuronImageFrame

/**
 * Draws neural network layer topology.
 */
void LayerEditWidget::setNeuronImageFrame() {
    QString labelStyle;

    if(inputLayer) {
        labelStyle =
            "background-image: url(:/neuron1w);"
            "background-position: center center;"
            "background-repeat: no-repeat;";
    } else {
        labelStyle =
            "background-image: url(:/neuron3w);"
            "background-position: center center;"
            "background-repeat: no-repeat;";
    }

    for(int i = 0; i < neuronList.count(); i++) {
        ui->neuronImageFrame->layout()->removeWidget(neuronList[i]);
        delete neuronList[i];
    }
    neuronList.clear();

    if(ui->neuronCountSpinBox->value() <= 7) {
        for(int i = 1; i < ui->neuronCountSpinBox->value()+1; i++) {
            QLabel* neuron = new QLabel(ui->neuronImageFrame);
            neuron->setMaximumWidth(36);
            neuron->setMinimumWidth(36);
            neuron->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
            neuron->setStyleSheet(labelStyle);
            neuron->setText(QString::number(i));
            neuronList.append(neuron);
            ui->neuronImageFrame->layout()->addWidget(neuron);
        }
    } else {
        for(int i = 1; i < 8; i++) {
            QLabel* neuron = new QLabel(ui->neuronImageFrame);
            neuron->setMaximumWidth(36);
            neuron->setMinimumWidth(36);
            neuron->setStyleSheet(labelStyle);
            neuron->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
            if(i == 7) neuron->setText(QString::number(ui->neuronCountSpinBox->value()));
            else if(i == 6)	neuron->setText(QString("..."));
            else neuron->setText(QString::number(i));
            neuronList.append(neuron);
            ui->neuronImageFrame->layout()->addWidget(neuron);
        }
    }
}
开发者ID:kacerpetr,项目名称:NNCreator,代码行数:50,代码来源:LayerEditWidget.cpp

示例8: setLyric

void LyricWidget::setLyric(const QLyricList &lyric) {
    if (animWidget) delete animWidget;
    animWidget = new QWidget(this);
    animWidget->raise();
    ui->border->raise();
    QRect geo = this->geometry();
    animWidget->setMinimumWidth(geo.width());
    animWidget->setMaximumWidth(geo.width());
    animWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    QVBoxLayout *vbox = new QVBoxLayout(animWidget);
    vbox->setMargin(0);
    vbox->setSpacing(0);
    vbox->setContentsMargins(0, 0, 0, 0);
    animWidget->setLayout(vbox);

    labels.clear();
    curInd = 0;
    this->lyric = lyric;
    firstShowing = false;

    int widgetWidth = this->geometry().width();
    int accuHeight = 0;
    for (const QLyric& lyr : lyric) {
        QLabel *label = new QLabel(animWidget);
        QFont font("文泉驿微米黑", 11);
        font.setStyleStrategy(QFont::PreferAntialias);
        label->setFont(font);
        label->setText(QString("<font color='grey'>") +
                        lyr.lyric + QString("</font>"));
        label->setMaximumWidth(widgetWidth);
        label->setMaximumWidth(widgetWidth);
        label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
        label->setWordWrap(true);
        labels.append(label);
        QRect fsize = label->fontMetrics().boundingRect(label->text());
        int height = (widgetWidth + fsize.width()) / widgetWidth * fsize.height() + 15;
        heights.append(height);
        label->setMinimumHeight(height);
        label->setMaximumHeight(height);
        accuHeight += height;

        animWidget->layout()->addWidget(label);
    }

    if (heights.size() > 0) {
        animWidget->setGeometry(0, this->geometry().height() / 2 + heights[0],
                                this->geometry().width(), accuHeight);
    }
    animWidget->show();
    ui->border->setText("");
}
开发者ID:Argun,项目名称:doubanfm-qt,代码行数:52,代码来源:lyricwidget.cpp

示例9: updateRecentKeywords

void SearchView::updateRecentKeywords() {
    // load
    QSettings settings;
    QStringList keywords = settings.value(recentKeywordsKey).toStringList();
    if (keywords == recentKeywords) return;
    recentKeywords = keywords;

    // cleanup
    QLayoutItem *item;
    while ((item = recentKeywordsLayout->takeAt(1)) != 0) {
        item->widget()->close();
        delete item;
    }

    recentKeywordsLabel->setVisible(!keywords.isEmpty());
    The::globalActions()->value("clearRecentKeywords")->setEnabled(!keywords.isEmpty());

    foreach (const QString &keyword, keywords) {
        QString link = keyword;
        QString display = keyword;
        if (keyword.startsWith("http://") || keyword.startsWith("https://")) {
            int separator = keyword.indexOf("|");
            if (separator > 0 && separator + 1 < keyword.length()) {
                link = keyword.left(separator);
                display = keyword.mid(separator+1);
            }
        }
        bool needStatusTip = false;
        if (display.length() > 24) {
            display.truncate(24);
            display.append("...");
            needStatusTip = true;
        }
        QLabel *itemLabel = new QLabel("<a href=\"" + link
                                       + "\" style=\"color:palette(text); text-decoration:none\">"
                                       + display + "</a>", this);
        itemLabel->setAttribute(Qt::WA_DeleteOnClose);
        itemLabel->setProperty("recentItem", true);
        itemLabel->setMaximumWidth(queryEdit->toWidget()->width() + watchButton->width());
        itemLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
        // Make links navigable with the keyboard too
        itemLabel->setTextInteractionFlags(Qt::LinksAccessibleByKeyboard | Qt::LinksAccessibleByMouse);
        if (needStatusTip)
            itemLabel->setStatusTip(link);
        connect(itemLabel, SIGNAL(linkActivated(QString)), this, SLOT(watchKeywords(QString)));
        recentKeywordsLayout->addWidget(itemLabel);
    }
开发者ID:Gira-X,项目名称:minitube,代码行数:47,代码来源:searchview.cpp

示例10: buildStatusButtons

EdLevelPropertyVector2Field::EdLevelPropertyVector2Field (EdLevelPropertiesWindow *parent, std::shared_ptr<PlugNode> node, std::shared_ptr<ArchiveData> data)
{
    //setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
    _data = data;
    _node = node;

    buildStatusButtons();

    QLabel *name = new QLabel(this);
    name->setMaximumWidth(130);
    name->setMinimumWidth(130);
    name->setText(MoreStrings::captialize_and_format(_data->title()).c_str());

    _value_x = new EdLevelLineEdit(this);
    _value_y = new EdLevelLineEdit(this);

    _value_x->setObjectName("prop");
    _value_y->setObjectName("prop");

    connect(	_value_x,       SIGNAL(editingFinished()),
                this,           SLOT(doWriteParams())	);
    connect(	_value_y,       SIGNAL(editingFinished()),
                this,           SLOT(doWriteParams())	);

    connect(	this,           SIGNAL(doCommand(QString, bool)),
                parent,         SLOT(onCommand(QString, bool))	);

    QGridLayout *layout = new QGridLayout;
    layout->setContentsMargins(0,0,0,0);
    layout->setHorizontalSpacing(0);
    layout->setVerticalSpacing(0);
    layout->addWidget(keyButton(),0,0);
    layout->addWidget(hasInputButton(),0,1);
    layout->addWidget(hasOutputButton(),0,2);
    layout->addWidget(name,0,3);
    layout->addWidget(_value_x,0,4);
    layout->addWidget(_value_y,0,5);

    setLayout(layout);

    setMinimumHeight(15+2);

    doReadParams();
}
开发者ID:9heart,项目名称:DT3,代码行数:44,代码来源:EdLevelPropertyVector2Field.cpp

示例11: showSourceDialog

void MagnatuneCollectionLocation::showSourceDialog( const Meta::TrackList &tracks, bool removeSources )
{
    KDialog dialog;
    dialog.setCaption( i18n( "Preview Tracks" ) );
    dialog.setButtons( KDialog::Ok | KDialog::Cancel );

    QLabel *label = new QLabel( i18n( "The tracks you are about to copy are Magnatune.com preview streams. For better quality and advert free streams, consider buying an album download. Remember that when buying from Magnatune the artist gets 50%. Also if you buy using Amarok, you support the Amarok project with 10%." ) );

    label->setWordWrap ( true );
    label->setMaximumWidth( 400 );
    
    dialog.setMainWidget( label );

    dialog.exec();

    if ( dialog.result() == QDialog::Rejected )
        abort();

    CollectionLocation::showSourceDialog( tracks, removeSources ); // to get transcoding dialog
}
开发者ID:ErrAza,项目名称:amarok,代码行数:20,代码来源:MagnatuneCollectionLocation.cpp

示例12: addLed

void AxisDetailsWidget::addLed(int row, int column) {
    Led* led = iAnimation.ledAt(Position(row, column));

    if(led == NULL) {
        throw IllegalArgumentException("AnimationDetailsWidget::addLed : NULL led");
    }

    if(!iLedDetails.contains(led->number())) {
        int count = iLedDetails.count();
        qDebug("add new led, %d, %d", row, column);

        QLabel* ledNumberLabel = new QLabel(this);
        ledNumberLabel->setMaximumWidth(LED_LABEL_WIDTH);
        ledNumberLabel->setMinimumWidth(LED_LABEL_WIDTH);

        FrameListWidget* framesListWidget = new FrameListWidget(this, axisData(*led), *this);//, count);
        QToolButton* closeButton = new QToolButton(this);
        closeButton->setObjectName(QString::fromUtf8("detailsClose"));
        closeButton->setIcon(QIcon(":/images/delete.png"));

        iGridLayout->addWidget(closeButton, count, 0);
        iGridLayout->addWidget(ledNumberLabel, count, 1);
        iGridLayout->addWidget(framesListWidget, count, 2);
       // iGridLayout->setColumnStretch(1, 1);
       // iGridLayout->addWidget(new QWidget(), count, 3);
       // iGridLayout->setColumnStretch(3, 2);

        iLedDetails.insert(led->number(), new LedDetails(*this,
                                                         *led,
                                                         *ledNumberLabel,
                                                         *framesListWidget,
                                                         *closeButton));

        iCloseAll->setEnabled(true);
        iScrollAreaWidgetContents->setShowCurrentFrameLine(true);

        doResize();
        layout()->invalidate();
    }
}
开发者ID:annesummers,项目名称:LedAnimator,代码行数:40,代码来源:AxisDetailsWidget.cpp

示例13: QWidget

SelWeaponItem::SelWeaponItem(bool allowInfinite, int iconNum, int wNum, QImage image, QImage imagegrey, QWidget* parent) :
    QWidget(parent)
{
    QHBoxLayout* hbLayout = new QHBoxLayout(this);
    hbLayout->setSpacing(1);
    hbLayout->setMargin(1);

    QLabel* lbl = new QLabel(this);
    lbl->setPixmap(QPixmap::fromImage(getAmmoImage(iconNum)));
    lbl->setMaximumWidth(30);
    lbl->setGeometry(0, 0, 30, 30);
    hbLayout->addWidget(lbl);

    item = new WeaponItem(image, imagegrey, this);
    item->setItemsNum(wNum);
    item->setInfinityState(allowInfinite);
    hbLayout->addWidget(item);

    hbLayout->setStretchFactor(lbl, 1);
    hbLayout->setStretchFactor(item, 99);
    hbLayout->setAlignment(lbl, Qt::AlignLeft | Qt::AlignVCenter);
    hbLayout->setAlignment(item, Qt::AlignLeft | Qt::AlignVCenter);
}
开发者ID:akzfowl,项目名称:hw,代码行数:23,代码来源:selectWeapon.cpp

示例14: layoutWindow


//.........这里部分代码省略.........
    m_accelResidualZ = getFixedPanel("0");
    dataLayout = new QHBoxLayout();
    dataLayout->addSpacing(30);
    dataLayout->setAlignment(Qt::AlignLeft);
    dataLayout->addWidget(m_accelResidualX);
    dataLayout->addWidget(m_accelResidualY);
    dataLayout->addWidget(m_accelResidualZ);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);
    vLayout->addWidget(new QLabel("Magnetometers (uT): "));

    m_compassX = getFixedPanel("0");
    m_compassY = getFixedPanel("0");
    m_compassZ = getFixedPanel("0");
    dataLayout = new QHBoxLayout();
    dataLayout->setAlignment(Qt::AlignLeft);
    dataLayout->addSpacing(30);
    dataLayout->addWidget(m_compassX);
    dataLayout->addWidget(m_compassY);
    dataLayout->addWidget(m_compassZ);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);
    vLayout->addWidget(new QLabel("Compass magnitude (uT): "));

    m_compassMagnitude = getFixedPanel("0");
    dataLayout = new QHBoxLayout();
    dataLayout->addSpacing(30);
    dataLayout->addWidget(m_compassMagnitude);
    dataLayout->setAlignment(Qt::AlignLeft);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);
    vLayout->addWidget(new QLabel("Pressure (hPa), height above sea level (m): "));

    m_pressure = getFixedPanel("0");
    m_height = getFixedPanel("0");
    dataLayout = new QHBoxLayout();
    dataLayout->addSpacing(30);
    dataLayout->addWidget(m_pressure);
    dataLayout->addWidget(m_height);
    dataLayout->setAlignment(Qt::AlignLeft);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);
    vLayout->addWidget(new QLabel("Temperature (C): "));

    m_temperature = getFixedPanel("0");
    dataLayout = new QHBoxLayout();
    dataLayout->addSpacing(30);
    dataLayout->addWidget(m_temperature);
    dataLayout->setAlignment(Qt::AlignLeft);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);
    vLayout->addWidget(new QLabel("Humidity (RH): "));

    m_humidity = getFixedPanel("0");
    dataLayout = new QHBoxLayout();
    dataLayout->addSpacing(30);
    dataLayout->addWidget(m_humidity);
    dataLayout->setAlignment(Qt::AlignLeft);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);

    QHBoxLayout *fusionBox = new QHBoxLayout();
    QLabel *fusionTypeLabel = new QLabel("Fusion algorithm: ");
    fusionBox->addWidget(fusionTypeLabel);
    fusionTypeLabel->setMaximumWidth(150);
    m_fusionType = new QLabel();
    fusionBox->addWidget(m_fusionType);
    vLayout->addLayout(fusionBox);

    vLayout->addSpacing(10);

    vLayout->addWidget(new QLabel("Fusion controls: "));

    m_enableGyro = new QCheckBox("Enable gyros");
    m_enableGyro->setChecked(true);
    vLayout->addWidget(m_enableGyro);

    m_enableAccel = new QCheckBox("Enable accels");
    m_enableAccel->setChecked(true);
    vLayout->addWidget(m_enableAccel);

    m_enableCompass = new QCheckBox("Enable compass");
    m_enableCompass->setChecked(true);
    vLayout->addWidget(m_enableCompass);

    m_enableDebug = new QCheckBox("Enable debug messages");
    m_enableDebug->setChecked(false);
    vLayout->addWidget(m_enableDebug);

    vLayout->addStretch(1);

    centralWidget()->setLayout(vLayout);
    setFixedSize(850, 750);
}
开发者ID:Delan90,项目名称:RTIMULib2,代码行数:101,代码来源:RTIMULibDemo.cpp

示例15: nf

questionsSettings::questionsSettings(TlevelCreatorDlg* creator) :
    TabstractLevelPage(creator)
{
	QVBoxLayout *mainLay = new QVBoxLayout;
	mainLay->addStretch();

	int nootFontSize = fontMetrics().boundingRect("A").height() * 2;
	QString nooColor = QString("color: %1").arg(palette().highlight().color().name());
	m_tableWdg = new QWidget(this);
	QHBoxLayout *tabLay = new QHBoxLayout;
	tabLay->addWidget(m_tableWdg);
	QGridLayout *qaLay = new QGridLayout(); // Questions & Answers table
	qaLay->setAlignment(Qt::AlignCenter);
	qaLay->setSpacing(10);
// Labels describing answers types
	QFont f = font();
	f.setBold(true);
	QLabel *newQuestLab = new QLabel(TquestionAsWdg::answerTxt().toUpper(), this);
	newQuestLab->setFont(f);
	qaLay->addWidget(newQuestLab, 0, 2, 0, 4, Qt::AlignHCenter | Qt::AlignTop);
	m_questLab = new QLabel(TnooFont::span("n", nootFontSize * 1.5, nooColor) + "<br><br>" + TquestionAsWdg::questionTxt().toUpper(), this);
	m_questLab->setAlignment(Qt::AlignCenter);
	m_questLab->setFont(f);
	qaLay->addWidget(m_questLab, 1, 0, Qt::AlignBottom | Qt::AlignHCenter);
	m_answLab = new QLabel("  ", this);
	m_answLab->setFont(f);
	qaLay->addWidget(m_answLab, 1, 1, Qt::AlignBottom);
	QLabel *asNoteLab = new QLabel(" <br>" + TquestionAsWdg::asNoteTxt().replace(" ", "<br>"), this);
	asNoteLab->setAlignment(Qt::AlignCenter);
	qaLay->addWidget(asNoteLab, 1, 2, Qt::AlignBottom);
	QLabel *asNameLab = new QLabel(" <br>" + TquestionAsWdg::asNameTxt().replace(" ", "<br>"), this);
	asNameLab->setAlignment(Qt::AlignCenter);
	qaLay->addWidget(asNameLab, 1, 3, Qt::AlignBottom);
	m_asFretLab = new QLabel(" <br>" + TquestionAsWdg::asFretPosTxt().replace(" ", "<br>"), this);
	m_asFretLab->setAlignment(Qt::AlignCenter);
	qaLay->addWidget(m_asFretLab, 1, 4, Qt::AlignBottom);
	m_asSoundLab = new QLabel(" <br>" + TquestionAsWdg::asSoundTxt().replace(" ", "<br>"), this);
	m_asSoundLab->setAlignment(Qt::AlignCenter);
	qaLay->addWidget(m_asSoundLab, 1, 5, Qt::AlignBottom);
// CheckBoxes with types of answers for every kind of question
	asNoteWdg = new TquestionAsWdg(TQAtype::e_asNote, qaLay, 2, this);
	asNameWdg = new TquestionAsWdg(TQAtype::e_asName, qaLay, 3, this);
	asFretPosWdg = new TquestionAsWdg(TQAtype::e_asFretPos, qaLay, 4, this);
	asSoundWdg = new TquestionAsWdg(TQAtype::e_asSound, qaLay, 5, this);
// Labels on the right side of the table with symbols of types - related to questions
	QLabel *scoreNooLab = new QLabel("s?", this);
	QFont nf("nootka", fontMetrics().boundingRect("A").height());
#if defined(Q_OS_MACX)
	nf.setPointSize(fontMetrics().boundingRect("A").height() * 2);
#elif defined (Q_OS_ANDROID)
//   nf.setPointSize(qMax<int>(Tmtr::fingerPixels() / 3, fontMetrics().boundingRect("A").height()));
  nf.setPointSize(Tmtr::fingerPixels() / 3);
#endif
	scoreNooLab->setFont(nf);
	qaLay->addWidget(scoreNooLab, 2, 6, Qt::AlignCenter);
	QLabel *nameNooLab = new QLabel("c?", this);
	nameNooLab->setFont(nf);
	qaLay->addWidget(nameNooLab, 3, 6, Qt::AlignCenter);
	m_guitarNooLab = new QLabel("g?", this);
	m_guitarNooLab->setFont(nf);
	qaLay->addWidget(m_guitarNooLab, 4, 6, Qt::AlignCenter);
	m_soundNooLab = new QLabel("n?", this);
	m_soundNooLab->setFont(nf);
	qaLay->addWidget(m_soundNooLab, 5, 6);
// Labels on the bottom side of the table with symbols of types - related to answers  
	QLabel *qScoreNooLab = new QLabel("s!", this);
	qScoreNooLab->setFont(nf);
	qaLay->addWidget(qScoreNooLab, 6, 2, Qt::AlignCenter);
	QLabel *qNmeNooLab = new QLabel("c!", this);
	qNmeNooLab->setFont(nf);
	qaLay->addWidget(qNmeNooLab, 6, 3, Qt::AlignCenter);
	m_qGuitarNooLab = new QLabel("g!", this);
	m_qGuitarNooLab->setFont(nf);
	qaLay->addWidget(m_qGuitarNooLab, 6, 4, Qt::AlignCenter);
	m_qSoundNooLab = new QLabel("n!", this);
	m_qSoundNooLab->setFont(nf);
	qaLay->addWidget(m_qSoundNooLab, 6, 5);
	
	QLabel *melodyLab = new QLabel(TnooFont::span("m", nootFontSize * 2, nooColor), this);
	melodyLab->setAlignment(Qt::AlignCenter);
  melodyLab->setMaximumWidth(melodyLab->sizeHint().width());
	m_playMelodyChB = new QCheckBox(TexTrans::playMelodyTxt(), this);
		m_playMelodyChB->setStatusTip(tableTip(TexTrans::playDescTxt(), TQAtype::e_asNote, TQAtype::e_asSound, nootFontSize));
	m_writeMelodyChB = new QCheckBox(TexTrans::writeMelodyTxt(), this);
		m_writeMelodyChB->setStatusTip(tableTip(TexTrans::writeDescTxt(), TQAtype::e_asSound, TQAtype::e_asNote, nootFontSize));
// 		QCheckBox *m_repeatMelodyChB = new QCheckBox(tr("repeat melody"), this);
	m_melodyLengthSpin = new QSpinBox(this);
// 		m_melodyLengthSpin->setValue(5);
		m_melodyLengthSpin->setMinimum(1);
		m_melodyLengthSpin->setMaximum(50);
		m_melodyLengthSpin->setStatusTip(tr("Maximum number of notes in a melody. Melody length is random value between 70% and 100% of that number."));
	QLabel *lenghtLab = new QLabel(tr("Melody length"), this);
		lenghtLab->setStatusTip(m_melodyLengthSpin->statusTip());
		
	m_finishOnTonicChB = new QCheckBox(tr("Melody ends on tonic note"), this);
		m_finishOnTonicChB->setStatusTip(tr("Determines the last note of a melody.<br>When set, melody will be finished on tonic note of actual key signature."));
	
	m_tableWdg->setLayout(qaLay);
  m_paintHandler = new TpaintHandler(widget());
  m_paintHandler->setLayout(tabLay);
//.........这里部分代码省略.........
开发者ID:SeeLook,项目名称:nootka,代码行数:101,代码来源:questionssettings.cpp


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