当前位置: 首页>>代码示例>>C++>>正文


C++ Directory::append方法代码示例

本文整理汇总了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) << "'>"
//            << " &nbsp;" << 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&)));
    }
}
开发者ID:sandsmark,项目名称:filelight,代码行数:54,代码来源:summaryWidget.cpp

示例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 ) << "'>"
            << " &nbsp;" << 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& )) );
    }
}
开发者ID:BackupTheBerlios,项目名称:macfilelight-svn,代码行数:43,代码来源:summaryWidget.cpp


注:本文中的Directory::append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。