本文整理汇总了C++中QToolBar::d_func方法的典型用法代码示例。如果您正苦于以下问题:C++ QToolBar::d_func方法的具体用法?C++ QToolBar::d_func怎么用?C++ QToolBar::d_func使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QToolBar
的用法示例。
在下文中一共展示了QToolBar::d_func方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: restoreState
bool QToolBarAreaLayout::restoreState(QDataStream &stream, const QList<QToolBar*> &_toolBars, uchar tmarker)
{
QList<QToolBar*> toolBars = _toolBars;
int lines;
stream >> lines;
for (int j = 0; j < lines; ++j) {
int pos;
stream >> pos;
if (pos < 0 || pos >= QInternal::DockCount)
return false;
int cnt;
stream >> cnt;
QToolBarAreaLayoutInfo &dock = docks[pos];
QToolBarAreaLayoutLine line(dock.o);
for (int k = 0; k < cnt; ++k) {
QToolBarAreaLayoutItem item;
QString objectName;
stream >> objectName;
uchar shown;
stream >> shown;
stream >> item.pos;
stream >> item.size;
/*
4.3.0 added floating toolbars, but failed to add the ability to restore them.
We need to store there geometry (four ints). We cannot change the format in a
patch release (4.3.1) by adding ToolBarStateMarkerEx2 to signal extra data. So
for now we'll pack it in the two legacy ints we no longer used in Qt4.3.0.
In 4.4, we should add ToolBarStateMarkerEx2 and fix this properly.
*/
QRect rect;
bool floating = false;
uint geom0, geom1;
stream >> geom0;
if (tmarker == ToolBarStateMarkerEx) {
stream >> geom1;
rect = unpackRect(geom0, geom1, &floating);
}
QToolBar *toolBar = 0;
for (int x = 0; x < toolBars.count(); ++x) {
if (toolBars.at(x)->objectName() == objectName) {
toolBar = toolBars.takeAt(x);
break;
}
}
if (toolBar == 0) {
continue;
}
item.widgetItem = new QWidgetItem(toolBar);
toolBar->setOrientation(floating ? Qt::Horizontal : dock.o);
toolBar->setVisible(shown);
toolBar->d_func()->setWindowState(floating, true, rect);
line.toolBarItems.append(item);
}
dock.lines.append(line);
}