本文整理汇总了C++中WindowList::size方法的典型用法代码示例。如果您正苦于以下问题:C++ WindowList::size方法的具体用法?C++ WindowList::size怎么用?C++ WindowList::size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WindowList
的用法示例。
在下文中一共展示了WindowList::size方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getEmbeddedList
bool Window::getEmbeddedList(WindowList& wl) const {
for(ConstIterator i = begin(); i != end(); i++) if(i->valid()) {
EmbeddedWindow* ew = dynamic_cast<EmbeddedWindow*>(i->get());
if(!ew || !ew->getWindow()) continue;
else {
wl.push_back(ew->getWindow());
ew->getWindow()->getEmbeddedList(wl);
}
}
return wl.size() != 0;
}
示例2: windowAt
WId QxtWindowSystem::windowAt(const QPoint& pos)
{
Window result = 0;
WindowList list = windows();
for (int i = list.size() - 1; i >= 0; --i)
{
WId wid = list.at(i);
if (windowGeometry(wid).contains(pos))
{
result = wid;
break;
}
}
return result;
}
示例3: stopRedraw
void LinearLayout::Layout()
{
if ( ! this->childWindows.size())
{
return;
}
RedrawLock stopRedraw(this);
bool isVertical = (this->orientation == VerticalLayout);
bool isHorizontal = ( ! isVertical);
WindowList wrappedChildren;
WindowList filledChildren;
ChildSizeMap finalSizes;
int wrappedSize = 0;
float totalWeight = 0.0f;
WindowList::iterator it, end;
Size layoutSize = this->ClientSize();
// PASS 1: figure out which windows are wrapped in direction of the
// orientation, and which are filled. Also, calculate the correct
// size of the child opposite to its orientation.
it = this->childWindows.begin();
end = this->childWindows.end();
for ( ; it != end; it++)
{
Window* child = (*it);
Size childSize = child->WindowSize();
// map the child to its fill type
if (((isVertical) && (child->LayoutHeight() == LayoutFillParent))
|| ((isHorizontal) && (child->LayoutWidth() == LayoutFillParent)))
{
filledChildren.push_back(child);
totalWeight += child->LayoutWeight();
}
else
{
wrappedChildren.push_back(child);
// figure out the space all of the wrapped children will occupy.
wrappedSize += (isVertical ? childSize.height : childSize.width);
}
// fill direction opposite the orientation
if ((isVertical) && (child->LayoutWidth() == LayoutFillParent))
{
childSize.width = layoutSize.width;
}
else if ((isHorizontal) && (child->LayoutHeight() == LayoutFillParent))
{
childSize.height = layoutSize.height;
}
//
finalSizes[child] = childSize;
}
//
wrappedSize += (this->spacing * ((int) this->childWindows.size() - 1));
// PASS 2: determine final child size for the filled children based on
// their specified LayoutWeight()'s.
if (filledChildren.size())
{
int remainingSize = (isVertical)
? layoutSize.height - wrappedSize
: layoutSize.width - wrappedSize;
//
int weightedSize = 0;
//
it = filledChildren.begin();
end = filledChildren.end();
for ( ; it != end; it++)
{
Window* child = (*it);
Size childSize = finalSizes[child];
float remainingRatio = (child->LayoutWeight() / totalWeight);
int newSize = (int) ((float) remainingSize * remainingRatio);
// using floating calculations may cause small rounding errors. give
// give the last filled child whatever space may be left over
weightedSize += newSize;
if ((it + 1) == end)
{
newSize += (remainingSize - weightedSize);
}
isVertical
? childSize.height = newSize
: childSize.width = newSize;
finalSizes[child] = childSize;
}
}
// PASS 3: layout everything out!
it = this->childWindows.begin();
end = this->childWindows.end();
//.........这里部分代码省略.........