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


C++ QPushButton::mapToGlobal方法代码示例

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


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

示例1: ask

void MigrateDialog::ask()
{
    QPushButton *btn = cancelButton();
    QPoint p = btn->mapToGlobal(QPoint(0, 0));
    QRect rc(p.x(), p.y(), btn->width(), btn->height());
    BalloonMsg::ask(NULL, i18n("Cancel convert?"), this, SLOT(cancel(void*)), NULL, &rc);
}
开发者ID:BackupTheBerlios,项目名称:sim-im-svn,代码行数:7,代码来源:migratedlg.cpp

示例2: startSearch

void TextShow::startSearch(int parag, int index)
{
    QString to_find_string = srchdialog->getText();
    if (doSearch(to_find_string, srchdialog->case_sensitive(), (!srchdialog->get_direction()), &parag, &index)){
        setSelection(parag, index, parag, index + to_find_string.length());
        setCursorPosition(parag, index + to_find_string.length());
        ensureCursorVisible();
        return;
    }
    if (!srchdialog->isVisible()){
        QApplication::beep();
        return;
    }
    QStringList btns;
    btns.append(i18n("&Yes"));
    btns.append(i18n("&No"));

    QObjectList *l = srchdialog->queryList("QPushButton");
    QObjectListIt it( *l );
    if (it.current() == 0){
        delete l;
        QApplication::beep();
        return;
    }
    QPushButton *btnOK = static_cast<QPushButton*>(it.current());
    delete l;
    QRect rc = btnOK->rect();
    rc.moveTopLeft(btnOK->mapToGlobal(rc.topLeft()));
    BalloonMsg *msg = new BalloonMsg(!srchdialog->get_direction() ?
                                     i18n("End of document reached.\nContinue from the beginning?") :
                                     i18n("Beginning of document reached.\nContinue from the end?"),
                                     rc, btns, this);
    connect(msg, SIGNAL(action(int)), this, SLOT(searchAgain(int)));
    msg->show();
}
开发者ID:,项目名称:,代码行数:35,代码来源:

示例3: on_infoButton_clicked

void CWizDocumentView::on_infoButton_clicked()
{
    if (!m_info) {
        m_info = new CWizNoteInfoForm(m_dbMgr, topLevelWidget());
    }

    m_info->setDocument(m_web->document());

    QPushButton* btn = m_title->infoButton();
    QRect rc = btn->geometry();
    QPoint pt = btn->mapToGlobal(QPoint(rc.width() / 2, rc.height()));
    m_info->showAtPoint(pt);
}
开发者ID:badwtg1111,项目名称:WizQTClient,代码行数:13,代码来源:wizdocumentview.cpp

示例4: on_tagsButton_clicked

void CWizDocumentView::on_tagsButton_clicked()
{
    if (!m_tags) {
        m_tags = new CWizTagListWidget(m_dbMgr, topLevelWidget());
    }

    m_tags->setDocument(m_web->document());

    QPushButton* btn = m_title->tagsButton();
    QRect rc = btn->geometry();
    QPoint pt = btn->mapToGlobal(QPoint(rc.width() / 2, rc.height()));
    m_tags->showAtPoint(pt);
}
开发者ID:badwtg1111,项目名称:WizQTClient,代码行数:13,代码来源:wizdocumentview.cpp

示例5: on_attachmentButton_clicked

void CWizDocumentView::on_attachmentButton_clicked()
{
    if (!m_attachments) {
        m_attachments = new CWizAttachmentListWidget(m_app, topLevelWidget());
    }

    m_attachments->setDocument(m_web->document());

    QPushButton* btn = m_title->attachmentButton();
    QRect rc = btn->geometry();
    QPoint pt = btn->mapToGlobal(QPoint(rc.width() / 2, rc.height()));
    m_attachments->showAtPoint(pt);
}
开发者ID:badwtg1111,项目名称:WizQTClient,代码行数:13,代码来源:wizdocumentview.cpp

示例6: AddKeyedArchiveField

void QtPropertyDataDavaKeyedArcive::AddKeyedArchiveField()
{
	QPushButton* btn = dynamic_cast<QPushButton*>(QObject::sender());
	if(NULL != curArchive && NULL != btn)
	{
		KeyedArchiveItemWidget *w = new KeyedArchiveItemWidget(curArchive, lastAddedType);
		QObject::connect(w, SIGNAL(ValueReady(const DAVA::String&, const DAVA::VariantType&)), this, SLOT(NewKeyedArchiveFieldReady(const DAVA::String&, const DAVA::VariantType&)));

		w->show();

		QRect bRect = btn->geometry();
		QPoint bPos = btn->mapToGlobal(btn->mapFromParent(bRect.topLeft()));

		QRect wRect = w->geometry();
		QPoint wPos = QPoint(bPos.x() - wRect.width() + bRect.width(), bPos.y() + bRect.height());

		w->move(wPos);
	}
开发者ID:droidenko,项目名称:dava.framework,代码行数:18,代码来源:QtPropertyDataDavaKeyedArchive.cpp

示例7: setAttribute

void CSVWidget::ColorPickerPopup::mousePressEvent(QMouseEvent *event)
{
    QPushButton *button = qobject_cast<QPushButton *>(parentWidget());
    if (button != NULL)
    {
        QStyleOptionButton option;
        option.init(button);
        QRect buttonRect = option.rect;
        buttonRect.moveTo(button->mapToGlobal(buttonRect.topLeft()));

        // If the mouse is pressed above the pop-up parent,
        // the pop-up will be hidden and the pressed signal won't be repeated for the parent
        if (buttonRect.contains(event->globalPos()) || buttonRect.contains(event->pos()))
        {
            setAttribute(Qt::WA_NoMouseReplay);
        }
    }
    QFrame::mousePressEvent(event);
}
开发者ID:devnexen,项目名称:openmw,代码行数:19,代码来源:colorpickerpopup.cpp


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