kalarm
resourcemodelview.cpp
Go to the documentation of this file.
53 connect(resources, SIGNAL(signalResourceModified(AlarmResource*)), SLOT(updateResource(AlarmResource*)));
54 connect(resources, SIGNAL(standardResourceChange(CalEvent::Type)), SLOT(slotStandardChanged(CalEvent::Type)));
55 connect(resources, SIGNAL(resourceStatusChanged(AlarmResource*,AlarmResources::Change)), SLOT(slotStatusChanged(AlarmResource*,AlarmResources::Change)));
56 connect(resources, SIGNAL(resourceLoaded(AlarmResource*,bool)), SLOT(slotLoaded(AlarmResource*,bool)));
91 case CalEvent::ACTIVE: colour = KColorScheme(QPalette::Active).foreground(KColorScheme::NormalText).color(); break;
93 case CalEvent::TEMPLATE: colour = KColorScheme(QPalette::Active).foreground(KColorScheme::LinkText).color(); break;
117 QString disabled = resource->isWrongAlarmType() ? i18nc("@info/plain", "Disabled (wrong alarm type)") : i18nc("@info/plain", "Disabled");
340 return static_cast<ResourceModel*>(sourceModel())->resource(sourceModel()->index(sourceRow, 0))->alarmType() == mResourceType;
378 bool ResourceDelegate::editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index)
388 QRect(option.rect.x() + textMargin, option.rect.y(), option.rect.width(), option.rect.height()));
406 Qt::CheckState state = (static_cast<Qt::CheckState>(value.toInt()) == Qt::Checked ? Qt::Unchecked : Qt::Checked);
518 int checkWidth = QApplication::style()->subElementRect(QStyle::SE_ViewItemCheckIndicator, &opt).width();
519 int left = spacing() + 3*margin + checkWidth + viewOptions().decorationSize.width(); // left offset of text
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const
void clear()
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
virtual bool editorEvent(QEvent *, QAbstractItemModel *, const QStyleOptionViewItem &, const QModelIndex &)
Definition: resourcemodelview.cpp:378
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: resourcemodelview.cpp:59
Type type() const
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const =0
virtual QVariant data(const QModelIndex &, int role=Qt::DisplayRole) const
Definition: resourcemodelview.cpp:73
void removeResource(AlarmResource *)
Definition: resourcemodelview.cpp:246
virtual void setSourceModel(QAbstractItemModel *sourceModel)
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const =0
virtual void setModel(QAbstractItemModel *model)
virtual void mouseReleaseEvent(QMouseEvent *e)
void removeAt(int i)
const QPoint & pos() const
T value() const
virtual void mouseReleaseEvent(QMouseEvent *)
Definition: resourcemodelview.cpp:485
virtual bool setData(const QModelIndex &, const QVariant &value, int role=Qt::EditRole)
Definition: resourcemodelview.cpp:147
QString & remove(int position, int n)
void showText(const QPoint &pos, const QString &text, QWidget *w)
QRect alignedRect(Qt::LayoutDirection direction, QFlags< Qt::AlignmentFlag > alignment, const QSize &size, const QRect &rectangle)
virtual bool event(QEvent *e)
int indexOf(const T &value, int from) const
void clear()
virtual Qt::ItemFlags flags(const QModelIndex &) const
Definition: resourcemodelview.cpp:184
int width() const
void setBold(bool enable)
const char * name() const
bool isValid() const
QRect boundingRect(QChar ch) const
virtual bool viewportEvent(QEvent *event)
int count(const T &value) const
virtual bool viewportEvent(QEvent *)
Definition: resourcemodelview.cpp:495
AlarmResource * resource(int row) const
Definition: resourcemodelview.cpp:346
static ResourceModel * instance(QObject *parent=0)
Definition: resourcemodelview.cpp:41
int toInt(bool *ok) const
AlarmResource * resource(const QModelIndex &) const
Definition: resourcemodelview.cpp:192
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
void endInsertRows()
const QPoint & globalPos() const
ResourceFilterModel(QAbstractItemModel *baseModel, QObject *parent)
Definition: resourcemodelview.cpp:322
bool isEmpty() const
void beginRemoveRows(const QModelIndex &parent, int first, int last)
void setItemDelegate(QAbstractItemDelegate *delegate)
void invalidateFilter()
void * internalPointer() const
virtual int horizontalOffset() const
virtual QVariant data(const QModelIndex &index, int role) const =0
bool contains(const QPoint &point, bool proper) const
bool isActiveWindow() const
QRect rectForIndex(const QModelIndex &index) const
QModelIndex createIndex(int row, int column, void *ptr) const
const QFont & font() const
void beginInsertRows(const QModelIndex &parent, int first, int last)
virtual QStyleOptionViewItem viewOptions() const
int spacing() const
void notifyChange(const QModelIndex &)
Definition: resourcemodelview.cpp:202
QAbstractItemModel * sourceModel() const
virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const
virtual QModelIndex indexAt(const QPoint &p) const
int width() const
QString mid(int position, int n) const
int frameWidth() const
QVariant data(int role) const
QStyle * style()
static void sorry(QWidget *parent, const QString &text, const QString &caption=QString(), Options options=Options(Notify|WindowModal))
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const
Definition: resourcemodelview.cpp:66
virtual bool setData(const QModelIndex &index, const QVariant &value, int role)
static int warningContinueCancel(QWidget *parent, const QString &text, const QString &caption=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Options(Notify|WindowModal))
bool isValid() const
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Definition: resourcemodelview.h:38
Definition: resourcemodelview.h:70
virtual QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const =0
const QPoint & pos() const
QString toolTip() const
void endRemoveRows()
QAbstractItemModel * model() const
void clearSelection()
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const
virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
Definition: resourcemodelview.cpp:338
virtual void setModel(QAbstractItemModel *)
Definition: resourcemodelview.cpp:448
bool isValid() const
Definition: resourcemodelview.h:106
typedef ItemFlags
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.