本文整理汇总了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);
}
示例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()), ¶g, &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();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}