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


C++ QSizePolicy::setVerticalStretch方法代码示例

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


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

示例1: initUI

void YZParserConfigWidget::initUI()
{
    configWidget = new QWidget(this);
    resultWidget = new QWidget(this);
    targetWidget = new QWidget(this);
    configUi.setupUi(configWidget);
    resultUi.setupUi(resultWidget);
    targetUi.setupUi(targetWidget);

    QSplitter *splitter1 = new QSplitter(this);
    splitter1->setLayoutDirection(Qt::LeftToRight);
    splitter1->addWidget(configWidget);
    splitter1->addWidget(targetWidget);
    QSplitter *splitter2 = new QSplitter(this);
    QSizePolicy policy;
    policy.setVerticalStretch(2);
    splitter2->setOrientation(Qt::Vertical);
    splitter2->addWidget(splitter1);
    splitter2->widget(0)->setSizePolicy(policy);
    splitter2->addWidget(resultWidget);
    policy.setVerticalStretch(1);
    splitter2->widget(1)->setSizePolicy(policy);
    QHBoxLayout *layout = new QHBoxLayout(this);
    layout->addWidget(splitter2);
}
开发者ID:hrbesd,项目名称:labrador,代码行数:25,代码来源:yzparserconfigwidget.cpp

示例2: sizePolicy

VBoxSettingsTreeViewSelector::VBoxSettingsTreeViewSelector (QWidget *aParent /* = NULL */)
    :VBoxSettingsSelector (aParent)
{
    mTwSelector = new QITreeWidget (aParent);
    /* Configure the selector */
    QSizePolicy sizePolicy (QSizePolicy::Minimum, QSizePolicy::Expanding);
    sizePolicy.setHorizontalStretch (0);
    sizePolicy.setVerticalStretch (0);
    sizePolicy.setHeightForWidth (mTwSelector->sizePolicy().hasHeightForWidth());
    const QStyle *pStyle = QApplication::style();
    const int iIconMetric = pStyle->pixelMetric(QStyle::PM_SmallIconSize);
    mTwSelector->setSizePolicy (sizePolicy);
    mTwSelector->setVerticalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
    mTwSelector->setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
    mTwSelector->setRootIsDecorated (false);
    mTwSelector->setUniformRowHeights (true);
    mTwSelector->setIconSize(QSize((int)(1.5 * iIconMetric), (int)(1.5 * iIconMetric)));
    /* Add the columns */
    mTwSelector->headerItem()->setText (treeWidget_Category, "Category");
    mTwSelector->headerItem()->setText (treeWidget_Id, "[id]");
    mTwSelector->headerItem()->setText (treeWidget_Link, "[link]");
    /* Hide unnecessary columns and header */
    mTwSelector->header()->hide();
    mTwSelector->hideColumn (treeWidget_Id);
    mTwSelector->hideColumn (treeWidget_Link);
    /* Setup connections */
    connect (mTwSelector, SIGNAL (currentItemChanged (QTreeWidgetItem*, QTreeWidgetItem*)),
             this, SLOT (settingsGroupChanged (QTreeWidgetItem *, QTreeWidgetItem*)));
}
开发者ID:jeppeter,项目名称:vbox,代码行数:29,代码来源:VBoxSettingsSelector.cpp

示例3: setStretch

static void setStretch(QWidget *w, int sf)
{
    QSizePolicy sp = w->sizePolicy();
    sp.setHorizontalStretch(sf);
    sp.setVerticalStretch(sf);
    w->setSizePolicy(sp);
}
开发者ID:Fale,项目名称:qtmoko,代码行数:7,代码来源:qsplitter.cpp

示例4: initWidgets

