lokalize
projectwidget.cpp
Go to the documentation of this file.
54 void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
65 QSize PoItemDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const
78 void PoItemDelegate::paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
141 connect(Project::instance()->model(),SIGNAL(totalsChanged(int,int,int,bool)),this,SLOT(invalidate()));
152 bool SortFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const
178 // kWarning()<<right.column()<<"--"<<left.row()<<right.row()<<left.internalPointer()<<right.internalPointer()<<left.parent().isValid()<<right.parent().isValid();
185 //TODO: make KDirSortFilterProxyModel::subSortLessThan not cast model to KDirModel, but use data() with FileItemRole instead.
225 return KStringHandler::naturalCompare(leftFileItem.name(), rightFileItem.name(), sortCaseSensitivity()) < 0;
262 return KStringHandler::naturalCompare(projectModel->data(left).toString(), projectModel->data(right).toString(), sortCaseSensitivity()) < 0;
305 header()->restoreState(QByteArray::fromBase64( stateGroup.readEntry("ListHeaderState", QByteArray()) ));
346 ProjectModel * srcModel = static_cast<ProjectModel *>(static_cast<QSortFilterProxyModel*>(m_proxyModel)->sourceModel());
398 bool ProjectWidget::gotoIndexCheck(const QModelIndex& currentIndex, ProjectModel::AdditionalRoles role)
402 ProjectModel *srcModel = static_cast<ProjectModel *>(static_cast<QSortFilterProxyModel*>(m_proxyModel)->sourceModel());
403 QModelIndex srcIndex = static_cast<QSortFilterProxyModel*>(m_proxyModel)->mapToSource(currentIndex);
410 QModelIndex ProjectWidget::gotoIndexPrevNext(const QModelIndex& currentIndex, int direction) const
444 QModelIndex child = index.child((direction == 1) ? 0 : (m_proxyModel->rowCount(index) - 1), index.column());
473 void ProjectWidget::gotoPrevFuzzyUntr() {gotoIndex(currentIndex(), ProjectModel::FuzzyUntrCountRole, -1);}
474 void ProjectWidget::gotoNextFuzzyUntr() {gotoIndex(currentIndex(), ProjectModel::FuzzyUntrCountRole, +1);}
475 void ProjectWidget::gotoPrevFuzzy() {gotoIndex(currentIndex(), ProjectModel::FuzzyCountRole, -1);}
476 void ProjectWidget::gotoNextFuzzy() {gotoIndex(currentIndex(), ProjectModel::FuzzyCountRole, +1);}
477 void ProjectWidget::gotoPrevUntranslated() {gotoIndex(currentIndex(), ProjectModel::UntransCountRole, -1);}
478 void ProjectWidget::gotoNextUntranslated() {gotoIndex(currentIndex(), ProjectModel::UntransCountRole, +1);}
479 void ProjectWidget::gotoPrevTemplateOnly() {gotoIndex(currentIndex(), ProjectModel::TemplateOnlyRole, -1);}
480 void ProjectWidget::gotoNextTemplateOnly() {gotoIndex(currentIndex(), ProjectModel::TemplateOnlyRole, +1);}
481 void ProjectWidget::gotoPrevTransOnly() {gotoIndex(currentIndex(), ProjectModel::TransOnlyRole, -1);}
482 void ProjectWidget::gotoNextTransOnly() {gotoIndex(currentIndex(), ProjectModel::TransOnlyRole, +1);}
QObject * child(const char *objName, const char *inheritsClass, bool recursiveSearch) const
KUrl beginEditing(const QModelIndex &index)
Definition: projectmodel.cpp:158
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
virtual int rowCount(const QModelIndex &parent) const =0
Definition: projectmodel.h:140
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const =0
Definition: projectmodel.h:139
Definition: projectmodel.h:122
void fillRect(const QRectF &rectangle, const QBrush &brush)
void setCurrentIndex(const QModelIndex &index)
void setSelectionMode(QAbstractItemView::SelectionMode mode)
bool restoreState(const QByteArray &state)
int size() const
void setUniformRowHeights(bool uniform)
bool currentIsTranslationFile() const
Definition: projectwidget.cpp:334
void sortByColumn(int column, Qt::SortOrder order)
void setSelectionBehavior(QAbstractItemView::SelectionBehavior behavior)
Definition: projectmodel.h:129
void expandItems(const QModelIndex &parent=QModelIndex())
Definition: projectwidget.cpp:387
Some notes: Uses two KDirModels for template and translations dir.
Definition: projectmodel.h:54
bool isValid() const
int columnWidth(int column) const
void setColumnWidth(int column, int width)
int toInt(bool *ok) const
int top() const
void setPen(const QColor &color)
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
int left() const
void setItemDelegate(QAbstractItemDelegate *delegate)
int row() const
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: projectmodel.h:137
Definition: projectmodel.h:126
Definition: projectmodel.h:136
void setAllColumnsShowFocus(bool enable)
QModelIndex parent() const
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
we use QRect to pass data through QVariant tunnel
Definition: projectmodel.cpp:611
Definition: projectmodel.h:138
virtual void scrollTo(const QModelIndex &index, ScrollHint hint)
QModelIndex child(int row, int column) const
void activated(const QModelIndex &index)
virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
void setSortingEnabled(bool enable)
int width() const
QVariant data(int role) const
Definition: projectmodel.h:130
QByteArray fromBase64(const QByteArray &base64)
QModelIndex sibling(int row, int column) const
static void recursiveAdd(KUrl::List &list, const QModelIndex &idx)
Definition: projectwidget.cpp:354
int count() const
virtual void setModel(QAbstractItemModel *model)
int column() const
virtual QModelIndexList selectedIndexes() const
void fileOpenRequested(const KUrl &)
bool isValid() const
Definition: projectmodel.h:125
QHeaderView * header() const
Definition: projectmodel.h:128
QRect toRect() const
void expand(const QModelIndex &index)
QAbstractItemModel * model() const
QModelIndex currentIndex() const
void clearSelection()
Definition: projectmodel.h:123
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString toString() const
int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: projectmodel.cpp:549
KFileItem itemForIndex(const QModelIndex &index) const
Definition: projectmodel.cpp:701
Definition: projectmodel.h:124
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:07 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:40:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.