diff options
Diffstat (limited to 'Swift/QtUI/MUCSearch/MUCSearchEmptyItem.cpp')
| -rw-r--r-- | Swift/QtUI/MUCSearch/MUCSearchEmptyItem.cpp | 38 | 
1 files changed, 38 insertions, 0 deletions
diff --git a/Swift/QtUI/MUCSearch/MUCSearchEmptyItem.cpp b/Swift/QtUI/MUCSearch/MUCSearchEmptyItem.cpp new file mode 100644 index 0000000..b1b4175 --- /dev/null +++ b/Swift/QtUI/MUCSearch/MUCSearchEmptyItem.cpp @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2010 Remko Tronçon + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#include <Swift/QtUI/MUCSearch/MUCSearchEmptyItem.h> + +#include <Swift/QtUI/MUCSearch/MUCSearchServiceItem.h> +#include <QFont> +#include <QColor> + +namespace Swift { +MUCSearchEmptyItem::MUCSearchEmptyItem(MUCSearchServiceItem* parent) : parent(parent) { +	parent->addRoom(this); +} + +MUCSearchServiceItem* MUCSearchEmptyItem::getParent() { +	return parent; +} + +QVariant MUCSearchEmptyItem::data(int role) { +	switch (role) { +		case Qt::DisplayRole: +			return QVariant("No rooms found"); +		case Qt::FontRole: { +			QFont font; +			font.setItalic(true); +			return font; +		} +		case Qt::ForegroundRole: +			return QColor(Qt::gray); +		default: +			return QVariant(); +	} +} + +}  | 
 Swift