示例#1
0
void ListView::copySpecialProperties(Widget *widget)
{
    ListView* listViewEx = dynamic_cast<ListView*>(widget);
    if (listViewEx)
    {
        ScrollView::copySpecialProperties(widget);
        setItemModel(listViewEx->_model);
        setItemsMargin(listViewEx->_itemsMargin);
        setGravity(listViewEx->_gravity);
    }
}
示例#2
0
void UIListViewEx::copySpecialProperties(UIWidget *widget)
{
    UIListViewEx* listViewEx = dynamic_cast<UIListViewEx*>(widget);
    if (listViewEx)
    {
        UIScrollView::copySpecialProperties(widget);
        setItemModel(listViewEx->m_pModel);
        setItemsMargin(listViewEx->m_fItemsMargin);
        setGravity(listViewEx->m_eGravity);
    }
}
示例#3
0
void ListView::copySpecialProperties(Widget *widget)
{
    ListView* listViewEx = dynamic_cast<ListView*>(widget);
    if (listViewEx)
    {
        ScrollView::copySpecialProperties(widget);
        setItemModel(listViewEx->_model);
        setItemsMargin(listViewEx->_itemsMargin);
        setGravity(listViewEx->_gravity);
        _listViewEventListener = listViewEx->_listViewEventListener;
        _listViewEventSelector = listViewEx->_listViewEventSelector;
        _eventCallback = listViewEx->_eventCallback;
    }
}
DynamicAlbumList::DynamicAlbumList(MWidget *parent) : DynamicMList(parent,  MContentItem::IconAndTwoTextLabels, 1), albumListDeleteConfirm(NULL)
{
    connect(this, SIGNAL(panningStopped()), this, SLOT(doTasklet()));
    connect(AppWindow::instance(), SIGNAL(orientationChanged(M::Orientation)), this, SLOT(onOrientationChanged(M::Orientation)));
    MPListModel *albumListModel = new MPListModel(this, "", MPListModel::Album);
    albumTasklet = new PhotosTasklet(parent);
    setItemModel(albumListModel);
    setTasklet(albumTasklet);
    MContentItemCreator *albumThumbnailCreator = dynamic_cast<MContentItemCreator *>(cellCreator());
    albumThumbnailCreator->setCellProcessor(new AlbumThumbnailsCellProcessor(this));
    onOrientationChanged(AppWindow::instance()->orientation());

    setColumns(2);
    setObjectName("albumList");
    connect(this, SIGNAL(itemClicked(const QModelIndex&)), this, SLOT(onClick(const QModelIndex&)));
    QPixmapCache::setCacheLimit (4096);

    QTimer::singleShot(1500, this, SLOT(doTasklet()));
}
示例#5
0
//-------------------------------------------
MyKGanttView::MyKGanttView( QWidget *parent )
    : NodeGanttViewBase( parent ),
    m_manager( 0 )
{
    kDebug(planDbg())<<"------------------- create MyKGanttView -----------------------";
    GanttItemModel *gm = new GanttItemModel( this );
    setItemModel( gm );
    treeView()->createItemDelegates( gm );

    QList<int> show;
    show << NodeModel::NodeName
            << NodeModel::NodeCompleted
            << NodeModel::NodeStartTime
            << NodeModel::NodeEndTime;

    treeView()->setDefaultColumns( show );
    for ( int i = 0; i < model()->columnCount(); ++i ) {
        if ( ! show.contains( i ) ) {
            treeView()->hideColumn( i );
        }
    }

    setConstraintModel( new KGantt::ConstraintModel( this ) );
    KGantt::ProxyModel *m = static_cast<KGantt::ProxyModel*>( ganttProxyModel() );

    m->setRole( KGantt::ItemTypeRole, KGantt::ItemTypeRole ); // To provide correct format
    m->setRole( KGantt::StartTimeRole, Qt::EditRole ); // To provide correct format
    m->setRole( KGantt::EndTimeRole, Qt::EditRole ); // To provide correct format

    m->setColumn( KGantt::ItemTypeRole, NodeModel::NodeType );
    m->setColumn( KGantt::StartTimeRole, NodeModel::NodeStartTime );
    m->setColumn( KGantt::EndTimeRole, NodeModel::NodeEndTime );
    m->setColumn( KGantt::TaskCompletionRole, NodeModel::NodeCompleted );

    KGantt::DateTimeGrid *g = static_cast<KGantt::DateTimeGrid*>( grid() );
    g->setDayWidth( 30 );
    // TODO: extend QLocale/KGantt to support formats for hourly time display
    // see bug #349030
    // removed custom code here

    connect( model(), SIGNAL(nodeInserted(Node*)), this, SLOT(slotNodeInserted(Node*)) );
}