本文整理汇总了C++中FormWindow::resourceSet方法的典型用法代码示例。如果您正苦于以下问题:C++ FormWindow::resourceSet方法的具体用法?C++ FormWindow::resourceSet怎么用?C++ FormWindow::resourceSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormWindow
的用法示例。
在下文中一共展示了FormWindow::resourceSet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: widgetToDom
DomUI *FormWindowDnDItem::domUi() const
{
DomUI *result = QDesignerDnDItem::domUi();
if (result != 0)
return result;
FormWindow *form = qobject_cast<FormWindow*>(source());
if (widget() == 0 || form == 0)
return 0;
QtResourceModel *resourceModel = form->core()->resourceModel();
QtResourceSet *currentResourceSet = resourceModel->currentResourceSet();
/* Short:
* We need to activate the original resourceSet associated with a form
* to properly generate the dom resource includes.
* Long:
* widgetToDom() calls copy() on QDesignerResource. It generates the
* Dom structure. In order to create DomResources properly we need to
* have the associated ResourceSet active (QDesignerResource::saveResources()
* queries the resource model for a qrc path for the given resource file:
* qrcFile = m_core->resourceModel()->qrcPath(ri->text());
* This works only when the resource file comes from the active
* resourceSet */
resourceModel->setCurrentResourceSet(form->resourceSet());
result = widgetToDom(widget(), form);
const_cast<FormWindowDnDItem*>(this)->setDomUi(result);
resourceModel->setCurrentResourceSet(currentResourceSet);
return result;
}
示例2: setActiveFormWindow
void FormWindowManager::setActiveFormWindow(QDesignerFormWindowInterface *w)
{
FormWindow *formWindow = qobject_cast<FormWindow*>(w);
if (formWindow == m_activeFormWindow)
return;
FormWindow *old = m_activeFormWindow;
m_activeFormWindow = formWindow;
QtResourceSet *resourceSet = 0;
if (formWindow)
resourceSet = formWindow->resourceSet();
m_core->resourceModel()->setCurrentResourceSet(resourceSet);
slotUpdateActions();
if (m_activeFormWindow) {
m_activeFormWindow->repaintSelection();
if (old)
old->repaintSelection();
}
emit activeFormWindowChanged(m_activeFormWindow);
if (m_activeFormWindow) {
m_activeFormWindow->emitSelectionChanged();
m_activeFormWindow->commandHistory()->setActive();
// Trigger setActiveSubWindow on mdi area unless we are in toplevel mode
QMdiSubWindow *mdiSubWindow = 0;
if (QWidget *formwindow = m_activeFormWindow->parentWidget()) {
mdiSubWindow = qobject_cast<QMdiSubWindow *>(formwindow->parentWidget());
}
if (mdiSubWindow) {
for (QWidget *parent = mdiSubWindow->parentWidget(); parent; parent = parent->parentWidget()) {
if (QMdiArea *mdiArea = qobject_cast<QMdiArea*>(parent)) {
mdiArea->setActiveSubWindow(mdiSubWindow);
break;
}
}
}
}
}