akonadi
22 #include "tagwidget.h"
24 #include "autoqpointer_p.h"
25 #include "kedittagsdialog_p.h"
28 #include <klocalizedstring.h>
29 #include <ksqueezedtextlabel.h>
31 #include <QHBoxLayout>
32 #include <QToolButton>
34 TagWidget::TagWidget( QWidget *parent )
37 QHBoxLayout *layout =
new QHBoxLayout(
this );
38 mTagLabel =
new KSqueezedTextLabel;
39 mTagLabel->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
40 layout->addWidget( mTagLabel );
42 QToolButton *editButton =
new QToolButton;
43 editButton->setText( i18n(
"..." ) );
44 layout->addWidget( editButton, Qt::AlignRight );
46 layout->setStretch( 0, 10 );
48 connect( editButton, SIGNAL(clicked()), SLOT(editTags()) );
51 TagWidget::~TagWidget()
55 void TagWidget::setTags(
const QVector<Nepomuk2::Tag> &tags )
61 QVector<Nepomuk2::Tag> TagWidget::tags()
const
66 void TagWidget::editTags()
75 void TagWidget::updateView()
78 foreach (
const Nepomuk2::Tag &tag, mTags ) {
79 const QString separator = ( tag == mTags.last() ? QString() : QLatin1String(
", " ) );
80 text += tag.genericLabel() + separator;
83 qobject_cast<KSqueezedTextLabel*>( mTagLabel )->setText( text );
86 #include "tagwidget.h"
A QPointer which when destructed, deletes the object it points to.
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:28 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.