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


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

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


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

示例1: computeMaxZoomHeight

int computeMaxZoomHeight(QSize scrollSize, QSize imageSize,
                         int scrollBarDimension) {

  scrollSize.transpose();
  imageSize.transpose();
  return computeMaxZoomWidth(scrollSize, imageSize, scrollBarDimension);
}
开发者ID:craftoid,项目名称:Cstitch,代码行数:7,代码来源:imageUtility.cpp

示例2: privateSetOrientation

void SDeclarativeScreenPrivateResize::privateSetOrientation(int orientation)
{
    if (orientation == SDeclarativeScreen::All
     || orientation == SDeclarativeScreen::LandscapeInverted
     || orientation == SDeclarativeScreen::PortraitInverted)
        return;

    if (m_allowedOrientations != SDeclarativeScreen::Default && !(m_allowedOrientations & orientation))
        return;

    QSize newScreenSize = m_displaySize;

    if(orientation == SDeclarativeScreen::Default)
        orientation = portraitDisplay() ? SDeclarativeScreen::Portrait : SDeclarativeScreen::Landscape;

    if (orientation == SDeclarativeScreen::Portrait && !portraitDisplay())
        newScreenSize.transpose();
    else if (orientation == SDeclarativeScreen::Landscape && portraitDisplay())
        newScreenSize.transpose();

    if (m_view)
        m_view->resize(newScreenSize);
    else
        setScreenSize(newScreenSize);
}
开发者ID:Seikareikou,项目名称:bb10-qt-components,代码行数:25,代码来源:sdeclarativescreen_p_resize.cpp

示例3: resizeEvent

//! [3]
void MainWindow::resizeEvent(QResizeEvent *event)
{
    QSize size = event->size();
    bool isLandscape = size.width() > size.height();

    if (!isLandscape)
        size.transpose();

    landscapeWidget->setFixedSize(size);
    size.transpose();
    portraitWidget->setFixedSize(size);

    landscapeWidget->setVisible(isLandscape);
    portraitWidget->setVisible(!isLandscape);
}
开发者ID:BGmot,项目名称:Qt,代码行数:16,代码来源:mainwindow.cpp

示例4: sizeHint

QSize OrientationButton::sizeHint() const
{
    QSize size = QPushButton::sizeHint();
    if (orientation_ == Qt::Vertical)
        size.transpose();
    return size;
}
开发者ID:jwvdveen,项目名称:plume-creator-legacy,代码行数:7,代码来源:orientationbutton.cpp

示例5: paintEvent

void RotationToolButton::paintEvent(QPaintEvent*)
{
    QStylePainter painter(this);
    painter.rotate(rot);
    switch (rot)
    {
    case UpsideDown:
        painter.translate(-width(), -height());
        break;

    case Clockwise:
        painter.translate(0, -width());
        break;

    case CounterClockwise:
        painter.translate(-height(), 0);
        break;

    default:
        // nothing to do
        break;
    }

    QStyleOptionToolButton opt;
    initStyleOption(&opt);
    if (rot & Vertical_Mask)
    {
        QSize size = opt.rect.size();
        size.transpose();
        opt.rect.setSize(size);
    }
    painter.drawComplexControl(QStyle::CC_ToolButton, opt);
}
开发者ID:AChinaProgrammer,项目名称:liteide,代码行数:33,代码来源:rotationtoolbutton.cpp

示例6: setCell

void TileLayer::setCell(int x, int y, const Cell &cell)
{
    Q_ASSERT(contains(x, y));

    if (cell.tile) {
        QSize size = cell.tile->size();

        if (cell.flippedAntiDiagonally)
            size.transpose();

        const QPoint offset = cell.tile->tileset()->tileOffset();

        mMaxTileSize = maxSize(size, mMaxTileSize);
        mOffsetMargins = maxMargins(QMargins(-offset.x(),
                                             -offset.y(),
                                             offset.x(),
                                             offset.y()),
                                    mOffsetMargins);

        if (mMap)
            mMap->adjustDrawMargins(drawMargins());
    }

    mGrid[x + y * mWidth] = cell;
}
开发者ID:LucasGH,项目名称:tiled,代码行数:25,代码来源:tilelayer.cpp

示例7: getStyleOption

QStyleOptionButton OrientationButton::getStyleOption() const
{
    QStyleOptionButton opt;
    opt.initFrom(this);
    if (orientation_ == Qt::Vertical)
    {
        QSize size = opt.rect.size();
        size.transpose();
        opt.rect.setSize(size);
    }
    opt.features = QStyleOptionButton::None;
    if (isFlat())
        opt.features |= QStyleOptionButton::Flat;
    if (menu())
        opt.features |= QStyleOptionButton::HasMenu;
    if (autoDefault() || isDefault())
        opt.features |= QStyleOptionButton::AutoDefaultButton;
    if (isDefault())
        opt.features |= QStyleOptionButton::DefaultButton;
    if (isDown() || (menu() && menu()->isVisible()))
        opt.state |= QStyle::State_Sunken;
    if (isChecked())
        opt.state |= QStyle::State_On;
    if (!isFlat() && !isDown())
        opt.state |= QStyle::State_Raised;
    opt.text = text();
    opt.icon = icon();
    opt.iconSize = iconSize();
    return opt;
}
开发者ID:jwvdveen,项目名称:plume-creator-legacy,代码行数:30,代码来源:orientationbutton.cpp

