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


C++ QSize::rheight方法代码示例

本文整理汇总了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();
}
开发者ID:narunlifescience,项目名称:AlphaPlot,代码行数:60,代码来源:MultiLayer.cpp

示例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 ();
}
开发者ID:RTOSkit,项目名称:Octave-UPM-TE,代码行数:33,代码来源:QWinTerminalImpl.cpp

示例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;
}
开发者ID:c-jheengut,项目名称:flacon,代码行数:34,代码来源:trackviewdelegate.cpp

示例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);
}
开发者ID:SamTheReaper,项目名称:razor-qt,代码行数:57,代码来源:razortaskbar.cpp

示例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);
}
开发者ID:UliRehr15,项目名称:sstQt01Lib,代码行数:10,代码来源:sstQt01PathPaintWidget.cpp

示例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;
}
开发者ID:gcubar,项目名称:XKP,代码行数:34,代码来源:xkpplacementlayout.cpp

示例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;
 }
开发者ID:SidneyTTW,项目名称:ImageProcessor,代码行数:26,代码来源:borderlayout.cpp

示例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;
}
开发者ID:emiola,项目名称:qiron,代码行数:35,代码来源:qirparaboliceffectmanager.cpp

示例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();
    }
}
开发者ID:dambito,项目名称:kbattleship,代码行数:34,代码来源:welcomescreen.cpp

示例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;
}
开发者ID:rburchell,项目名称:qt-components,代码行数:29,代码来源:mlocalthemedaemonclient.cpp

示例11: sizeHint

QSize Button::sizeHint() const
{
    QSize size = QToolButton::sizeHint();
    size.rheight() += 15;
    size.rwidth() = qMax(size.height(), size.width());
    return size;
}
开发者ID:Vourhey,项目名称:ECalc,代码行数:7,代码来源:button.cpp

示例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());
}
开发者ID:stephaneAG,项目名称:PengPod700,代码行数:26,代码来源:qdirectfbpixmap.cpp

示例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);
}
开发者ID:techscientist,项目名称:client,代码行数:32,代码来源:shareusergroupwidget.cpp

示例14: sizeHint

QSize ThumbDelegate::sizeHint(const QStyleOptionViewItem & /*option*/, const QModelIndex & /*index*/) const
{
    QSize hint = BachMainWindow::tnSize();
		hint.rheight() += 4;
		hint.rwidth() += 4;
		return hint;
}
开发者ID:EntityFXCode,项目名称:arsenalsuite,代码行数:7,代码来源:bachitems.cpp

示例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();
 }
开发者ID:virendramishra,项目名称:VirtualBox4.1.18,代码行数:8,代码来源:QIWizard.cpp


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