First version of tooltip with recipients summary.

svn path=/trunk/kdepim/; revision=381512
wilder-work
Cornelius Schumacher 21 years ago
parent 1589f21490
commit 21c272ba25
  1. 23
      recipientseditor.cpp
  2. 13
      recipientseditor.h

@ -510,6 +510,27 @@ void RecipientsView::setFirstColumnWidth( int w )
}
RecipientsToolTip::RecipientsToolTip( RecipientsView *view, QWidget *parent )
: QToolTip( parent ), mView( view )
{
}
void RecipientsToolTip::maybeTip( const QPoint & p )
{
QString text = "<qt>";
Recipient::List recipients = mView->recipients();
Recipient::List::ConstIterator it;
for( it = recipients.begin(); it != recipients.end(); ++it ) {
text.append( (*it).email() + "<br/>" );
}
text.append( "</qt>" );
tip( QRect( p.x() - 20, p.y() - 20, 40, 40 ), text );
}
SideWidget::SideWidget( RecipientsView *view, QWidget *parent )
: QWidget( parent ), mView( view ), mRecipientPicker( 0 )
{
@ -520,6 +541,8 @@ SideWidget::SideWidget( RecipientsView *view, QWidget *parent )
topLayout->addWidget( mTotalLabel, 1 );
mTotalLabel->hide();
new RecipientsToolTip( view, mTotalLabel );
mDistributionListButton = new QPushButton( "List...", this );
topLayout->addWidget( mDistributionListButton );
mDistributionListButton->hide();

@ -27,6 +27,7 @@
#include <qwidget.h>
#include <qscrollview.h>
#include <qlineedit.h>
#include <qtooltip.h>
#include "kmcomposewin.h"
@ -198,6 +199,18 @@ class RecipientsView : public QScrollView
int mFirstColumnWidth;
};
class RecipientsToolTip : public QToolTip
{
public:
RecipientsToolTip( RecipientsView *, QWidget *parent );
protected:
void maybeTip( const QPoint & p );
private:
RecipientsView *mView;
};
class SideWidget : public QWidget
{
Q_OBJECT

Loading…
Cancel
Save