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


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

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


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

示例1: paperSize

QSizeF Types::paperSize(const QString &format, QPrinter::Orientation orientation, UnitsOfLength unit)
{
    QSizeF result = paperFormats().value(format);
    if (orientation == QPrinter::Landscape)
        result.transpose();
    return convertBetweenUnitsOfLength(result, UnitOfLengthCentimeter, unit);
}
开发者ID:dschwilk,项目名称:posterazor,代码行数:7,代码来源:types.cpp

示例2: geometryChanged

void VideoRecorder::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
{
    Q_UNUSED(oldGeometry);
    QSizeF size = newGeometry.size();
    size.transpose();
    m_viewFinder->setSize(size);

    m_viewFinder->setTransformOriginPoint(newGeometry.width()/2, m_viewFinder->size().height()/2);
    m_viewFinder->setRotation(90);
}
开发者ID:shivarajsp77,项目名称:bachchao-qtapp,代码行数:10,代码来源:videorecorder.cpp

示例3: sipNoMethod

static PyObject *meth_QSizeF_transpose(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        QSizeF *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QSizeF, &sipCpp))
        {
            sipCpp->transpose();

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_QSizeF, sipName_transpose, doc_QSizeF_transpose);

    return NULL;
}
开发者ID:rff255,项目名称:python-qt5,代码行数:21,代码来源:sipQtCoreQSizeF.cpp

示例4: doLayout

