本文整理汇总了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;
}
示例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()));
}
示例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());
}
示例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);
}
示例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()));
}
}
示例6: setMargins
void HGLayout::setMargins(const QMargins& m)
{
if (layout()) {
layout()->setContentsMargins(m.left(), m.top(), m.right(), m.bottom());
}
HLayout::setMargins(m);
}
示例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);
}
}
示例8: adjustDrawMargins
void Map::adjustDrawMargins(const QMargins &margins) {
mDrawMargins = maxMargins(QMargins(margins.left(),
margins.top() - mTileHeight,
margins.right() - mTileWidth,
margins.bottom()),
mDrawMargins);
}
示例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());
}
示例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_);
}
}
示例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();
}
示例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());
}
示例13: sizeHint
QSize TrayIcon::sizeHint() const
{
QMargins margins = contentsMargins();
return QSize(margins.left() + mIconSize.width() + margins.right(),
margins.top() + mIconSize.height() + margins.bottom()
);
}
示例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());
}
示例15: scaled
QMargins
DpiScaler::scaled( const QMargins& margins ) const
{
return scaled( margins.left(),
margins.top(),
margins.right(),
margins.bottom() );
}