本文整理汇总了C++中QDesignerFormEditorInterface::widgetFactory方法的典型用法代码示例。如果您正苦于以下问题:C++ QDesignerFormEditorInterface::widgetFactory方法的具体用法?C++ QDesignerFormEditorInterface::widgetFactory怎么用?C++ QDesignerFormEditorInterface::widgetFactory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDesignerFormEditorInterface
的用法示例。
在下文中一共展示了QDesignerFormEditorInterface::widgetFactory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mousePressEvent
void TabOrderEditor::mousePressEvent(QMouseEvent *e)
{
e->accept();
if (!m_indicator_region.contains(e->pos())) {
if (QWidget *child = m_bg_widget->childAt(e->pos())) {
QDesignerFormEditorInterface *core = m_form_window->core();
if (core->widgetFactory()->isPassiveInteractor(child)) {
QMouseEvent event(QEvent::MouseButtonPress,
child->mapFromGlobal(e->globalPos()),
e->button(), e->buttons(), e->modifiers());
qApp->sendEvent(child, &event);
QMouseEvent event2(QEvent::MouseButtonRelease,
child->mapFromGlobal(e->globalPos()),
e->button(), e->buttons(), e->modifiers());
qApp->sendEvent(child, &event2);
updateBackground();
}
}
return;
}
if (e->button() != Qt::LeftButton)
return;
const int target_index = widgetIndexAt(e->pos());
if (target_index == -1)
return;
m_beginning = false;
if (e->modifiers() & Qt::ControlModifier) {
m_current_index = target_index + 1;
if (m_current_index >= m_tab_order_list.size())
m_current_index = 0;
update();
return;
}
if (m_current_index == -1)
return;
m_tab_order_list.swap(target_index, m_current_index);
++m_current_index;
if (m_current_index == m_tab_order_list.size())
m_current_index = 0;
TabOrderCommand *cmd = new TabOrderCommand(formWindow());
cmd->init(m_tab_order_list);
formWindow()->commandHistory()->push(cmd);
}