void KItemListViewLayouter::doLayout()
{
    if (m_dirty) {
#ifdef KITEMLISTVIEWLAYOUTER_DEBUG
        QElapsedTimer timer;
        timer.start();
#endif
        m_visibleIndexesDirty = true;

        QSizeF itemSize = m_itemSize;
        QSizeF itemMargin = m_itemMargin;
        QSizeF size = m_size;

        const bool grouped = createGroupHeaders();

        const bool horizontalScrolling = (m_scrollOrientation == Qt::Horizontal);
        if (horizontalScrolling) {
            // Flip everything so that the layout logically can work like having
            // a vertical scrolling
            itemSize.transpose();
            itemMargin.transpose();
            size.transpose();

            if (grouped) {
                // In the horizontal scrolling case all groups are aligned
                // at the top, which decreases the available height. For the
                // flipped data this means that the width must be decreased.
                size.rwidth() -= m_groupHeaderHeight;
            }
        }

        m_columnWidth = itemSize.width() + itemMargin.width();
        const qreal widthForColumns = size.width() - itemMargin.width();
        m_columnCount = qMax(1, int(widthForColumns / m_columnWidth));
        m_xPosInc = itemMargin.width();

        const int itemCount = m_model->count();
        if (itemCount > m_columnCount && m_columnWidth >= 32) {
            // Apply the unused width equally to each column
            const qreal unusedWidth = widthForColumns - m_columnCount * m_columnWidth;
            if (unusedWidth > 0) {
                const qreal columnInc = unusedWidth / (m_columnCount + 1);
                m_columnWidth += columnInc;
                m_xPosInc += columnInc;
            }
        }

        int rowCount = itemCount / m_columnCount;
        if (itemCount % m_columnCount != 0) {
            ++rowCount;
        }

        m_itemInfos.resize(itemCount);

        qreal y = m_headerHeight + itemMargin.height();
        int row = 0;

        int index = 0;
        while (index < itemCount) {
            qreal x = m_xPosInc;
            qreal maxItemHeight = itemSize.height();

            if (grouped) {
                if (horizontalScrolling) {
                    // All group headers will always be aligned on the top and not
                    // flipped like the other properties
                    x += m_groupHeaderHeight;
                }

                if (m_groupItemIndexes.contains(index)) {
                    // The item is the first item of a group.
                    // Increase the y-position to provide space
                    // for the group header.
                    if (index > 0) {
                        // Only add a margin if there has been added another
                        // group already before
                        y += m_groupHeaderMargin;
                    } else if (!horizontalScrolling) {
                        // The first group header should be aligned on top
                        y -= itemMargin.height();
                    }

                    if (!horizontalScrolling) {
                        y += m_groupHeaderHeight;
                    }
                }
            }

            int column = 0;
            while (index < itemCount && column < m_columnCount) {
                qreal requiredItemHeight = itemSize.height();
                if (m_sizeHintResolver) {
                    const QSizeF sizeHint = m_sizeHintResolver->sizeHint(index);
                    const qreal sizeHintHeight = horizontalScrolling ? sizeHint.width() : sizeHint.height();
                    if (sizeHintHeight > requiredItemHeight) {
                        requiredItemHeight = sizeHintHeight;
                    }
                }

                ItemInfo& itemInfo = m_itemInfos[index];
//.........这里部分代码省略.........
开发者ID:blue-shell,项目名称:folderview,代码行数:101,代码来源:kitemlistviewlayouter.cpp

示例5: ModifyItem_Item

void TouchDefine_Dialog::ModifyItem_Item(QListWidget *parent, QListWidgetItem *item)
{
    iButtonAdded_list.clear();
    
    iParent = parent;
    iItem = item;
    
    if(parent)
    {
        if(iItem)
        {
            for(int i=0; i<((TouchInfo*)item)->iButtonInfoList.count(); i++)
            {
                TouchDefine_Dialog_Pad_Button* button = new TouchDefine_Dialog_Pad_Button((QWidget*)(iModelPad->iScreen));
                button->iButtonAdded_list = &iButtonAdded_list;
                button->iStatus = TouchDefine_Dialog_Pad_Button::ButtonStatus_Screen;
                if(((TouchInfo*)item)->iButtonInfoList.at(i)->iLongPress=="true")
                    button->SetButtonLock(TouchDefine_Dialog_Pad_Button::ButtonLock_ON);
                else if(((TouchInfo*)item)->iButtonInfoList.at(i)->iLongPress=="false")
                    button->SetButtonLock(TouchDefine_Dialog_Pad_Button::ButtonLock_OFF);
                
                button->iOrg = ((TouchInfo*)item)->iButtonInfoList.at(i)->iOrg.toInt();
                
                button->iButtonPos.setX(((TouchInfo*)item)->iButtonInfoList.at(i)->iHorPos.toInt());
                button->iButtonPos.setY(((TouchInfo*)item)->iButtonInfoList.at(i)->iVerPos.toInt());
                button->iButtonLockTime = ((TouchInfo*)item)->iButtonInfoList.at(i)->iLockTime.toInt();
                button->iButtonMapto = ((TouchInfo*)item)->iButtonInfoList.at(i)->iMapto;
                
                if(((TouchInfo*)item)->iButtonInfoList.at(i)->iButtonName=="up")
                    button->SetButtonType(TouchDefine_Dialog_Pad_Button::Button_Up);
                else if(((TouchInfo*)item)->iButtonInfoList.at(i)->iButtonName=="down")
                    button->SetButtonType(TouchDefine_Dialog_Pad_Button::Button_Down);
                else if(((TouchInfo*)item)->iButtonInfoList.at(i)->iButtonName=="left")
                    button->SetButtonType(TouchDefine_Dialog_Pad_Button::Button_Left);
                else if(((TouchInfo*)item)->iButtonInfoList.at(i)->iButtonName=="right")
                    button->SetButtonType(TouchDefine_Dialog_Pad_Button::Button_Right);
                else if(((TouchInfo*)item)->iButtonInfoList.at(i)->iButtonName=="a")
                    button->SetButtonType(TouchDefine_Dialog_Pad_Button::Button_A);
                else if(((TouchInfo*)item)->iButtonInfoList.at(i)->iButtonName=="b")
                    button->SetButtonType(TouchDefine_Dialog_Pad_Button::Button_B); 
                
                iButtonAdded_list.append(button);
                
                connect(this, SIGNAL(signalChangeZoom(float)),
                        button, SLOT(slotChangeZoom(float)));
                
                if(iZoom_list->currentIndex()==0)
                    button->iZoom = 1.0;
                else if(iZoom_list->currentIndex()==1)
                    button->iZoom = 0.75;
                else if(iZoom_list->currentIndex()==2)
                    button->iZoom = 0.5;
                
                QPointF pos;
                QSizeF size = this->iModelPad->iScreen->iScreenSize;
                if(iDir==Dir_CW90 || iDir==Dir_ACW90)
                    size.transpose();
                if(button->iOrg==0)
                {
                    pos = button->iButtonPos.toPoint();
                }
                else if(button->iOrg==1)
                {
                    pos.rx() = size.width() - button->iButtonPos.toPoint().x() - button->iButtonSize.width();
                    pos.ry() = button->iButtonPos.toPoint().y();
                }
                else if(button->iOrg==3)
                {
                    pos.rx() = size.width() - button->iButtonPos.toPoint().x() - button->iButtonSize.width();
                    pos.ry() = size.height() - button->iButtonPos.toPoint().y() - button->iButtonSize.height();
                } 
                else if(button->iOrg==2)
                {
                    pos.rx() = button->iButtonPos.toPoint().x();
                    pos.ry() = size.height() - button->iButtonPos.toPoint().y() - button->iButtonSize.height();
                }
                
                button->move((pos*button->iZoom).toPoint());
            }
        }
        else
        {
            iButtonAdded_list.clear();
        }
        
        this->exec();
    }
开发者ID:hgl888,项目名称:nashtest,代码行数:87,代码来源:TouchDefine_Dialog.cpp

示例6: addRatioToComboBox

 Q_FOREACH(QSizeF size, ratioList) {
     size.transpose();
     addRatioToComboBox(size);
 }
开发者ID:cmacq2,项目名称:gwenview,代码行数:4,代码来源:cropwidget.cpp


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