Logo Search packages:      
Sourcecode: kdbus version File versions  Download package

QWidget * DBusProperty::widget ( QWidget *  parent  )  const [virtual]

See also:
DBusItem::widget

Todo:
actually get the value of the property and display here

Implements DBusItem.

Definition at line 121 of file dbusproperty.cpp.

References DBusAnnotatable::addAnnotationInfo(), DBusItem::addErrorInfo(), canRead(), and canWrite().

                                                       {
    QScrollView * scrollview = new QScrollView( parent );
    QVBox * vbox = new QVBox( scrollview->viewport() );
    scrollview->addChild( vbox );
    scrollview->setMidLineWidth( 0 );
    scrollview->setLineWidth( 0 );
    scrollview->setResizePolicy( QScrollView::AutoOneFit );
    
    new QLabel(
      i18n( "Property: %1" ).arg( d->name ),
      vbox
    );

    new QLabel(
      i18n( "Interface: %1" ).arg( m_interface ),
      vbox
    );

    new QLabel(
      i18n( "Object: %1" ).arg( m_object ),
      vbox
    );

    new QLabel(
      i18n( "Service: %1" ).arg( m_service ),
      vbox
    );

    if ( canRead() )
        new QLabel( i18n( "You may read this property." ), vbox );
    else
        new QLabel( i18n( "You may not read this property." ), vbox );

    if ( canWrite() )
        new QLabel( i18n( "You may write to this property." ), vbox );
    else
        new QLabel( i18n( "You may not write to this property." ), vbox );

    /// @todo actually get the value of the property and display here

    addAnnotationInfo( vbox );
    addErrorInfo( vbox );

    return scrollview;
}


Generated by  Doxygen 1.6.0   Back to index