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


C++ QMargins::bottom方法代码示例

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


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

示例1: QWidget

QWidget * ExtcapArgumentFileSelection::createEditor(QWidget * parent)
{
    QWidget * fileWidget = new QWidget(parent);
    QHBoxLayout * editLayout = new QHBoxLayout();
    QMargins margins = editLayout->contentsMargins();
    editLayout->setContentsMargins(0, 0, 0, margins.bottom());
    fileWidget->setContentsMargins(margins.left(), margins.right(), 0, margins.bottom());
    QPushButton * button = new QPushButton(UTF8_HORIZONTAL_ELLIPSIS, fileWidget);

    textBox = new QLineEdit(_default->toString(), parent);
    textBox->setReadOnly(true);

    if ( _argument->default_complex != NULL && _argument->arg_type == EXTCAP_ARG_STRING )
        textBox->setText(QString().fromUtf8(extcap_complex_get_string(_argument->default_complex)));

    if ( _argument->tooltip != NULL )
    {
        textBox->setToolTip(QString().fromUtf8(_argument->tooltip));
        button->setToolTip(QString().fromUtf8(_argument->tooltip));
    }


    connect(button, SIGNAL(clicked()), (QObject *)this, SLOT(openFileDialog()));

    editLayout->addWidget(textBox);
    editLayout->addWidget(button);

    fileWidget->setLayout(editLayout);

    return fileWidget;
}
开发者ID:Nicholas1126,项目名称:wireshark-ex,代码行数:31,代码来源:extcap_argument_file.cpp

示例2: maxMargins

static QMargins maxMargins(const QMargins &a,
                           const QMargins &b)
{
    return QMargins(qMax(a.left(), b.left()),
                    qMax(a.top(), b.top()),
                    qMax(a.right(), b.right()),
                    qMax(a.bottom(), b.bottom()));
}
开发者ID:LucasGH,项目名称:tiled,代码行数:8,代码来源:tilelayer.cpp

示例3: saveInSettings

void saveInSettings(QSettings& settingsObj, const QString &name, const QMargins  &value)
{
    settingsObj.setValue(name + "/left", value.left());
    settingsObj.setValue(name + "/top", value.top());
    settingsObj.setValue(name + "/right", value.right());
    settingsObj.setValue(name + "/bottom", value.bottom());
}
开发者ID:seleznevae,项目名称:JaG,代码行数:7,代码来源:settings.cpp

示例4: getLayoutInfo

QString LayoutDumper::getLayoutInfo(QLayout* layout)
{
    if (!layout) {
        return "null_layout";
    }
    QMargins margins = layout->contentsMargins();
    QSize sizehint = layout->sizeHint();
    QSize minsize = layout->minimumSize();
    QString name = layout->metaObject()->className();
    // usually unhelpful (blank): layout->objectName()
    QString margin = QString("margin (l=%1,t=%2,r=%3,b=%4)")
            .arg(margins.left())
            .arg(margins.top())
            .arg(margins.right())
            .arg(margins.bottom());
    QString constraint = QString("constraint %1")
            .arg(toString(layout->sizeConstraint()));
    QString sh = QString("sizeHint (%1 x %2)")
            .arg(sizehint.width())
            .arg(sizehint.height());
    QString ms = QString("minimumSize (%7 x %8)")
            .arg(minsize.width())
            .arg(minsize.height());
    QString hfw = layout->hasHeightForWidth() ? " [hasHeightForWidth]" : "";
    return QString("%1, %2, %3, %4, %5%6")
            .arg(name)
            .arg(margin)
            .arg(constraint)
            .arg(sh)
            .arg(ms)
            .arg(hfw);
}
开发者ID:RudolfCardinal,项目名称:camcops,代码行数:32,代码来源:layoutdumper.cpp

示例5: updateBoundingRect

void BrushItem::updateBoundingRect()
{
    prepareGeometryChange();

    if (!mMapDocument) {
        mBoundingRect = QRectF();
        return;
    }

    const QRect bounds = mRegion.boundingRect();
    mBoundingRect = mMapDocument->renderer()->boundingRect(bounds);

    // Adjust for amount of pixels tiles extend at the top and to the right
    if (mTileLayer) {
        const Map *map = mMapDocument->map();

        QMargins drawMargins = mTileLayer->drawMargins();
        drawMargins.setTop(drawMargins.top() - map->tileHeight());
        drawMargins.setRight(drawMargins.right() - map->tileWidth());

        // Since we're also drawing a tile selection, we should not apply
        // negative margins
        mBoundingRect.adjust(qMin(0, -drawMargins.left()),
                             qMin(0, -drawMargins.top()),
                             qMax(0, drawMargins.right()),
                             qMax(0, drawMargins.bottom()));
    }
}
开发者ID:Arnaud-Trouche,项目名称:tiled,代码行数:28,代码来源:brushitem.cpp

