本文整理汇总了C++中QSize::rheight方法的典型用法代码示例。如果您正苦于以下问题:C++ QSize::rheight方法的具体用法?C++ QSize::rheight怎么用?C++ QSize::rheight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSize
的用法示例。
在下文中一共展示了QSize::rheight方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wheelEvent
void MultiLayer::wheelEvent(QWheelEvent *e) {
QApplication::setOverrideCursor(Qt::waitCursor);
bool resize = false;
QPoint aux;
QSize intSize;
Graph *resize_graph = 0;
// Get the position of the mouse
int xMouse = e->x();
int yMouse = e->y();
for (int i = 0; i < (int)graphsList.count(); i++) {
Graph *gr = (Graph *)graphsList.at(i);
intSize = gr->plotWidget()->size();
aux = gr->pos();
if (xMouse > aux.x() && xMouse < (aux.x() + intSize.width())) {
if (yMouse > aux.y() && yMouse < (aux.y() + intSize.height())) {
resize_graph = gr;
resize = TRUE;
}
}
}
if (resize &&
(e->state() == Qt::AltButton || e->state() == Qt::ControlButton ||
e->state() == Qt::ShiftButton)) {
intSize = resize_graph->plotWidget()->size();
// If alt is pressed then change the width
if (e->state() == Qt::AltButton) {
if (e->delta() > 0) {
intSize.rwidth() += 5;
} else if (e->delta() < 0) {
intSize.rwidth() -= 5;
}
}
// If crt is pressed then changed the height
else if (e->state() == Qt::ControlButton) {
if (e->delta() > 0) {
intSize.rheight() += 5;
} else if (e->delta() < 0) {
intSize.rheight() -= 5;
}
}
// If shift is pressed then resize
else if (e->state() == Qt::ShiftButton) {
if (e->delta() > 0) {
intSize.rwidth() += 5;
intSize.rheight() += 5;
} else if (e->delta() < 0) {
intSize.rwidth() -= 5;
intSize.rheight() -= 5;
}
}
aux = resize_graph->pos();
resize_graph->setGeometry(QRect(QPoint(aux.x(), aux.y()), intSize));
resize_graph->plotWidget()->resize(intSize);
emit modifiedPlot();
}
QApplication::restoreOverrideCursor();
}
示例2: updateConsoleSize
void QConsolePrivate::updateConsoleSize (bool sync)
{
QFontMetrics fm (m_consoleView->font());
QSize winSize = m_consoleView->size ();
m_charSize.rwidth () = fm.averageCharWidth();
m_charSize.rheight () = fm.lineSpacing ();
m_consoleRect.setWidth (int(double(winSize.width ()) / double(fm.averageCharWidth())));
m_consoleRect.setHeight (int(double(winSize.height ()) / double(fm.lineSpacing ())));
m_bufferSize.rwidth () = m_consoleRect.width ();
m_bufferSize.rheight () = qMax (m_bufferSize.height (),
m_consoleRect.height ());
m_consoleRect.moveLeft (0);
if (m_consoleRect.bottom () >= m_bufferSize.height ())
m_consoleRect.moveTop (m_bufferSize.height () - m_consoleRect.height ());
log ("Console resized:\n");
log (" widget size: %d x %d\n", winSize.width (), winSize.height ());
log (" buffer size: %d x %d\n", m_bufferSize.width (),
m_bufferSize.height ());
log (" window: (%d, %d) -> (%d, %d) [%d x %d]\n",
m_consoleRect.left (), m_consoleRect.top (),
m_consoleRect.right (), m_consoleRect.bottom (),
m_consoleRect.width (), m_consoleRect.height ());
if (sync)
syncConsoleParameters ();
updateScrollBar ();
}
示例3: sizeHint
QSize TrackViewDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
{
QSize res = QStyledItemDelegate::sizeHint(option, index);
if (!index.parent().isValid())
{
if (!mDiskHeightHint)
{
int h = 8;
QPainter painter(mTrackView);
QFont titleFont = this->titleFont(&painter);
QFont filesFont = this->filesFont(&painter);
h += QFontMetrics(titleFont).height();
h += QFontMetrics(filesFont).height() * 2;
mDiskHeightHint = qMax(IMG_HEIGHT, h) + 2 * MARGIN + BOTTOM_PADDING; //For Line
}
res.rheight() = mDiskHeightHint;
if (index.row())
res.rheight() += TOP_PADDING;
if (index.column() == 0)
res.rwidth() = 600;
else
res.rwidth() = 0;
}
else
{
res.rheight() = res.height() + 8;
}
return res;
}
示例4: realign
void RazorTaskBar::realign()
{
mLayout->setEnabled(false);
IRazorPanel *panel = mPlugin->panel();
QSize maxSize = QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
QSize minSize = QSize(0, 0);
maxSize.setHeight(panel->lineSize());
minSize.setHeight(maxSize.height());
if (panel->isHorizontal())
{
mLayout->setRowCount(panel->lineCount());
mLayout->setColumnCount(0);
minSize.rheight() = panel->lineSize();
maxSize.rheight() = panel->lineSize();
if (mButtonStyle == Qt::ToolButtonIconOnly)
{
mLayout->setStretch(RazorGridLayout::StretchVert);
minSize.rwidth() = maxSize.height();
maxSize.rwidth() = maxSize.height();
}
else
{
mLayout->setStretch(RazorGridLayout::StretchHoriz | RazorGridLayout::StretchVert);
maxSize.rwidth() = mButtonWidth;
}
}
else
{
mLayout->setRowCount(0);
mLayout->setStretch(RazorGridLayout::NoStretch);
minSize.rheight() = panel->lineSize();
maxSize.rheight() = panel->lineSize();
if (mButtonStyle == Qt::ToolButtonIconOnly)
{
mLayout->setColumnCount(panel->lineCount());
maxSize.rwidth() = maxSize.height();
}
else
{
mLayout->setColumnCount(1);
maxSize.rwidth() = mButtonWidth;
}
minSize.rwidth() = maxSize.width();
}
mLayout->setCellMinimumSize(minSize);
mLayout->setCellMaximumSize(maxSize);
mLayout->setEnabled(true);
}
示例5: style
//=============================================================================
int sstQt01PathPaintWidgetCls::updateButtonGeometry(QToolButton *button, int x, int y)
{
QSize size = button->sizeHint();
button->setGeometry(x - size.rwidth(), y - size.rheight(),
size.rwidth(), size.rheight());
return y - size.rheight()
- style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing);
}
示例6: calculateSize
QSize XKPPlacementLayout::calculateSize(SizeType sizeType) const
{
#ifdef DEBUG_XKPPLACEMENT
qDebug() << "calculateSize()";
#endif
QSize totalSize;
for(int i = 0; i < list.size(); ++i) {
ItemWrapper *wrapper = list.at(i);
Placement position = wrapper->position;
QSize itemSize;
if(sizeType == MinimumSize)
itemSize = wrapper->item->minimumSize();
else if(sizeType == SizeHint)
itemSize = wrapper->item->sizeHint();
else if(sizeType == PlacementSize && wrapper->widget) {
if(wrapper->widget->property(placementSizeName).toSize() == QSize(-1, -1)) {
wrapper->widget->setProperty(placementSizeName, wrapper->widget->size());
itemSize = wrapper->widget->size();
} else {
itemSize = wrapper->widget->property(placementSizeName).toSize();
}
}
if(position == Top || position == Bottom || position == Center)
totalSize.rheight() += itemSize.height();
if(position == Left || position == Right || position == Center)
totalSize.rwidth() += itemSize.width();
}
return totalSize;
}
示例7: calculateSize
QSize BorderLayout::calculateSize(SizeType sizeType) const
{
QSize totalSize;
for (int i = 0; i < list.size(); ++i) {
ItemWrapper *wrapper = list.at(i);
Position position = wrapper->position;
QSize itemSize;
if (sizeType == MinimumSize)
itemSize = wrapper->item->minimumSize();
else // (sizeType == SizeHint)
itemSize = wrapper->item->sizeHint();
if (position == North || position == South || position == Center)
totalSize.rheight() += itemSize.height();
if (position == West || position == East || position == Center)
totalSize.rwidth() += itemSize.width();
}
if (totalSize.height() < 0)
totalSize.setHeight(0);
if (totalSize.width() < 0)
totalSize.setWidth(0);
return totalSize;
}
示例8: sizeHint
QSize QIrParabolicEffectManager::sizeHint() const
{
QIR_P(const QIrParabolicEffectManager);
QIrDockView * view = p->view;
QList< QIrDockletBundle * > list = view->bundles();
QIrDock * dock = view->dock();
QRectF bounding;
QRectF geom;
int sepCount = 0, count = list.count();
QIrDockStyle * style = dock->dockStyle();
int spacing = p->view->dockletSpacing();
if ( !style )
return QSize();
bounding = contentRect();
for (int i = 0; i < count; i++) {
if ( list[i]->docklet()->isSeparator() )
sepCount++;
}
QSize s = bounding.size().toSize();
if ( !dock->isExtended() ) {
QSize mindockletSize = sizeForIconSize(style,spacing,dock->effectiveMinimumIconSize(),dock->minimumIconSize(),dock->maximumIconSize(),false,dock->orientation());
QSize minSepSize = sizeForIconSize(style,spacing,dock->effectiveMinimumIconSize(),dock->minimumIconSize(),
dock->maximumIconSize(),true,dock->orientation());
if ( dock->orientation() == Qt::Horizontal ) {
s.rwidth() = (count - sepCount) * (mindockletSize.width() + 1) + sepCount * (minSepSize.width() + 1) - 1;
} else {
s.rheight() = (count - sepCount) * (mindockletSize.height() + 1) + sepCount * (minSepSize.height() + 1) - 1;
}
}
return s;
}
示例9: update
void WelcomeScreen::update()
{
// find dimensions
int max_x = 0;
int max_y = 0;
for (Buttons::const_iterator i = m_buttons.constBegin();
i != m_buttons.constEnd();
++i) {
if (i.key().x > max_x) {
max_x = i.key().x;
}
if (i.key().y > max_y) {
max_y = i.key().y;
}
}
max_x++;
max_y++;
// place buttons
QSize size = m_size;
size.rwidth() /= max_x;
size.rheight() /= max_y;
for (Buttons::const_iterator i = m_buttons.constBegin();
i != m_buttons.constEnd();
++i) {
QPoint pos(size.width() * i.key().x,
size.height() * i.key().y);
QPoint delta((size.width() - i.value()->size().width()) / 2,
(size.height() - i.value()->size().height()) / 2);
i.value()->moveTo(pos + delta);
i.value()->repaint();
}
}
示例10: requestPixmap
QPixmap MLocalThemeDaemonClient::requestPixmap(const QString &id, const QSize &requestedSize)
{
QPixmap pixmap;
QSize size = requestedSize;
if (size.width() < 1) {
size.rwidth() = 0;
}
if (size.height() < 1) {
size.rheight() = 0;
}
const PixmapIdentifier pixmapId(id, size);
pixmap = m_pixmapCache.value(pixmapId);
if (pixmap.isNull()) {
// The pixmap is not cached yet. Decode the image and
// store it into the cache as pixmap.
const QImage image = readImage(id);
if (!image.isNull()) {
pixmap = QPixmap::fromImage(image);
if (requestedSize.isValid() && (pixmap.size() != requestedSize)) {
pixmap = pixmap.scaled(requestedSize);
}
m_pixmapCache.insert(pixmapId, pixmap);
}
}
return pixmap;
}
示例11: sizeHint
QSize Button::sizeHint() const
{
QSize size = QToolButton::sizeHint();
size.rheight() += 15;
size.rwidth() = qMax(size.height(), size.width());
return size;
}
示例12: fill
void QDirectFBPixmapData::fill(const QColor &color)
{
if (!serialNumber())
return;
Q_ASSERT(dfbSurface);
alpha |= (color.alpha() < 255);
if (alpha && isOpaqueFormat(imageFormat)) {
QSize size;
dfbSurface->GetSize(dfbSurface, &size.rwidth(), &size.rheight());
screen->releaseDFBSurface(dfbSurface);
imageFormat = screen->alphaPixmapFormat();
d = QDirectFBScreen::depth(imageFormat);
dfbSurface = screen->createDFBSurface(size, screen->alphaPixmapFormat(), QDirectFBScreen::TrackSurface);
setSerialNumber(++global_ser_no);
if (!dfbSurface) {
qWarning("QDirectFBPixmapData::fill()");
invalidate();
return;
}
}
dfbSurface->Clear(dfbSurface, color.red(), color.green(), color.blue(), color.alpha());
}
示例13: slotSharesFetched
void ShareUserGroupWidget::slotSharesFetched(const QList<QSharedPointer<Share>> &shares)
{
QScrollArea *scrollArea = _ui->scrollArea;
auto newViewPort = new QWidget(scrollArea);
auto layout = new QVBoxLayout(newViewPort);
QSize minimumSize = newViewPort->sizeHint();
int x = 0;
foreach(const auto &share, shares) {
// We don't handle link shares
if (share->getShareType() == Share::TypeLink) {
continue;
}
ShareWidget *s = new ShareWidget(share, _ui->scrollArea);
layout->addWidget(s);
x++;
if (x <= 3) {
minimumSize = newViewPort->sizeHint();
}
}
minimumSize.rwidth() += layout->spacing();
minimumSize.rheight() += layout->spacing();
scrollArea->setMinimumSize(minimumSize);
scrollArea->setVisible(!shares.isEmpty());
scrollArea->setWidget(newViewPort);
}
示例14: sizeHint
QSize ThumbDelegate::sizeHint(const QStyleOptionViewItem & /*option*/, const QModelIndex & /*index*/) const
{
QSize hint = BachMainWindow::tnSize();
hint.rheight() += 4;
hint.rwidth() += 4;
return hint;
}
示例15: foreach
/* Search for the maximum available size-hint */
foreach (QIWizardPage *pPage, pages)
{
maxOfSizeHints.rwidth() = pPage->sizeHint().width() > maxOfSizeHints.width() ?
pPage->sizeHint().width() : maxOfSizeHints.width();
maxOfSizeHints.rheight() = pPage->sizeHint().height() > maxOfSizeHints.height() ?
pPage->sizeHint().height() : maxOfSizeHints.height();
}