本文整理汇总了C++中KDockWidget::setPixmap方法的典型用法代码示例。如果您正苦于以下问题:C++ KDockWidget::setPixmap方法的具体用法?C++ KDockWidget::setPixmap怎么用?C++ KDockWidget::setPixmap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KDockWidget
的用法示例。
在下文中一共展示了KDockWidget::setPixmap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setToolViewStyle
void MainWindow::setToolViewStyle(int flag)
{
d->m_styleIDEAlMode = flag; // see KMultiTabBar for the first 3 bits
DockContainer *tmpL=(DockContainer*) (m_leftContainer->getWidget()->qt_cast("KMDI::DockContainer"));
if (tmpL) tmpL->setStyle(flag);
DockContainer *tmpR=(DockContainer*) (m_rightContainer->getWidget()->qt_cast("KMDI::DockContainer"));
if (tmpR) tmpR->setStyle(flag);
DockContainer *tmpT=(DockContainer*) (m_topContainer->getWidget()->qt_cast("KMDI::DockContainer"));
if (tmpT) tmpT->setStyle(flag);
DockContainer *tmpB=(DockContainer*) (m_bottomContainer->getWidget()->qt_cast("KMDI::DockContainer"));
if (tmpB) tmpB->setStyle(flag);
d->m_toolviewStyle = flag;
bool toolviewExists = false;
QMap<QWidget*,KMDI::ToolViewAccessor*>::Iterator it;
for (it = m_toolViews->begin(); it != m_toolViews->end(); ++it) {
KDockWidget *dockWidget = dynamic_cast<KDockWidget*>(it.data()->wrapperWidget());
if (dockWidget) {
if (flag == KMDI::IconOnly)
{
dockWidget->setTabPageLabel(" ");
dockWidget->setPixmap(*(it.data()->wrappedWidget()->icon()));
} else
if (flag == KMDI::TextOnly)
{
dockWidget->setPixmap(); //FIXME: Does not hide the icon in the IDEAl mode.
dockWidget->setTabPageLabel(it.data()->wrappedWidget()->caption());
} else
if (flag == KMDI::TextAndIcon)
{
dockWidget->setPixmap(*(it.data()->wrappedWidget()->icon()));
dockWidget->setTabPageLabel(it.data()->wrappedWidget()->caption());
}
toolviewExists = true;
}
}
if (toolviewExists)
{
//workaround for the above FIXME to make switching to TextOnly mode work in IDEAl as well. Be sure that this version of switch* is called.
if (flag == KMDI::TextOnly)
{
/* MainWindow::switchToTabPageMode();
MainWindow::switchToIDEAlMode();*/ //TODO
} else
{
writeDockConfig();
readDockConfig();
}
}
}
示例2: isVisible
KMDI::ToolViewAccessor *MainWindow::addToolWindow( QWidget* pWnd, KDockWidget::DockPosition pos, QWidget* pTargetWnd, int percent, const QString& tabToolTip, const QString& tabCaption)
{
QWidget *tvta=pWnd;
KDockWidget* pDW = dockManager->getDockWidgetFromName(pWnd->name());
if (pDW) {
// probably readDockConfig already created the widgetContainer, use that
pDW->setWidget(pWnd);
if (pWnd->icon()) {
pDW->setPixmap(*pWnd->icon());
}
pDW->setTabPageLabel((tabCaption==0)?pWnd->caption():tabCaption);
pDW->setToolTipString(tabToolTip);
dockManager->removeFromAutoCreateList(pDW);
pWnd=pDW;
}
QRect r=pWnd->geometry();
KMDI::ToolViewAccessor *mtva=new KMDI::ToolViewAccessor(this,pWnd,tabToolTip,(tabCaption==0)?pWnd->caption():tabCaption);
m_toolViews->insert(tvta,mtva);
if (pos == KDockWidget::DockNone) {
mtva->d->widgetContainer->setEnableDocking(KDockWidget::DockNone);
mtva->d->widgetContainer->reparent(this, Qt::WType_TopLevel | Qt::WType_Dialog, r.topLeft(), isVisible());
} else { // add (and dock) the toolview as DockWidget view
//const QPixmap& wndIcon = pWnd->icon() ? *(pWnd->icon()) : QPixmap();
//KDockWidget *pCover=mtva->d->widgetContainer;
mtva->place(pos, pTargetWnd,percent);
}
return mtva;
}