示例8: getStyleOption

QStyleOptionButton QxtPushButtonPrivate::getStyleOption() const
{
    QStyleOptionButton option;
    option.initFrom(&qxt_p());
    if (rot & Vertical_Mask)
    {
        QSize size = option.rect.size();
        size.transpose();
        option.rect.setSize(size);
    }
    option.features = QStyleOptionButton::None;
    if (qxt_p().isFlat())
        option.features |= QStyleOptionButton::Flat;
    if (qxt_p().menu())
        option.features |= QStyleOptionButton::HasMenu;
    if (qxt_p().autoDefault() || qxt_p().isDefault())
        option.features |= QStyleOptionButton::AutoDefaultButton;
    if (qxt_p().isDefault())
        option.features |= QStyleOptionButton::DefaultButton;
    if (qxt_p().isDown() || (qxt_p().menu() && qxt_p().menu()->isVisible()))
        option.state |= QStyle::State_Sunken;
    if (qxt_p().isChecked())
        option.state |= QStyle::State_On;
    if (!qxt_p().isFlat() && !qxt_p().isDown())
        option.state |= QStyle::State_Raised;
    if (!isRichText())
    {
        option.text = qxt_p().text();
        option.icon = qxt_p().icon();
        option.iconSize = qxt_p().iconSize();
    }
    return option;
}
开发者ID:develnk,项目名称:qxtweb-qt5,代码行数:33,代码来源:qxtpushbutton.cpp

示例9: arrowSize

/*!
   Calculate the size for a arrow that fits into a rect of a given size

   \param arrowType Arrow type
   \param boundingSize Bounding size
   \return Size of the arrow
*/
QSize QwtArrowButton::arrowSize(Qt::ArrowType arrowType,
    const QSize &boundingSize) const
{
    QSize bs = boundingSize;
    if ( arrowType == Qt::UpArrow || arrowType == Qt::DownArrow )
        bs.transpose();
        
    const int MinLen = 2;
    const QSize sz = bs.expandedTo(
        QSize(MinLen, 2 * MinLen - 1)); // minimum

    int w = sz.width();
    int h = 2 * w - 1;

    if ( h > sz.height() )
    {
        h = sz.height();
        w = (h + 1) / 2;
    }

    QSize arrSize(w, h);
    if ( arrowType == Qt::UpArrow || arrowType == Qt::DownArrow )
        arrSize.transpose();

    return arrSize;
}
开发者ID:chongle,项目名称:prorata,代码行数:33,代码来源:qwt_arrow_button.cpp

示例10: paintEvent

/*!
    \reimp
 */
void QxtLabel::paintEvent(QPaintEvent* event)
{
    QFrame::paintEvent(event);
    QPainter p(this);
    p.rotate(qxt_d().rot);
    QRect r = contentsRect();
    switch (qxt_d().rot)
    {
    case Qxt::UpsideDown:
        p.translate(-r.width(), -r.height());
        break;

    case Qxt::Clockwise:
        p.translate(0, -r.width());
        break;

    case Qxt::CounterClockwise:
        p.translate(-r.height(), 0);
        break;

    default:
        // nothing to do
        break;
    }

    if (qxt_d().rot & Vertical_Mask)
    {
        QSize s = r.size();
        s.transpose();
        r = QRect(r.topLeft(), s);
    }

    const QString elidedText = fontMetrics().elidedText(qxt_d().text, qxt_d().mode, r.width());
    p.drawText(r, qxt_d().align, elidedText);
}
开发者ID:develnk,项目名称:qxtweb-qt5,代码行数:38,代码来源:qxtlabel.cpp

示例11: updateFocusZones

void QAndroidCameraFocusControl::updateFocusZones(QCameraFocusZone::FocusZoneStatus status)
{
    if (!m_session->camera())
        return;

    // create a focus zone (50x50 pixel) around the focus point
    m_focusZones.clear();

    if (m_actualFocusPoint.isNull())
        return;

    QSize viewportSize = m_session->camera()->previewSize();

    if (!viewportSize.isValid())
        return;

    if (m_session->camera()->getDisplayOrientation() % 180)
        viewportSize.transpose();

    QSizeF focusSize(50.f / viewportSize.width(), 50.f / viewportSize.height());
    float x = qBound(qreal(0),
                     m_actualFocusPoint.x() - (focusSize.width() / 2),
                     1.f - focusSize.width());
    float y = qBound(qreal(0),
                     m_actualFocusPoint.y() - (focusSize.height() / 2),
                     1.f - focusSize.height());

    QRectF area(QPointF(x, y), focusSize);

    m_focusZones.append(QCameraFocusZone(area, status));

    emit focusZonesChanged();
}
开发者ID:xjohncz,项目名称:qt5,代码行数:33,代码来源:qandroidcamerafocuscontrol.cpp