示例6: setMargins

void HGLayout::setMargins(const QMargins& m)
{
    if (layout()) {
        layout()->setContentsMargins(m.left(), m.top(), m.right(), m.bottom());
    }
    HLayout::setMargins(m);
}
开发者ID:huqiuyun,项目名称:qt.project,代码行数:7,代码来源:hglayout.cpp

示例7: handleMouseEventWithDecoration

void QWaylandWindow::handleMouseEventWithDecoration(QWaylandInputDevice *inputDevice, ulong timestamp, const QPointF &local, const QPointF &global, Qt::MouseButtons b, Qt::KeyboardModifiers mods)
{
    if (mWindowDecoration->handleMouse(inputDevice,local,global,b,mods))
        return;

    QMargins marg = frameMargins();
    QRect windowRect(0 + marg.left(),
                     0 + marg.top(),
                     geometry().size().width() - marg.right(),
                     geometry().size().height() - marg.bottom());
    if (windowRect.contains(local.toPoint()) || mMousePressedInContentArea != Qt::NoButton) {
        QPointF localTranslated = local;
        QPointF globalTranslated = global;
        localTranslated.setX(localTranslated.x() - marg.left());
        localTranslated.setY(localTranslated.y() - marg.top());
        globalTranslated.setX(globalTranslated.x() - marg.left());
        globalTranslated.setY(globalTranslated.y() - marg.top());
        if (!mMouseEventsInContentArea) {
            restoreMouseCursor(inputDevice);
            QWindowSystemInterface::handleEnterEvent(window());
        }
        QWindowSystemInterface::handleMouseEvent(window(), timestamp, localTranslated, globalTranslated, b, mods);
        mMouseEventsInContentArea = true;
        mMousePressedInContentArea = b;
    } else {
        if (mMouseEventsInContentArea) {
            QWindowSystemInterface::handleLeaveEvent(window());
            mMouseEventsInContentArea = false;
        }
        mWindowDecoration->handleMouse(inputDevice,local,global,b,mods);
    }
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:32,代码来源:qwaylandwindow.cpp

示例8: adjustDrawMargins

void Map::adjustDrawMargins(const QMargins &margins) {
    mDrawMargins = maxMargins(QMargins(margins.left(),
                                       margins.top() - mTileHeight,
                                       margins.right() - mTileWidth,
                                       margins.bottom()),
                              mDrawMargins);
}
开发者ID:ATSOTECK,项目名称:Aurora-Game-Editor,代码行数:7,代码来源:map.cpp

示例9: setMargins

void KWidget::setMargins( const QMargins& m )
{
    QGraphicsLayout *tmpLayout = layout();
    if(tmpLayout == NULL)
        return;
    tmpLayout->setContentsMargins(m.left(), m.top(), m.right(), m.bottom());
}
开发者ID:kxtry,项目名称:kxmob,代码行数:7,代码来源:kwidget.cpp

示例10: paintEvent

void LineEdit::paintEvent(QPaintEvent * event)
{
    QLineEdit::paintEvent(event);

    QPainter p(this);

    // draw the default text if needed
    bool showDefaultText = text().isEmpty() && !infoText_.isEmpty();
    if (showDefaultText) {
        p.setPen(Qt::gray);
        const QMargins margins = textMargins();

        p.drawText(QRect(margins.left() + 8,
                         margins.top(),
                         width() - margins.left() - margins.right() - 8,
                         height() - margins.top() - margins.bottom()),
                   infoText_,
                   Qt::AlignLeft | Qt::AlignVCenter);
    }

	// draw left icon
	if (!leftIcon_.isNull()) {
		int offset = 1 + (height() - leftIcon_.height() ) / 2;
		p.drawPixmap(offset, offset, leftIcon_);
	}

	// draw right icon
	if (!showDefaultText && !rightIcon_.isNull()) {
		p.drawPixmap(width() - rightIcon_.width() - 7, 1 + (height() - rightIcon_.height()) / 2, rightIcon_);
	}
}
开发者ID:choenig,项目名称:tingy,代码行数:31,代码来源:lineedit.cpp

示例11: prepare

void UIScaleFactorEditor::prepare()
{
    m_pMainLayout = new QGridLayout;
    if (!m_pMainLayout)
        return;
    QMargins margins = m_pMainLayout->contentsMargins();
    m_pMainLayout->setContentsMargins(0, margins.top(), 0, margins.bottom());
    m_pMonitorComboBox = new QComboBox;
    if (m_pMonitorComboBox)
    {
        m_pMainLayout->addWidget(m_pMonitorComboBox, 0, 0);
        m_pMonitorComboBox->insertItem(0, "All Monitors");
        connect(m_pMonitorComboBox ,static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
                this, &UIScaleFactorEditor::sltMonitorComboIndexChanged);
    }

    QGridLayout *pSliderLayout = new QGridLayout;
    pSliderLayout->setSpacing(0);
    m_pScaleSlider = new QIAdvancedSlider;
    {
        pSliderLayout->addWidget(m_pScaleSlider, 0, 0, 1, 3);
        m_pScaleSlider->setMinimum(100);
        m_pScaleSlider->setMaximum(200);
        m_pScaleSlider->setPageStep(10);
        m_pScaleSlider->setSingleStep(1);
        m_pScaleSlider->setTickInterval(10);
        m_pScaleSlider->setSnappingEnabled(true);
        connect(m_pScaleSlider, static_cast<void(QIAdvancedSlider::*)(int)>(&QIAdvancedSlider::valueChanged),
                this, &UIScaleFactorEditor::sltScaleSliderValueChanged);
    }

    m_pMinScaleLabel = new QLabel;
    if (m_pMinScaleLabel)
        pSliderLayout->addWidget(m_pMinScaleLabel, 1, 0);

    QSpacerItem *pSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
    if (pSpacer)
        pSliderLayout->addItem(pSpacer, 1, 1);

    m_pMaxScaleLabel = new QLabel;
    if (m_pMaxScaleLabel)
        pSliderLayout->addWidget(m_pMaxScaleLabel, 1, 2);

    m_pMainLayout->addLayout(pSliderLayout, 0, 1, 2, 1);

    m_pScaleSpinBox = new QSpinBox;
    if (m_pScaleSpinBox)
    {
        m_pMainLayout->addWidget(m_pScaleSpinBox, 0, 3);
        m_pScaleSpinBox->setSuffix("%");
        m_pScaleSpinBox->setMinimum(100);
        m_pScaleSpinBox->setMaximum(200);
        connect(m_pScaleSpinBox ,static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged),
                this, &UIScaleFactorEditor::sltScaleSpinBoxValueChanged);
    }

    configureScaleFactorMinMaxValues();
    setLayout(m_pMainLayout);
    retranslateUi();
}
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:60,代码来源:UIScaleFactorEditor.cpp

