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

QTerm::PopupMessage::PopupMessage ( QWidget *  parent,
QWidget *  anchor,
int  timeout = 5000,
const char *  name = 0 
)

Parameters:
anchor : which widget to tie the popup widget to.
timeout : how long to wait before auto closing. A value of 0 means close only on pressing the closeButton or close() is called.

Definition at line 42 of file popupMessage.cpp.

                : OverlayWidget( parent, anchor, name )
                , m_anchor( anchor )
                , m_parent( parent )
                , m_maskEffect( Slide )
                , m_dissolveSize( 0 )
                , m_dissolveDelta( -1 )
                , m_offset( 0 )
                , m_counter( 0 )
                , m_stage( 1 )
                , m_timeout( timeout )
                , m_showCounter( true )
{
    setFrameStyle( QFrame::Panel | QFrame::Raised );
    setFrameShape( QFrame::StyledPanel );
    setWFlags( Qt::WX11BypassWM );

    QHBoxLayout *hbox;
    QLabel *label;
    QLabel *alabel;
    //KActiveLabel *alabel;

    m_layout = new QVBoxLayout( this, 9 /*margin*/, 6 /*spacing*/ );

    hbox = new QHBoxLayout( m_layout, 12 );

    hbox->addWidget( m_countdownFrame = new QFrame( this, "counterVisual" ) );
    m_countdownFrame->setFixedWidth( fontMetrics().width( "X" ) );
    m_countdownFrame->setFrameStyle( QFrame::Plain | QFrame::Box );
    m_countdownFrame->setPaletteForegroundColor( paletteBackgroundColor().dark() );

    label = new QLabel( this, "image" );
    hbox->add( label );
    label->hide();

    alabel = new QLabel( "Details of the tasks: ", this, "label");
    //alabel = new KActiveLabel( this, "label" );
    //alabel->setTextFormat( Qt::RichText );
    alabel->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );

    hbox->add( alabel );

    hbox = new QHBoxLayout( m_layout );

    hbox->addItem( new QSpacerItem( 4, 4, QSizePolicy::Expanding, QSizePolicy::Preferred ) );
    //FIXME: add icon
    hbox->add( new QPushButton( "Close", this, "closeButton" ) );

    connect( child( "closeButton" ), SIGNAL(clicked()), SLOT(close()) );
}


Generated by  Doxygen 1.6.0   Back to index