void CMakeRunPage::initWidgets()
{
    QFormLayout *fl = new QFormLayout;
    setLayout(fl);
    // Description Label
    m_descriptionLabel = new QLabel(this);
    m_descriptionLabel->setWordWrap(true);

    fl->addRow(m_descriptionLabel);

    if (m_cmakeWizard->cmakeManager()->isCMakeExecutableValid()) {
        m_cmakeExecutable = 0;
    } else {
        QString text = tr("Please specify the path to the cmake executable. No cmake executable was found in the path.");
        QString cmakeExecutable = m_cmakeWizard->cmakeManager()->cmakeExecutable();
        if (!cmakeExecutable.isEmpty()) {
            QFileInfo fi(cmakeExecutable);
            if (!fi.exists())
                text += tr(" The cmake executable (%1) does not exist.").arg(cmakeExecutable);
            else if (!fi.isExecutable())
                text += tr(" The path %1 is not a executable.").arg(cmakeExecutable);
            else
                text += tr(" The path %1 is not a valid cmake.").arg(cmakeExecutable);
        }

        fl->addRow(new QLabel(text, this));
        // Show a field for the user to enter
        m_cmakeExecutable = new Utils::PathChooser(this);
        m_cmakeExecutable->setExpectedKind(Utils::PathChooser::Command);
        fl->addRow("CMake Executable", m_cmakeExecutable);
    }

    // Run CMake Line (with arguments)
    m_argumentsLineEdit = new QLineEdit(this);
    connect(m_argumentsLineEdit,SIGNAL(returnPressed()), this, SLOT(runCMake()));

    m_generatorComboBox = new QComboBox(this);

    m_runCMake = new QPushButton(this);
    m_runCMake->setText(tr("Run CMake"));
    connect(m_runCMake, SIGNAL(clicked()), this, SLOT(runCMake()));

    QHBoxLayout *hbox = new QHBoxLayout;
    hbox->addWidget(m_argumentsLineEdit);
    hbox->addWidget(m_generatorComboBox);
    hbox->addWidget(m_runCMake);

    fl->addRow(tr("Arguments"), hbox);

    // Bottom output window
    m_output = new QPlainTextEdit(this);
    m_output->setReadOnly(true);
    QSizePolicy pl = m_output->sizePolicy();
    pl.setVerticalStretch(1);
    m_output->setSizePolicy(pl);
    fl->addRow(m_output);
    setTitle(tr("Run CMake"));
}
开发者ID:TheProjecter,项目名称:project-qtcreator,代码行数:58,代码来源:cmakeopenprojectwizard.cpp

示例5: setStretchFactor

/*!
    Updates the size policy of the widget at position \a index to
    have a stretch factor of \a stretch.

    \a stretch is not the effective stretch factor; the effective
    stretch factor is calculated by taking the initial size of the 
    widget and multiplying it with \a stretch.

    This function is provided for convenience. It is equivalent to

    \snippet doc/src/snippets/code/src_gui_widgets_qsplitter.cpp 0

    \sa setSizes(), widget()
*/
void QSplitter::setStretchFactor(int index, int stretch)
{
    Q_D(QSplitter);
    if (index <= -1 || index >= d->list.count())
        return;

    QWidget *widget = d->list.at(index)->widget;
    QSizePolicy sp = widget->sizePolicy();
    sp.setHorizontalStretch(stretch);
    sp.setVerticalStretch(stretch);
    widget->setSizePolicy(sp);
}
开发者ID:Fale,项目名称:qtmoko,代码行数:26,代码来源:qsplitter.cpp

示例6: widget

void 
AnimatedSplitter::setGreedyWidget(int index)
{
    m_greedyIndex = index;
    if( !widget( index ) )
        return;
    QSizePolicy policy = widget( m_greedyIndex )->sizePolicy();
    if( orientation() == Qt::Horizontal )
        policy.setHorizontalStretch( 1 );
    else
        policy.setVerticalStretch( 1 );
    widget( m_greedyIndex )->setSizePolicy( policy );
    
}
开发者ID:tdfischer,项目名称:tomahawk,代码行数:14,代码来源:animatedsplitter.cpp

示例7: buildGui