示例12: layoutContentsMargins

QRect WWidgetGroup::layoutContentsMargins() const {
    QLayout* pLayout = layout();
    QMargins margins = pLayout ? pLayout->contentsMargins() :
            contentsMargins();
    return QRect(margins.left(), margins.top(),
                 margins.right(), margins.bottom());
}
开发者ID:suyoghc,项目名称:mixxx,代码行数:7,代码来源:wwidgetgroup.cpp

示例13: sizeHint

QSize TrayIcon::sizeHint() const
{
    QMargins margins = contentsMargins();
    return QSize(margins.left() + mIconSize.width() + margins.right(),
                 margins.top() + mIconSize.height() + margins.bottom()
                );
}
开发者ID:Devoter,项目名称:razor-qt,代码行数:7,代码来源:trayicon.cpp

示例14: Put

 virtual void Put(ProgramOptions::Ptr po, const boost::any& value)
 {
     QMargins r = boost::any_cast<QMargins>(value);
     po->PutInt("Left", r.left());
     po->PutInt("Top", r.top());
     po->PutInt("Right", r.right());
     po->PutInt("Bottom", r.bottom());
 }
开发者ID:kouroshs,项目名称:ksrobot,代码行数:8,代码来源:Utils.cpp

示例15: scaled

QMargins
DpiScaler::scaled( const QMargins& margins ) const
{
    return scaled( margins.left(),
                   margins.top(),
                   margins.right(),
                   margins.bottom() );
}
开发者ID:pmpontes,项目名称:tomahawk,代码行数:8,代码来源:DpiScaler.cpp


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