示例12: main

Q_DECL_EXPORT
#endif
int main(int argc, char *argv[])
{
#if defined(Q_OS_LINUX) && !defined(MAEMO)
	QApplication::setAttribute(Qt::AA_X11InitThreads, true);
#endif
	QApplication a(argc, argv);
	QSize res = QApplication::desktop()->screenGeometry().size();
	if (res.width() < res.height())
		res.transpose();
	pixel_xres = res.width();
	pixel_yres = res.height();
	g_dpi_scale = CalculateDPIScale();
	dp_xres = (int)(pixel_xres * g_dpi_scale); dp_yres = (int)(pixel_yres * g_dpi_scale);
	net::Init();
#ifdef __SYMBIAN32__
	const char *savegame_dir = "E:/PPSSPP/";
	const char *assets_dir = "E:/PPSSPP/";
#elif defined(BLACKBERRY)
	const char *savegame_dir = "/accounts/1000/shared/misc/";
	const char *assets_dir = "app/native/assets/";
#elif defined(MEEGO_EDITION_HARMATTAN) || defined(MAEMO)
	const char *savegame_dir = "/home/user/MyDocs/PPSSPP/";
	const char *assets_dir = "/opt/PPSSPP/";
#else
	const char *savegame_dir = "./";
	const char *assets_dir = "./";
#endif
	NativeInit(argc, (const char **)argv, savegame_dir, assets_dir, "BADCOFFEE");
#ifdef USING_GLES2
	emugl = new MainUI();
	emugl->resize(pixel_xres, pixel_yres);
	emugl->showFullScreen();
#endif
#ifdef __SYMBIAN32__
	// Set RunFast hardware mode for VFPv2.
	User::SetFloatingPointMode(EFpModeRunFast);
	// Disable screensaver
	QScopedPointer<QSystemScreenSaver> ssObject(new QSystemScreenSaver(emugl));
	ssObject->setScreenSaverInhibit();
	QScopedPointer<SymbianMediaKeys> mediakeys(new SymbianMediaKeys());
#endif

	QScopedPointer<QThread> thread(new QThread);
	QScopedPointer<MainAudio> audio(new MainAudio());
	audio->moveToThread(thread.data());
	QObject::connect(thread.data(), SIGNAL(started()), audio.data(), SLOT(run()));
	thread->start();

#ifdef QT_HAS_SDL
	SDLJoystick joy(true);
	joy.startEventLoop();
#endif
	int ret = a.exec();
	thread->quit();
	NativeShutdown();
	net::Shutdown();
	return ret;
}
开发者ID:kaienfr,项目名称:fonttools,代码行数:60,代码来源:QtMain.cpp

示例13: setScreenSize

void SDeclarativeScreenPrivateResize::setScreenSize(QSize size)
{
    Q_Q(SDeclarativeScreen);

    // Fallback
    if (size.isEmpty())
        size = enforceFixedOrientation(systemScreenSize());

    if (size.isEmpty() || size == m_screenSize)
        return;

#ifndef Q_OS_SYMBIAN
    QSize sizeTransposed = size;
    sizeTransposed.transpose();
    if (m_displaySize != size && m_displaySize != sizeTransposed) {
        m_displaySize = size;
        q->emit displayChanged();
    }
#endif

    if ((m_screenSize.width() <= m_screenSize.height() && size.width() > size.height())
     || (m_screenSize.width() > m_screenSize.height() && size.width() <= size.height()))
        q->emit privateAboutToChangeOrientation(0, false);

    SDeclarativeScreenPrivate::setScreenSize(size);
    setCurrentOrientation(portraitScreen() ? SDeclarativeScreen::Portrait : SDeclarativeScreen::Landscape);
}
开发者ID:Seikareikou,项目名称:bb10-qt-components,代码行数:27,代码来源:sdeclarativescreen_p_resize.cpp

示例14: sizeHint

QSize DockButton::sizeHint() const
{
    QSize hint = QToolButton::sizeHint();
    if (toolBarOrientation(this) == Qt::Vertical) {
        hint.transpose();
    }
    return hint;
}
开发者ID:amezin,项目名称:citnetvis2,代码行数:8,代码来源:dockbutton.cpp

示例15: minimumSizeHint

/*!
    \reimp
 */
QSize QxtStars::minimumSizeHint() const
{
    QSize size = qxt_d().getStarSize();
    size.rwidth() *= maximum() - minimum();
    if (orientation() == Qt::Vertical)
        size.transpose();
    return size;
}
开发者ID:develnk,项目名称:qxtweb-qt5,代码行数:11,代码来源:qxtstars.cpp


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