void MailView::buildGui() {
    QVBoxLayout *mainLayout = new QVBoxLayout(this);
    setLayout(mainLayout);
    
    QFormLayout* formLayout = new QFormLayout();
    mainLayout->addLayout(formLayout);

    txtAddress = new QLineEdit();
    txtSubject = new QLineEdit();
    txtText = new QTextEdit();
    
    txtAddress->setObjectName("txtAddress");
    txtSubject->setObjectName("txtSubject");
    txtText->setObjectName("txtText");
    
    btnAddress = new QPushButton(this);
    lblSubject = new QLabel("Subject:");
    lblText = new QLabel("Text:");
    
    QSizePolicy policy = txtText->sizePolicy();
    policy.setVerticalStretch(1);
    txtText->setSizePolicy(policy);
    
    formLayout->addRow(btnAddress, txtAddress);
    formLayout->addRow(lblSubject, txtSubject);
    formLayout->addRow(lblText, txtText);
   
    txtAddress->setReadOnly(true);
    txtSubject->setReadOnly(true);
    txtText->setReadOnly(true);
    
    QHBoxLayout *bottomLayout = new QHBoxLayout(this);
    mainLayout->addLayout(bottomLayout);
    
    QPushButton* btnSend = new QPushButton("Send", this);
    bottomLayout->addWidget(btnSend);
    connect(btnSend, SIGNAL(clicked()), this, SLOT(send()));
    
    QPushButton* btnCancel = new QPushButton("Cancel", this);
    bottomLayout->addWidget(btnCancel);
    connect(btnCancel, SIGNAL(clicked()), this, SLOT(cancel()));
}
开发者ID:HSHL,项目名称:mailclient,代码行数:42,代码来源:MailView.cpp

示例8: init_controls_area

void Data_analysis_gui::init_controls_area() {
  QVBoxLayout * vbox = new QVBoxLayout();
  controls_box_->setLayout(vbox);
  /*
  controls_box_->setOrientation( Qt::Vertical );
  controls_box_->setColumns( 1 );
  */
  QRect controls_tabwidget_geom = controls_tabwidget_->geometry();
  controls_tabwidget_geom.setWidth( 220 );
  controls_tabwidget_->setGeometry( controls_tabwidget_geom );

  QSizePolicy policy;
  policy.setHorizontalStretch(1);
  policy.setVerticalStretch(1);
  controls_tabwidget_->setSizePolicy(policy);

  //splitter_->setResizeMode( controls_tabwidget_, QSplitter::KeepSize );

  // signal-slot connections for the axis preferences
  QObject::connect( minx_edit_, SIGNAL( returnPressed() ),
                    this, SLOT( set_x_axis_min() ) );
  QObject::connect( maxx_edit_, SIGNAL( returnPressed() ),
                    this, SLOT( set_x_axis_max() ) );
  QObject::connect( miny_edit_, SIGNAL( returnPressed() ),
                    this, SLOT( set_y_axis_min() ) );
  QObject::connect( maxy_edit_, SIGNAL( returnPressed() ),
                    this, SLOT( set_y_axis_max() ) );

  QObject::connect( reset_axis_x_button_, SIGNAL( clicked() ),
                    this, SLOT( reset_x_axis() ) );
  QObject::connect( reset_axis_y_button_, SIGNAL( clicked() ),
                    this, SLOT( reset_y_axis() ) );

  QObject::connect( x_logscale_checkbox_, SIGNAL( toggled( bool ) ),
                    this, SLOT( set_x_axis_logscale( bool ) ) );
  QObject::connect( y_logscale_checkbox_, SIGNAL( toggled( bool ) ),
                    this, SLOT( set_y_axis_logscale( bool ) ) );

}
开发者ID:DMachuca,项目名称:ar2tech-SGeMS-public,代码行数:39,代码来源:data_analysis_gui.cpp

示例9: RazorPanelPlugin

/**
 * @brief constructor
 */
