• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

lokalize

  • sources
  • kde-4.14
  • kdesdk
  • lokalize
  • src
  • project
projectwidget.cpp
Go to the documentation of this file.
1 /* ****************************************************************************
2  This file is part of Lokalize
3 
4  Copyright (C) 2007-2009 by Nick Shaforostoff <shafff@ukr.net>
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License as
8  published by the Free Software Foundation; either version 2 of
9  the License or (at your option) version 3 or any later version
10  accepted by the membership of KDE e.V. (or its successor approved
11  by the membership of KDE e.V.), which shall act as a proxy
12  defined in Section 14 of version 3 of the license.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program. If not, see <http://www.gnu.org/licenses/>.
21 
22 **************************************************************************** */
23 
24 #include "projectwidget.h"
25 
26 #include "project.h"
27 #include "catalog.h"
28 
29 #include <kdebug.h>
30 #include <klocale.h>
31 #include <kdirlister.h>
32 #include <kstringhandler.h>
33 #include <kdirsortfilterproxymodel.h>
34 #include <kcolorscheme.h>
35 
36 #include <QTreeView>
37 #include <QTimer>
38 #include <QMouseEvent>
39 #include <QKeyEvent>
40 #include <QPainter>
41 #include <QLinearGradient>
42 #include <QHeaderView>
43 #include <QItemDelegate>
44 #include <QStyledItemDelegate>
45 
46 #undef KDE_NO_DEBUG_OUTPUT
47 
48 
49 class PoItemDelegate: public QStyledItemDelegate
50 {
51 public:
52  PoItemDelegate(QObject *parent=0);
53  ~PoItemDelegate(){}
54  void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
55  QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
56 private:
57  KColorScheme m_colorScheme;
58 };
59 
60 PoItemDelegate::PoItemDelegate(QObject *parent)
61  : QStyledItemDelegate(parent)
62  , m_colorScheme(QPalette::Normal)
63 {}
64 
65 QSize PoItemDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const
66 {
67  QString text=index.data().toString();
68  int lineCount=1;
69  int nPos=text.indexOf('\n');
70  if (nPos==-1)
71  nPos=text.size();
72  else
73  lineCount+=text.count('\n');
74  static QFontMetrics metrics(option.font);
75  return QSize(metrics.averageCharWidth()*nPos, metrics.height()*lineCount);
76 }
77 
78 void PoItemDelegate::paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
79 {
80  if (index.column() != ProjectModel::Graph)
81  return QStyledItemDelegate::paint(painter,option,index);
82 
83  QVariant graphData = index.data(Qt::DisplayRole);
84  if (KDE_ISUNLIKELY( !graphData.isValid()))
85  {
86  painter->fillRect(option.rect,Qt::transparent);
87  return;
88  }
89 
90  QRect rect = graphData.toRect();
91  int translated = rect.left();
92  int untranslated = rect.top();
93  int fuzzy = rect.width();
94  int total = translated + untranslated + fuzzy;
95 
96  if (total > 0)
97  {
98  QBrush brush;
99  painter->setPen(Qt::white);
100  QRect myRect(option.rect);
101 
102  if (translated)
103  {
104  brush=m_colorScheme.foreground(KColorScheme::PositiveText);
105  myRect.setWidth(option.rect.width() * translated / total);
106  painter->fillRect(myRect, brush);
107  }
108 
109  if (fuzzy)
110  {
111  brush=m_colorScheme.foreground(KColorScheme::NeutralText);
112  myRect.setLeft(myRect.left() + myRect.width());
113  myRect.setWidth(option.rect.width() * fuzzy / total);
114  painter->fillRect(myRect, brush);
115  // painter->drawText(myRect,Qt::AlignRight,QString("%1").arg(data.width()));
116  }
117 
118  if (untranslated)
119  brush=m_colorScheme.foreground(KColorScheme::NegativeText);
120  myRect.setLeft(myRect.left() + myRect.width());
121  myRect.setWidth(option.rect.width() - myRect.left() + option.rect.left());
122  painter->fillRect(myRect, brush);
123  // painter->drawText(myRect,Qt::AlignRight,QString("%1").arg(data.top()));
124  }
125  else if (total == -1)
126  painter->fillRect(option.rect,Qt::transparent);
127  else if (total == 0)
128  painter->fillRect(option.rect,QBrush(Qt::gray));
129 }
130 
131 
132 
133 
134 
135 class SortFilterProxyModel : public KDirSortFilterProxyModel
136 {
137 public:
138  SortFilterProxyModel(QObject* parent=0)
139  : KDirSortFilterProxyModel(parent)
140  {
141  connect(Project::instance()->model(),SIGNAL(totalsChanged(int,int,int,bool)),this,SLOT(invalidate()));
142  }
143  ~SortFilterProxyModel(){}
144 protected:
145  bool lessThan(const QModelIndex& left,
146  const QModelIndex& right) const;
147  bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const;
148 
149 };
150 
151 
152 bool SortFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const
153 {
154 #ifdef _MSC_VER
155  return true;
156 #endif
157 
158  bool result=false;
159  const QAbstractItemModel* model=sourceModel();
160  QModelIndex item=model->index(source_row,0,source_parent);
161 /*
162  if (model->hasChildren(item))
163  model->fetchMore(item);
164 */
165  if (item.data(ProjectModel::TotalRole) == 0)
166  return false; // Hide rows with no translations
167 
168  int i=model->rowCount(item);
169  while(--i>=0 && !result)
170  result=filterAcceptsRow(i,item);
171 
172  return result || QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent);
173 }
174 
175 bool SortFilterProxyModel::lessThan(const QModelIndex& left,
176  const QModelIndex& right) const
177 {
178 // kWarning()<<right.column()<<"--"<<left.row()<<right.row()<<left.internalPointer()<<right.internalPointer()<<left.parent().isValid()<<right.parent().isValid();
179  //<<left.data().toString()<<right.data().toString()
180  ProjectModel* projectModel = static_cast<ProjectModel*>(sourceModel());
181  const KFileItem leftFileItem = projectModel->itemForIndex(left);
182  const KFileItem rightFileItem = projectModel->itemForIndex(right);
183 
184  //Code taken from KDirSortFilterProxyModel, as it is not compatible with our model.
185  //TODO: make KDirSortFilterProxyModel::subSortLessThan not cast model to KDirModel, but use data() with FileItemRole instead.
186 
187  // Directories and hidden files should always be on the top, independent
188  // from the sort order.
189  const bool isLessThan = (sortOrder() == Qt::AscendingOrder);
190 
191 
192 
193  if (leftFileItem.isNull() || rightFileItem.isNull())
194  {
195  kWarning()<<".isNull()";
196  return false;
197  }
198 
199  // On our priority, folders go above regular files.
200  if (leftFileItem.isDir() && !rightFileItem.isDir()) {
201  return isLessThan;
202  } else if (!leftFileItem.isDir() && rightFileItem.isDir()) {
203  return !isLessThan;
204  }
205 
206  // Hidden elements go before visible ones, if they both are
207  // folders or files.
208  if (leftFileItem.isHidden() && !rightFileItem.isHidden()) {
209  return isLessThan;
210  } else if (!leftFileItem.isHidden() && rightFileItem.isHidden()) {
211  return !isLessThan;
212  }
213 
214 
215  // Hidden elements go before visible ones, if they both are
216  // folders or files.
217  if (leftFileItem.isHidden() && !rightFileItem.isHidden()) {
218  return true;
219  } else if (!leftFileItem.isHidden() && rightFileItem.isHidden()) {
220  return false;
221  }
222 
223  switch(left.column()) {
224  case ProjectModel::FileName:
225  return KStringHandler::naturalCompare(leftFileItem.name(), rightFileItem.name(), sortCaseSensitivity()) < 0;
226  case ProjectModel::Graph:{
227  QRect leftRect(left.data(Qt::DisplayRole).toRect());
228  QRect rightRect(right.data(Qt::DisplayRole).toRect());
229 
230  int leftAll=leftRect.left()+leftRect.top()+leftRect.width();
231  int rightAll=rightRect.left()+rightRect.top()+rightRect.width();
232 
233  if (!leftAll || !rightAll)
234  return false;
235 
236  float leftVal=(float)leftRect.left()/leftAll;
237  float rightVal=(float)rightRect.left()/rightAll;
238 
239  if (leftVal<rightVal)
240  return true;
241  if (leftVal>rightVal)
242  return false;
243 
244  leftVal=(float)leftRect.top()/leftAll;
245  rightVal=(float)rightRect.top()/rightAll;
246 
247  if (leftVal<rightVal)
248  return true;
249  if (leftVal>rightVal)
250  return false;
251 
252  leftVal=(float)leftRect.width()/leftAll;
253  rightVal=(float)rightRect.width()/rightAll;
254 
255  if (leftVal<rightVal)
256  return true;
257  return false;
258  }
259  case ProjectModel::LastTranslator:
260  case ProjectModel::SourceDate:
261  case ProjectModel::TranslationDate:
262  return KStringHandler::naturalCompare(projectModel->data(left).toString(), projectModel->data(right).toString(), sortCaseSensitivity()) < 0;
263  case ProjectModel::TotalCount:
264  case ProjectModel::TranslatedCount:
265  case ProjectModel::UntranslatedCount:
266  case ProjectModel::FuzzyCount:
267  return projectModel->data(left).toInt() < projectModel->data(right).toInt();
268  default:
269  return false;
270  }
271 }
272 
273 ProjectWidget::ProjectWidget(/*Catalog* catalog, */QWidget* parent)
274  : QTreeView(parent)
275  , m_proxyModel(new SortFilterProxyModel(this))
276 // , m_catalog(catalog)
277 {
278  PoItemDelegate* delegate=new PoItemDelegate(this);
279  setItemDelegate(delegate);
280 
281  connect(this,SIGNAL(activated(QModelIndex)),this,SLOT(slotItemActivated(QModelIndex)));
282 
283  m_proxyModel->setSourceModel(Project::instance()->model());
284  //m_proxyModel->setDynamicSortFilter(true);
285  setModel(m_proxyModel);
286  //setModel(Project::instance()->model());
287 
288  setUniformRowHeights(true);
289  setAllColumnsShowFocus(true);
290  int widthDefaults[]={6,1,1,1,1,1,4,4};
291  int i=sizeof(widthDefaults)/sizeof(int);
292  int baseWidth=columnWidth(0);
293  while(--i>=0)
294  setColumnWidth(i, baseWidth*widthDefaults[i]/2);
295 
296  setSortingEnabled(true);
297  sortByColumn(0, Qt::AscendingOrder);
298 
299  setSelectionMode(QAbstractItemView::ExtendedSelection);
300  setSelectionBehavior(QAbstractItemView::SelectRows);
301 // QTimer::singleShot(0,this,SLOT(initLater()));
302 
303  KConfig config;
304  KConfigGroup stateGroup(&config,"ProjectWindow");
305  header()->restoreState(QByteArray::fromBase64( stateGroup.readEntry("ListHeaderState", QByteArray()) ));
306 }
307 
308 ProjectWidget::~ProjectWidget()
309 {
310  KConfig config;
311  KConfigGroup stateGroup(&config,"ProjectWindow");
312  stateGroup.writeEntry("ListHeaderState",header()->saveState().toBase64());
313 
314 }
315 
316 void ProjectWidget::setCurrentItem(const KUrl& u)
317 {
318  if (u.isEmpty())
319  return;
320  setCurrentIndex(m_proxyModel->mapFromSource(
321  Project::instance()->model()->indexForUrl(u))
322  /*,true*/);
323 }
324 
325 KUrl ProjectWidget::currentItem() const
326 {
327  if (!currentIndex().isValid())
328  return KUrl();
329  return Project::instance()->model()->itemForIndex(
330  m_proxyModel->mapToSource(currentIndex())
331  ).url();
332 }
333 
334 bool ProjectWidget::currentIsTranslationFile() const
335 {
336  //remember 'bout empty state
337  return Catalog::extIsSupported(currentItem().path());
338 }
339 
340 
341 
342 void ProjectWidget::slotItemActivated(const QModelIndex& index)
343 {
344  if (currentIsTranslationFile())
345  {
346  ProjectModel * srcModel = static_cast<ProjectModel *>(static_cast<QSortFilterProxyModel*>(m_proxyModel)->sourceModel());
347  QModelIndex srcIndex = static_cast<QSortFilterProxyModel*>(m_proxyModel)->mapToSource(index);
348  KUrl fileUrl = srcModel->beginEditing(srcIndex);
349 
350  emit fileOpenRequested(fileUrl);
351  }
352 }
353 
354 static void recursiveAdd(KUrl::List& list, const QModelIndex& idx)
355 {
356  ProjectModel& model=*(Project::instance()->model());
357  const KFileItem& item(model.itemForIndex(idx));
358  if (item.isDir())
359  {
360  int j=model.rowCount(idx);
361  while (--j>=0)
362  {
363  const KFileItem& childItem(model.itemForIndex(idx.child(j,0)));
364 
365  if (childItem.isDir())
366  recursiveAdd(list,idx.child(j,0));
367  else
368  list.prepend(childItem.url());
369  }
370  }
371  else //if (!list.contains(u))
372  list.prepend(item.url());
373 }
374 
375 KUrl::List ProjectWidget::selectedItems() const
376 {
377  KUrl::List list;
378  foreach(const QModelIndex& item, selectedIndexes())
379  {
380  if (item.column()==0)
381  recursiveAdd(list,m_proxyModel->mapToSource(item));
382  }
383 
384  return list;
385 }
386 
387 void ProjectWidget::expandItems(const QModelIndex& parent)
388 {
389  const QAbstractItemModel* m=model();
390  expand(parent);
391 
392  int i=m->rowCount(parent);
393  while(--i>=0)
394  expandItems(m->index(i,0,parent));
395 }
396 
397 
398 bool ProjectWidget::gotoIndexCheck(const QModelIndex& currentIndex, ProjectModel::AdditionalRoles role)
399 {
400  // Check if role is found for this index
401  if (currentIndex.isValid()) {
402  ProjectModel *srcModel = static_cast<ProjectModel *>(static_cast<QSortFilterProxyModel*>(m_proxyModel)->sourceModel());
403  QModelIndex srcIndex = static_cast<QSortFilterProxyModel*>(m_proxyModel)->mapToSource(currentIndex);
404  QVariant result = srcModel->data(srcIndex, role);
405  return result.isValid() && result.toInt() > 0;
406  }
407  return false;
408 }
409 
410 QModelIndex ProjectWidget::gotoIndexPrevNext(const QModelIndex& currentIndex, int direction) const
411 {
412  QModelIndex index = currentIndex;
413  QModelIndex sibling;
414 
415  // Unless first or last sibling reached, continue with previous or next
416  // sibling, otherwise continue with previous or next parent
417  while (index.isValid())
418  {
419  sibling = index.sibling(index.row() + direction, index.column());
420  if (sibling.isValid())
421  return sibling;
422  index = index.parent();
423  }
424  return index;
425 }
426 
427 ProjectWidget::gotoIndexResult ProjectWidget::gotoIndexFind(
428  const QModelIndex& currentIndex, ProjectModel::AdditionalRoles role, int direction)
429 {
430  QModelIndex index = currentIndex;
431 
432  while (index.isValid())
433  {
434  // Set current index and show it if role is found for this index
435  if (gotoIndexCheck(index, role))
436  {
437  clearSelection();
438  setCurrentIndex(index);
439  scrollTo(index);
440  return gotoIndex_found;
441  }
442 
443  // Handle child recursively if index is not a leaf
444  QModelIndex child = index.child((direction == 1) ? 0 : (m_proxyModel->rowCount(index) - 1), index.column());
445  if (child.isValid())
446  {
447  ProjectWidget::gotoIndexResult result = gotoIndexFind(child, role, direction);
448  if (result != gotoIndex_notfound)
449  return result;
450  }
451 
452  // Go to previous or next item
453  index = gotoIndexPrevNext(index, direction);
454  }
455  if (index.parent().isValid())
456  return gotoIndex_notfound;
457  else
458  return gotoIndex_end;
459 }
460 
461 ProjectWidget::gotoIndexResult ProjectWidget::gotoIndex(
462  const QModelIndex& currentIndex, ProjectModel::AdditionalRoles role, int direction)
463 {
464  QModelIndex index = currentIndex;
465 
466  // Check if current index already found, and if so go to previous or next item
467  if (gotoIndexCheck(index, role))
468  index = gotoIndexPrevNext(index, direction);
469 
470  return gotoIndexFind(index, role, direction);
471 }
472 
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);}
483 
484 QSortFilterProxyModel* ProjectWidget::proxyModel(){return m_proxyModel;}
485 
486 #include "projectwidget.moc"
QObject::child
QObject * child(const char *objName, const char *inheritsClass, bool recursiveSearch) const
ProjectModel::beginEditing
KUrl beginEditing(const QModelIndex &index)
Definition: projectmodel.cpp:158
QModelIndex
QString::indexOf
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
project.h
QWidget
QAbstractItemModel::rowCount
virtual int rowCount(const QModelIndex &parent) const =0
ProjectWidget::gotoNextFuzzyUntr
void gotoNextFuzzyUntr()
Definition: projectwidget.cpp:474
ProjectModel::TotalRole
Definition: projectmodel.h:140
QAbstractItemModel::index
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const =0
ProjectModel::TransOnlyRole
Definition: projectmodel.h:139
ProjectModel::FileName
Definition: projectmodel.h:122
ProjectWidget::setCurrentItem
void setCurrentItem(const KUrl &)
Definition: projectwidget.cpp:316
ProjectModel::FuzzyUntrCountRole
Definition: projectmodel.h:135
QPainter::fillRect
void fillRect(const QRectF &rectangle, const QBrush &brush)
QAbstractItemView::setCurrentIndex
void setCurrentIndex(const QModelIndex &index)
QAbstractItemView::setSelectionMode
void setSelectionMode(QAbstractItemView::SelectionMode mode)
QByteArray
QHeaderView::restoreState
bool restoreState(const QByteArray &state)
Project::instance
static Project * instance()
Definition: project.cpp:67
QString::size
int size() const
QTreeView::setUniformRowHeights
void setUniformRowHeights(bool uniform)
QBrush
ProjectModel::AdditionalRoles
AdditionalRoles
Definition: projectmodel.h:134
QFontMetrics
ProjectWidget::currentIsTranslationFile
bool currentIsTranslationFile() const
Definition: projectwidget.cpp:334
QTreeView::sortByColumn
void sortByColumn(int column, Qt::SortOrder order)
QAbstractItemView::setSelectionBehavior
void setSelectionBehavior(QAbstractItemView::SelectionBehavior behavior)
ProjectWidget::selectedItems
KUrl::List selectedItems() const
Definition: projectwidget.cpp:375
ProjectModel::TranslationDate
Definition: projectmodel.h:129
ProjectWidget::expandItems
void expandItems(const QModelIndex &parent=QModelIndex())
Definition: projectwidget.cpp:387
ProjectWidget::currentItem
KUrl currentItem() const
Definition: projectwidget.cpp:325
ProjectModel
Some notes: Uses two KDirModels for template and translations dir.
Definition: projectmodel.h:54
ProjectWidget::gotoPrevTransOnly
void gotoPrevTransOnly()
Definition: projectwidget.cpp:481
ProjectWidget::gotoNextFuzzy
void gotoNextFuzzy()
Definition: projectwidget.cpp:476
Catalog::extIsSupported
static bool extIsSupported(const QString &path)
Definition: catalog.cpp:93
QRect
QModelIndex::isValid
bool isValid() const
QTreeView::columnWidth
int columnWidth(int column) const
QTreeView::setColumnWidth
void setColumnWidth(int column, int width)
ProjectWidget::gotoPrevTemplateOnly
void gotoPrevTemplateOnly()
Definition: projectwidget.cpp:479
QVariant::toInt
int toInt(bool *ok) const
QRect::top
int top() const
QStyleOptionViewItem
ProjectWidget::~ProjectWidget
~ProjectWidget()
Definition: projectwidget.cpp:308
QObject
QPainter::setPen
void setPen(const QColor &color)
QStyledItemDelegate::paint
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
catalog.h
QRect::left
int left() const
ProjectWidget::gotoPrevUntranslated
void gotoPrevUntranslated()
Definition: projectwidget.cpp:477
QPainter
QAbstractItemView::setItemDelegate
void setItemDelegate(QAbstractItemDelegate *delegate)
QModelIndex::row
int row() const
Project::model
ProjectModel * model()
Definition: project.cpp:265
QStyledItemDelegate::sizeHint
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
ProjectModel::UntransCountRole
Definition: projectmodel.h:137
ProjectModel::FuzzyCount
Definition: projectmodel.h:126
ProjectModel::FuzzyCountRole
Definition: projectmodel.h:136
QTreeView::setAllColumnsShowFocus
void setAllColumnsShowFocus(bool enable)
QString
QModelIndex::parent
QModelIndex parent() const
ProjectWidget::gotoNextTemplateOnly
void gotoNextTemplateOnly()
Definition: projectwidget.cpp:480
ProjectModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
we use QRect to pass data through QVariant tunnel
Definition: projectmodel.cpp:611
ProjectModel::TemplateOnlyRole
Definition: projectmodel.h:138
ProjectWidget::proxyModel
QSortFilterProxyModel * proxyModel()
Definition: projectwidget.cpp:484
ProjectWidget::gotoPrevFuzzy
void gotoPrevFuzzy()
Definition: projectwidget.cpp:475
QSize
QSortFilterProxyModel
QTreeView::scrollTo
virtual void scrollTo(const QModelIndex &index, ScrollHint hint)
QModelIndex::child
QModelIndex child(int row, int column) const
QAbstractItemView::activated
void activated(const QModelIndex &index)
QSortFilterProxyModel::filterAcceptsRow
virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
QTreeView::setSortingEnabled
void setSortingEnabled(bool enable)
ProjectWidget::gotoNextUntranslated
void gotoNextUntranslated()
Definition: projectwidget.cpp:478
QRect::width
int width() const
ProjectWidget::ProjectWidget
ProjectWidget(QWidget *parent)
Definition: projectwidget.cpp:273
QModelIndex::data
QVariant data(int role) const
ProjectModel::LastTranslator
Definition: projectmodel.h:130
QTreeView
QByteArray::fromBase64
QByteArray fromBase64(const QByteArray &base64)
QModelIndex::sibling
QModelIndex sibling(int row, int column) const
recursiveAdd
static void recursiveAdd(KUrl::List &list, const QModelIndex &idx)
Definition: projectwidget.cpp:354
QString::count
int count() const
QTreeView::setModel
virtual void setModel(QAbstractItemModel *model)
QModelIndex::column
int column() const
ProjectModel::indexForUrl
QModelIndex indexForUrl(const KUrl &url)
Definition: projectmodel.cpp:757
QTreeView::selectedIndexes
virtual QModelIndexList selectedIndexes() const
ProjectWidget::fileOpenRequested
void fileOpenRequested(const KUrl &)
QAbstractItemModel
QVariant::isValid
bool isValid() const
projectwidget.h
ProjectModel::TranslatedCount
Definition: projectmodel.h:125
QTreeView::header
QHeaderView * header() const
ProjectModel::SourceDate
Definition: projectmodel.h:128
QVariant::toRect
QRect toRect() const
ProjectWidget::gotoNextTransOnly
void gotoNextTransOnly()
Definition: projectwidget.cpp:482
QTreeView::expand
void expand(const QModelIndex &index)
QAbstractItemView::model
QAbstractItemModel * model() const
QAbstractItemView::currentIndex
QModelIndex currentIndex() const
QAbstractItemView::clearSelection
void clearSelection()
ProjectModel::Graph
Definition: projectmodel.h:123
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QVariant::toString
QString toString() const
QPalette
ProjectWidget::gotoPrevFuzzyUntr
void gotoPrevFuzzyUntr()
Definition: projectwidget.cpp:473
ProjectModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: projectmodel.cpp:549
ProjectModel::itemForIndex
KFileItem itemForIndex(const QModelIndex &index) const
Definition: projectmodel.cpp:701
QVariant
QStyledItemDelegate
ProjectModel::UntranslatedCount
Definition: projectmodel.h:127
ProjectModel::TotalCount
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

KDE's Doxygen guidelines are available online.

lokalize

Skip menu "lokalize"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal