本文整理汇总了C++中QWaylandSurface::processId方法的典型用法代码示例。如果您正苦于以下问题:C++ QWaylandSurface::processId方法的具体用法?C++ QWaylandSurface::processId怎么用?C++ QWaylandSurface::processId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWaylandSurface
的用法示例。
在下文中一共展示了QWaylandSurface::processId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: windowIdForLink
int LipstickCompositor::windowIdForLink(QWaylandSurface *s, uint link) const
{
for (QHash<int, LipstickCompositorWindow *>::ConstIterator iter = m_mappedSurfaces.begin();
iter != m_mappedSurfaces.end(); ++iter) {
QWaylandSurface *windowSurface = iter.value()->surface();
if (windowSurface && windowSurface->processId() == s->processId() &&
windowSurface->windowProperties().value("WINID", uint(0)).toUInt() == link)
return iter.value()->windowId();
}
return 0;
}
示例2: data
QVariant WindowModel::data(const QModelIndex &index, int role) const
{
int idx = index.row();
if (idx < 0 || idx >= m_items.count())
return QVariant();
LipstickCompositor *c = LipstickCompositor::instance();
if (role == Qt::UserRole + 1) {
return m_items.at(idx);
} else if (role == Qt::UserRole + 2) {
QWaylandSurface *s = c->surfaceForId(m_items.at(idx));
return s?s->processId():0;
} else if (role == Qt::UserRole + 3) {
LipstickCompositorWindow *w = static_cast<LipstickCompositorWindow *>(c->windowForId(m_items.at(idx)));
return w->title();
} else {
return QVariant();
}
}