RazorClock::RazorClock(const RazorPanelPluginStartInfo* startInfo, QWidget* parent):
        RazorPanelPlugin(startInfo, parent),
        calendarDialog(0)
{
    setObjectName("Clock");
    clockFormat = "hh:mm";

    gui = new ClockLabel(this);
    gui->setAlignment(Qt::AlignCenter);
    this->layout()->setAlignment(Qt::AlignCenter);
    QSizePolicy sizePolicy = QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    sizePolicy.setHorizontalStretch(0);
    sizePolicy.setVerticalStretch(0);
    gui->setSizePolicy(sizePolicy);
    this->setSizePolicy(sizePolicy);
    addWidget(gui);

    connect(gui, SIGNAL(fontChanged()), this, SLOT(updateMinWidth()));
    settigsChanged();

    clocktimer = new QTimer(this);
    connect (clocktimer, SIGNAL(timeout()), this, SLOT(updateTime()));
    clocktimer->start(1000);
}
开发者ID:hronus,项目名称:razor-qt,代码行数:27,代码来源:razorclock.cpp

示例10: domPropertyToVariant


//.........这里部分代码省略.........

    case DomProperty::Font: {
        const DomFont *font = p->elementFont();

        QFont f;
        if (font->hasElementFamily() && !font->elementFamily().isEmpty())
            f.setFamily(font->elementFamily());
        if (font->hasElementPointSize() && font->elementPointSize() > 0)
            f.setPointSize(font->elementPointSize());
        if (font->hasElementWeight() && font->elementWeight() > 0)
            f.setWeight(font->elementWeight());
        if (font->hasElementItalic())
            f.setItalic(font->elementItalic());
        if (font->hasElementBold())
            f.setBold(font->elementBold());
        if (font->hasElementUnderline())
            f.setUnderline(font->elementUnderline());
        if (font->hasElementStrikeOut())
            f.setStrikeOut(font->elementStrikeOut());
        if (font->hasElementKerning())
            f.setKerning(font->elementKerning());
        if (font->hasElementAntialiasing())
            f.setStyleStrategy(font->elementAntialiasing() ? QFont::PreferDefault : QFont::NoAntialias);
        if (font->hasElementStyleStrategy()) {
            f.setStyleStrategy(enumKeyOfObjectToValue<QAbstractFormBuilderGadget, QFont::StyleStrategy>("styleStrategy", font->elementStyleStrategy().toLatin1()));
        }
        return QVariant::fromValue(f);
    }

    case DomProperty::Date: {
        const DomDate *date = p->elementDate();
        return QVariant(QDate(date->elementYear(), date->elementMonth(), date->elementDay()));
    }

    case DomProperty::Time: {
        const DomTime *t = p->elementTime();
        return QVariant(QTime(t->elementHour(), t->elementMinute(), t->elementSecond()));
    }

    case DomProperty::DateTime: {
        const DomDateTime *dateTime = p->elementDateTime();
        const QDate d(dateTime->elementYear(), dateTime->elementMonth(), dateTime->elementDay());
        const QTime tm(dateTime->elementHour(), dateTime->elementMinute(), dateTime->elementSecond());
        return QVariant(QDateTime(d, tm));
    }

    case DomProperty::Url: {
        const DomUrl *url = p->elementUrl();
        return QVariant(QUrl(url->elementString()->text()));
    }

#ifndef QT_NO_CURSOR
    case DomProperty::Cursor:
        return QVariant::fromValue(QCursor(static_cast<Qt::CursorShape>(p->elementCursor())));

    case DomProperty::CursorShape:
        return QVariant::fromValue(QCursor(enumKeyOfObjectToValue<QAbstractFormBuilderGadget, Qt::CursorShape>("cursorShape", p->elementCursorShape().toLatin1())));
