本文整理汇总了C++中Directory::append方法的典型用法代码示例。如果您正苦于以下问题:C++ Directory::append方法的具体用法?C++ Directory::append怎么用?C++ Directory::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Directory
的用法示例。
在下文中一共展示了Directory::append方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createDiskMaps
void SummaryWidget::createDiskMaps()
{
DiskList disks;
const Q3CString free = i18n("Free").toLocal8Bit();
const Q3CString used = i18n("Used").toLocal8Bit();
KIconLoader loader;
oldScheme = Config::scheme;
Config::scheme = (Filelight::MapScheme)2000;
for (DiskList::ConstIterator it = disks.begin(), end = disks.end(); it != end; ++it)
{
Disk const &disk = *it;
if (disk.free == 0 && disk.used == 0)
continue;
QWidget *box = new QWidget(this);
box->setLayout(new QVBoxLayout(box));
//box->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum);
RadialMap::Widget *map = new MyRadialMap(box);
// QString text; QTextOStream(&text)
// << "<img src='" << loader.iconPath(disk.icon, KIconLoader::Toolbar) << "'>"
// << " " << disk.mount << " "
// << "<i>(" << disk.device << ")</i>";
QGridLayout* horizontalLayout = new QGridLayout(box);
QLabel *icon = new QLabel(box);
icon->setPixmap(KIcon(disk.icon).pixmap(32,32));
horizontalLayout->addWidget(icon);
QLabel *label = new QLabel(disk.mount + " (" + disk.device + ")", box);
label->setAlignment(Qt::AlignCenter);
horizontalLayout->addWidget(label);
box->layout()->addWidget(map);
box->layout()->addItem(horizontalLayout);
layout()->addWidget(box);
//box->show(); // will show its children too
Directory *tree = new Directory(disk.mount.toLocal8Bit());
tree->append(free, disk.free);
tree->append(used, disk.used);
map->create(tree); //must be done when visible
connect(map, SIGNAL(activated(const KUrl&)), SIGNAL(activated(const KUrl&)));
}
}
示例2: QVBox
void
SummaryWidget::createDiskMaps()
{
DiskList disks;
const QCString free = i18n( "Free" ).local8Bit();
const QCString used = i18n( "Used" ).local8Bit();
KIconLoader loader;
oldScheme = Config::scheme;
Config::scheme = (Filelight::MapScheme)2000;
for (DiskList::ConstIterator it = disks.begin(), end = disks.end(); it != end; ++it)
{
Disk const &disk = *it;
if (disk.free == 0 && disk.used == 0)
continue;
QWidget *box = new QVBox( this );
RadialMap::Widget *map = new MyRadialMap( box );
QString text; QTextOStream( &text )
<< "<img src='" << loader.iconPath( disk.icon, KIcon::Toolbar ) << "'>"
<< " " << disk.mount << " "
<< "<i>(" << disk.device << ")</i>";
QLabel *label = new QLabel( text, box );
label->setAlignment( Qt::AlignCenter );
label->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum );
box->show(); // will show its children too
Directory *tree = new Directory( disk.mount.local8Bit() );
tree->append( free, disk.free );
tree->append( used, disk.used );
map->create( tree ); //must be done when visible
connect( map, SIGNAL(activated( const KURL& )), SIGNAL(activated( const KURL& )) );
}
}