#endif

    case DomProperty::Locale: {
        const DomLocale *locale = p->elementLocale();
        return QVariant::fromValue(QLocale(enumKeyOfObjectToValue<QAbstractFormBuilderGadget, QLocale::Language>("language", locale->attributeLanguage().toLatin1()),
                    enumKeyOfObjectToValue<QAbstractFormBuilderGadget, QLocale::Country>("country", locale->attributeCountry().toLatin1())));
    }
    case DomProperty::SizePolicy: {
        const DomSizePolicy *sizep = p->elementSizePolicy();

        QSizePolicy sizePolicy;
        sizePolicy.setHorizontalStretch(sizep->elementHorStretch());
        sizePolicy.setVerticalStretch(sizep->elementVerStretch());

        const QMetaEnum sizeType_enum = metaEnum<QAbstractFormBuilderGadget>("sizeType");

        if (sizep->hasElementHSizeType()) {
            sizePolicy.setHorizontalPolicy((QSizePolicy::Policy) sizep->elementHSizeType());
        } else if (sizep->hasAttributeHSizeType()) {
            const QSizePolicy::Policy sp = enumKeyToValue<QSizePolicy::Policy>(sizeType_enum, sizep->attributeHSizeType().toLatin1());
            sizePolicy.setHorizontalPolicy(sp);
        }

        if (sizep->hasElementVSizeType()) {
            sizePolicy.setVerticalPolicy((QSizePolicy::Policy) sizep->elementVSizeType());
        } else if (sizep->hasAttributeVSizeType()) {
            const  QSizePolicy::Policy sp = enumKeyToValue<QSizePolicy::Policy>(sizeType_enum, sizep->attributeVSizeType().toLatin1());
            sizePolicy.setVerticalPolicy(sp);
        }

        return QVariant::fromValue(sizePolicy);
    }

    case DomProperty::StringList:
        return QVariant(p->elementStringList()->elementString());

    default:
        uiLibWarning(QCoreApplication::translate("QFormBuilder", "Reading properties of the type %1 is not supported yet.").arg(p->kind()));
        break;
    }

    return QVariant();
}
开发者ID:hkahn,项目名称:qt5-qttools-nacl,代码行数:101,代码来源:properties.cpp

示例11: initWidgets

void CMakeRunPage::initWidgets()
{
    QFormLayout *fl = new QFormLayout;
    fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    setLayout(fl);
    // Description Label
    m_descriptionLabel = new QLabel(this);
    m_descriptionLabel->setWordWrap(true);

    fl->addRow(m_descriptionLabel);

    if (m_cmakeWizard->cmakeManager()->isCMakeExecutableValid()) {
        m_cmakeExecutable = 0;
    } else {
        QString text = tr("Please specify the path to the cmake executable. No cmake executable was found in the path.");
        QString cmakeExecutable = m_cmakeWizard->cmakeManager()->cmakeExecutable();
        if (!cmakeExecutable.isEmpty()) {
            QFileInfo fi(cmakeExecutable);
            if (!fi.exists())
                text += tr(" The cmake executable (%1) does not exist.").arg(cmakeExecutable);
            else if (!fi.isExecutable())
                text += tr(" The path %1 is not a executable.").arg(cmakeExecutable);
            else
                text += tr(" The path %1 is not a valid cmake.").arg(cmakeExecutable);
        }

        QLabel *cmakeLabel = new QLabel(text);
        cmakeLabel->setWordWrap(true);
        fl->addRow(cmakeLabel);
        // Show a field for the user to enter
        m_cmakeExecutable = new Utils::PathChooser(this);
        m_cmakeExecutable->setExpectedKind(Utils::PathChooser::ExistingCommand);
        fl->addRow("cmake Executable:", m_cmakeExecutable);
    }

    // Run CMake Line (with arguments)
    m_argumentsLineEdit = new QLineEdit(this);
    connect(m_argumentsLineEdit,SIGNAL(returnPressed()), this, SLOT(runCMake()));
    fl->addRow(tr("Arguments:"), m_argumentsLineEdit);

    m_generatorComboBox = new QComboBox(this);
    fl->addRow(tr("Generator:"), m_generatorComboBox);

    m_runCMake = new QPushButton(this);
    m_runCMake->setText(tr("Run CMake"));
    connect(m_runCMake, SIGNAL(clicked()), this, SLOT(runCMake()));

    QHBoxLayout *hbox2 = new QHBoxLayout;
    hbox2->addStretch(10);
    hbox2->addWidget(m_runCMake);
    fl->addRow(hbox2);

    // Bottom output window
    m_output = new QPlainTextEdit(this);
    m_output->setReadOnly(true);
    // set smaller minimum size to avoid vanishing descriptions if all of the
    // above is shown and the dialog not vertically resizing to fit stuff in (Mac)
    m_output->setMinimumHeight(15);
    QFont f(TextEditor::FontSettings::defaultFixedFontFamily());
    f.setStyleHint(QFont::TypeWriter);
    m_output->setFont(f);
    QSizePolicy pl = m_output->sizePolicy();
    pl.setVerticalStretch(1);
    m_output->setSizePolicy(pl);
    fl->addRow(m_output);

    m_exitCodeLabel = new QLabel(this);
    m_exitCodeLabel->setVisible(false);
    fl->addRow(m_exitCodeLabel);

    setTitle(tr("Run CMake"));
    setMinimumSize(600, 400);
}
开发者ID:KDE,项目名称:android-qt-creator,代码行数:73,代码来源:cmakeopenprojectwizard.cpp

示例12: construct

//-----------------------------------------------------------------------------------------------
// constructs the view
//-----------------------------------------------------------------------------------------------
void InspectorProdWell::construct()
{
    setWindowTitle("Production Well " + p_well->name() + " Properties");

    QScrollArea *scroll_area = new QScrollArea(this);

    widget = new QWidget(this);
    widget->setMinimumSize(600, 300);

    scroll_area->setAlignment(Qt::AlignCenter);
    scroll_area->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    scroll_area->setWidget(widget);

    QSizePolicy policy = scroll_area->sizePolicy();
    policy.setVerticalStretch(1);
    policy.setHorizontalStretch(1);
    policy.setVerticalPolicy(QSizePolicy::Expanding);

    QVBoxLayout *layout_main = new QVBoxLayout(this);
    setLayout(layout_main);

    QVBoxLayout *layout = new QVBoxLayout(widget);
    int row = 0;

    widget->setLayout(layout);

    // ---- setting up the control variables -----
    box_control = new QGroupBox("Control Variables", widget);
    box_control->setStyleSheet("QGroupBox{border:2px solid gray;border-radius:5px;margin-top: 1ex;} QGroupBox::title{subcontrol-origin: margin;subcontrol-position:top center;padding:0 3px;}");
    box_control->setFixedWidth(500);
    QVBoxLayout *layout_control = new QVBoxLayout(box_control);

    box_control->setLayout(layout_control);


    for(int i = 0; i < p_well->numberOfControls(); ++i)
    {
        WellControl *wc = p_well->control(i);
        InspectorWellControl *iwc = new InspectorWellControl(wc->endTime(), wc->controlVar()->value(), wc->controlVar()->max(), wc->controlVar()->min(), wc->type(), widget, i == 0);
        m_controls.push_back(iwc);
        layout_control->addWidget(iwc);
    }

    // show/hide
    p_btn_control = new QPushButton("-", widget);
    p_btn_control->setFixedSize(25, 25);
    p_btn_control->setCheckable(true);
    p_btn_control->setChecked(false);
    connect(p_btn_control, SIGNAL(toggled(bool)), this, SLOT(hideControls(bool)));
    layout_control->addWidget(p_btn_control);



    layout->addWidget(box_control, 0, Qt::AlignHCenter);
    ++row;

    // ---- setting up the gas lift variables -----
    if(p_well->hasGasLift())
    {
        box_gaslift = new QGroupBox("Gas Lift Variables", widget);
        box_gaslift->setStyleSheet("QGroupBox{border:2px solid gray;border-radius:5px;margin-top: 1ex;} QGroupBox::title{subcontrol-origin: margin;subcontrol-position:top center;padding:0 3px;}");
        box_gaslift->setFixedWidth(500);

        QVBoxLayout *layout_gaslift = new QVBoxLayout(box_gaslift);
        //layout_control->setSizeConstraint(QLayout::SetFixedSize);
        box_gaslift->setLayout(layout_gaslift);

        for(int i = 0; i < p_well->numberOfGasLiftControls(); ++i)
        {
            WellControl *gl = p_well->gasLiftControl(i);
            InspectorGasLift *igl = new InspectorGasLift(gl->endTime(), gl->controlVar()->value(), gl->controlVar()->max(), gl->controlVar()->min(), widget, i == 0);
            m_gaslift.push_back(igl);
            layout_gaslift->addWidget(igl);
        }

        // show/hide
        p_btn_gaslift = new QPushButton("-", widget);
        p_btn_gaslift->setFixedSize(25, 25);
        p_btn_gaslift->setCheckable(true);
        p_btn_gaslift->setChecked(false);
        connect(p_btn_gaslift, SIGNAL(toggled(bool)), this, SLOT(hideGasLift(bool)));
        layout_gaslift->addWidget(p_btn_gaslift);


        layout->addWidget(box_gaslift, 0, Qt::AlignHCenter);
        ++row;


    }
开发者ID:iocenter,项目名称:ResOpt,代码行数:92,代码来源:inspectorprodwell.cpp

示例13: QWidget


//.........这里部分代码省略.........
      QToolButton* tempo100 = new QToolButton();
      tempo100->setText(tr("N"));
      tempo100->setFocusPolicy(Qt::NoFocus);
      toolbar->addWidget(tempo100);
      connect(tempo100, SIGNAL(clicked()), SLOT(setTempo100()));
      
      QToolButton* tempo200 = new QToolButton();
      tempo200->setText(QString("200%"));
      tempo200->setFocusPolicy(Qt::NoFocus);
      toolbar->addWidget(tempo200);
      connect(tempo200, SIGNAL(clicked()), SLOT(setTempo200()));

      QVBoxLayout* box  = new QVBoxLayout(this);
      box->setContentsMargins(0, 0, 0, 0);
      box->setSpacing(0);
      box->addWidget(MusECore::hLine(this), Qt::AlignTop);

      //---------------------------------------------------
      //  Tracklist
      //---------------------------------------------------

      int xscale = -100;
      int yscale = 1;

      split  = new Splitter(Qt::Horizontal, this, "split");
      split->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
      box->addWidget(split, 1000);

      tracklist = new QWidget(split);

      split->setStretchFactor(split->indexOf(tracklist), 0);
      QSizePolicy tpolicy = QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
      tpolicy.setHorizontalStretch(0);
      tpolicy.setVerticalStretch(100);
      tracklist->setSizePolicy(tpolicy);

      editor = new QWidget(split);
      split->setStretchFactor(split->indexOf(editor), 1);
      QSizePolicy epolicy = QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
      epolicy.setHorizontalStretch(255);
      epolicy.setVerticalStretch(100);
      editor->setSizePolicy(epolicy);

      //---------------------------------------------------
      //    Track Info
      //---------------------------------------------------

      infoScroll = new ScrollBar(Qt::Vertical, true, tracklist);
      infoScroll->setObjectName("infoScrollBar");
      //genTrackInfo(tracklist); // Moved below

      // Track-Info Button
      ib  = new QToolButton(tracklist);
      ib->setText(tr("TrackInfo"));
      ib->setCheckable(true);
      ib->setChecked(showTrackinfoFlag);
      ib->setFocusPolicy(Qt::NoFocus);
      connect(ib, SIGNAL(toggled(bool)), SLOT(showTrackInfo(bool)));
      
      // set up the header
      header = new Header(tracklist, "header");
      header->setFixedHeight(30);

      QFontMetrics fm1(header->font());
      int fw = 11;
开发者ID:kris4him,项目名称:muse,代码行数:66,代码来源:arranger.cpp

示例14: EDBHandle

HistoryDlg::HistoryDlg(const Jid &jid, PsiAccount *pa)
{
	setAttribute(Qt::WA_DeleteOnClose);
	d = new Private;
	d->pa = pa;
	d->jid = jid;
	d->pa->dialogRegister(this, d->jid);
	d->exp = 0;

	setWindowTitle(d->jid.full());
#ifndef Q_WS_MAC
	setWindowIcon(IconsetFactory::icon("psi/history").icon());
#endif

	d->h = new EDBHandle(d->pa->edb());
	connect(d->h, SIGNAL(finished()), SLOT(edb_finished()));

	QVBoxLayout *vb1 = new QVBoxLayout(this);
	d->lv = new HistoryView(this);
	d->lv->setVScrollBarMode(Q3ScrollView::AlwaysOn);
	connect(d->lv, SIGNAL(aOpenEvent(PsiEvent *)), SLOT(actionOpenEvent(PsiEvent *)));
	QSizePolicy sp = d->lv->sizePolicy();
	sp.setVerticalStretch(1);
	d->lv->setSizePolicy(sp);
	vb1->addWidget(d->lv);

	QHBoxLayout *hb1 = new QHBoxLayout;
	vb1->addLayout(hb1);

	QVBoxLayout *vb2 = new QVBoxLayout;
	hb1->addLayout(vb2);

	QHBoxLayout *hb2 = new QHBoxLayout;
	vb2->addLayout(hb2);

	//d->busy = new BusyWidget(this);
	//hb1->addWidget(d->busy);

	d->pb_refresh = new QPushButton(tr("&Latest"), this);
	d->pb_refresh->setMinimumWidth(80);
	connect(d->pb_refresh, SIGNAL(clicked()), SLOT(doLatest()));
	hb2->addWidget(d->pb_refresh);

	d->pb_prev = new QPushButton(tr("&Previous"), this);
	d->pb_prev->setMinimumWidth(80);
	connect(d->pb_prev, SIGNAL(clicked()), SLOT(doPrev()));
	hb2->addWidget(d->pb_prev);

	d->pb_next = new QPushButton(tr("&Next"), this);
	d->pb_next->setMinimumWidth(80);
	connect(d->pb_next, SIGNAL(clicked()), SLOT(doNext()));
	hb2->addWidget(d->pb_next);

	QHBoxLayout *hb3 = new QHBoxLayout;
	vb2->addLayout(hb3);

	d->le_find = new QLineEdit(this);
	connect(d->le_find, SIGNAL(textChanged(const QString &)), SLOT(le_textChanged(const QString &)));
	connect(d->le_find, SIGNAL(returnPressed()), SLOT(doFind()));
	hb3->addWidget(d->le_find);
	d->pb_find = new QPushButton(tr("Find"), this);
	connect(d->pb_find, SIGNAL(clicked()), SLOT(doFind()));
	d->pb_find->setEnabled(false);
	hb3->addWidget(d->pb_find);

	QFrame *sep;
	sep = new QFrame(this);
	sep->setFrameShape(QFrame::VLine);
	hb1->addWidget(sep);

	QVBoxLayout *vb3 = new QVBoxLayout;
	hb1->addLayout(vb3);

	QPushButton *pb_save = new QPushButton(tr("&Export..."), this);
	connect(pb_save, SIGNAL(clicked()), SLOT(doSave()));
	vb3->addWidget(pb_save);
	QPushButton *pb_erase = new QPushButton(tr("Er&ase All"), this);
	connect(pb_erase, SIGNAL(clicked()), SLOT(doErase()));
	vb3->addWidget(pb_erase);

	sep = new QFrame(this);
	sep->setFrameShape(QFrame::VLine);
	hb1->addWidget(sep);

	hb1->addStretch(1);

	QVBoxLayout *vb4 = new QVBoxLayout;
	hb1->addLayout(vb4);
	vb4->addStretch(1);

	QPushButton *pb_close = new QPushButton(tr("&Close"), this);
	pb_close->setMinimumWidth(80);
	connect(pb_close, SIGNAL(clicked()), SLOT(close()));
	vb4->addWidget(pb_close);

	resize(520,320);

	X11WM_CLASS("history");

	d->le_find->setFocus();
//.........这里部分代码省略.........
开发者ID:AlekSi,项目名称:psi,代码行数:101,代码来源:historydlg.cpp


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