Seamly2D
Code documentation
dialogmdatabase.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * *
3  * Copyright (C) 2017 Seamly, LLC *
4  * *
5  * https://github.com/fashionfreedom/seamly2d *
6  * *
7  ***************************************************************************
8  **
9  ** Seamly2D is free software: you can redistribute it and/or modify
10  ** it under the terms of the GNU General Public License as published by
11  ** the Free Software Foundation, either version 3 of the License, or
12  ** (at your option) any later version.
13  **
14  ** Seamly2D 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 Seamly2D. If not, see <http://www.gnu.org/licenses/>.
21  **
22  **************************************************************************
23 
24  ************************************************************************
25  **
26  ** @file dialogmdatabase.cpp
27  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
28  ** @date 26 7, 2015
29  **
30  ** @brief
31  ** @copyright
32  ** This source code is part of the Valentine project, a pattern making
33  ** program, whose allow create and modeling patterns of clothing.
34  ** Copyright (C) 2015 Seamly2D project
35  ** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
36  **
37  ** Seamly2D is free software: you can redistribute it and/or modify
38  ** it under the terms of the GNU General Public License as published by
39  ** the Free Software Foundation, either version 3 of the License, or
40  ** (at your option) any later version.
41  **
42  ** Seamly2D is distributed in the hope that it will be useful,
43  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
44  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45  ** GNU General Public License for more details.
46  **
47  ** You should have received a copy of the GNU General Public License
48  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
49  **
50  *************************************************************************/
51 
52 #include "dialogmdatabase.h"
53 #include "ui_dialogmdatabase.h"
54 #include "../mapplication.h"
55 #include "../vpatterndb/measurements.h"
56 
57 #include <QKeyEvent>
58 #include <QMenu>
59 #include <QSvgRenderer>
60 #include <QtSvg>
61 
62 //---------------------------------------------------------------------------------------------------------------------
63 MeasurementDatabaseDialog::MeasurementDatabaseDialog(const QStringList &list, QWidget *parent)
64  : QDialog(parent)
65  , ui(new Ui::DialogMDataBase)
66  , selectMode(true)
67  , measurements(list)
68  , newMeasurements()
69  , groupA(nullptr)
70  , groupB(nullptr)
71  , groupC(nullptr)
72  , groupD(nullptr)
73  , groupE(nullptr)
74  , groupF(nullptr)
75  , groupG(nullptr)
76  , groupH(nullptr)
77  , groupI(nullptr)
78  , groupJ(nullptr)
79  , groupK(nullptr)
80  , groupL(nullptr)
81  , groupM(nullptr)
82  , groupN(nullptr)
83  , groupO(nullptr)
84  , groupP(nullptr)
85  , groupQ(nullptr)
86 {
87  ui->setupUi(this);
88  setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
89 
90 #if defined(Q_OS_MAC)
91  setWindowFlags(Qt::Window);
92 #endif
93 
94  initDataBase();
95 
96  ui->treeWidget->installEventFilter(this);
97 
98  connect(ui->lineEditFind, &QLineEdit::textChanged, this, &MeasurementDatabaseDialog::filterGroups);
99  connect(ui->treeWidget, &QTreeWidget::itemChanged, this, &MeasurementDatabaseDialog::updateChecks);
100  connect(ui->treeWidget, &QTreeWidget::itemClicked, this, &MeasurementDatabaseDialog::showDescription);
101  connect(ui->treeWidget, &QTreeWidget::customContextMenuRequested, this, &MeasurementDatabaseDialog::treeContextMenu);
102 
103  readSettings();
104 }
105 
106 //---------------------------------------------------------------------------------------------------------------------
108  : QDialog(parent)
109  , ui(new Ui::DialogMDataBase)
110  , selectMode(false)
111  , measurements()
112  , newMeasurements()
113  , groupA(nullptr)
114  , groupB(nullptr)
115  , groupC(nullptr)
116  , groupD(nullptr)
117  , groupE(nullptr)
118  , groupF(nullptr)
119  , groupG(nullptr)
120  , groupH(nullptr)
121  , groupI(nullptr)
122  , groupJ(nullptr)
123  , groupK(nullptr)
124  , groupL(nullptr)
125  , groupM(nullptr)
126  , groupN(nullptr)
127  , groupO(nullptr)
128  , groupP(nullptr)
129  , groupQ(nullptr)
130 {
131  ui->setupUi(this);
132  setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
133 
134 #if defined(Q_OS_MAC)
135  setWindowFlags(Qt::Window);
136 #endif
137 
138  initDataBase();
139 
140  ui->treeWidget->installEventFilter(this);
141 
142  connect(ui->lineEditFind, &QLineEdit::textChanged, this, &MeasurementDatabaseDialog::filterGroups);
143  connect(ui->treeWidget, &QTreeWidget::itemClicked, this, &MeasurementDatabaseDialog::showDescription);
144  connect(ui->treeWidget, &QTreeWidget::customContextMenuRequested, this, &MeasurementDatabaseDialog::treeContextMenu);
145  connect(ui->treeWidget, &QTreeWidget::itemActivated, this, &MeasurementDatabaseDialog::showDescription);
146 
147  readSettings();
148 }
149 
150 //---------------------------------------------------------------------------------------------------------------------
152 {
153  writeSettings();
154  delete ui;
155 }
156 
157 //---------------------------------------------------------------------------------------------------------------------
159 {
160  return newMeasurements;
161 }
162 
163 //---------------------------------------------------------------------------------------------------------------------
165 {
183 
184  showDescription(ui->treeWidget->currentItem(), 0);
185 }
186 
187 //---------------------------------------------------------------------------------------------------------------------
188 QString MeasurementDatabaseDialog::imageUrl(const QString &number)
189 {
190  QString imgUrl("<img src=\"wrong.png\" align=\"center\"/>"); // In case of error
191  const QString filePath = QString("://diagrams/%1.svg").arg(MapDiagrams(qApp->TrVars(), number));
192  if (QFileInfo::exists(filePath))
193  {
194  // Load your SVG
195  QSvgRenderer renderer;
196  const bool ok = renderer.load(filePath);
197  if (ok)
198  {
199  const QScreen *screen = QGuiApplication::screens().at(0);
200  if (screen)
201  {
202  const QSize defSize = renderer.defaultSize();
203 
204  // Prepare a QImage with desired characteritisc
205  QImage image(defSize, QImage::Format_RGB32);
206  image.fill(Qt::white);
207 
208  const QRect geometry = screen->geometry();
209  const int baseHeight = 1440;
210  const int imgHeight = geometry.height() * defSize.height() / baseHeight;
211 
212  QImage scaledImg = image.scaledToHeight(imgHeight);
213 
214  // Get QPainter that paints to the image
215  QPainter painter(&scaledImg);
216  renderer.render(&painter);
217 
218  QByteArray byteArray;
219  QBuffer buffer(&byteArray);
220  scaledImg.save(&buffer, "PNG");
221  imgUrl = QString("<img src=\"data:image/png;base64,") + byteArray.toBase64() + "\" align=\"center\"/>";
222  }
223  }
224  }
225 
226  return imgUrl;
227 }
228 
229 //---------------------------------------------------------------------------------------------------------------------
231 {
232  if (event->type() == QEvent::LanguageChange)
233  {
234  // retranslate designer form (single inheritance approach)
235  ui->retranslateUi(this);
236  }
237 
238  // remember to call base class implementation
239  QDialog::changeEvent(event);
240 }
241 
242 //---------------------------------------------------------------------------------------------------------------------
243 bool MeasurementDatabaseDialog::eventFilter(QObject *target, QEvent *event)
244 {
245  if (target == ui->treeWidget && event->type() == QEvent::KeyPress)
246  {
247  QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
248  switch(keyEvent->key())
249  {
250  case Qt::Key_Up:
251  {
252  const QModelIndex model = ui->treeWidget->indexAbove(ui->treeWidget->currentIndex());
253  QTreeWidgetItem *item = ui->treeWidget->itemAbove(ui->treeWidget->currentItem());
254  showDescription(item, model.column());
255  break;
256  }
257  case Qt::Key_Down:
258  {
259  const QModelIndex model = ui->treeWidget->indexBelow(ui->treeWidget->currentIndex());
260  QTreeWidgetItem *item = ui->treeWidget->itemBelow(ui->treeWidget->currentItem());
261  showDescription(item, model.column());
262  break;
263  }
264  default:
265  break;
266  }
267  }
268  return QDialog::eventFilter(target, event);
269 }
270 
271 //---------------------------------------------------------------------------------------------------------------------
272 void MeasurementDatabaseDialog::updateChecks(QTreeWidgetItem *item, int column)
273 {
274  bool diff = false;
275  if (column != 0 && column != -1)
276  {
277  return;
278  }
279 
280  if (item->childCount() != 0 && item->checkState(0) != Qt::PartiallyChecked && column != -1)
281  {
282  bool flag = false; // Check if we could change atleast one children
283  Qt::CheckState state = item->checkState(0);
284  for (int i = 0; i < item->childCount(); ++i)
285  {
286  if (!measurements.contains(item->child(i)->data(0, Qt::UserRole).toString()))
287  {
288  item->child(i)->setCheckState(0, state);
289  flag = true;
290  }
291 
292  if (flag == false) // All child in the list
293  {
294  item->setCheckState(0, Qt::Checked);
295  }
296  }
297  }
298  else if (item->childCount() == 0 || column == -1)
299  {
300 
301  QString itemName = item->data(0, Qt::UserRole).toString();
302  Qt::CheckState state = item->checkState(0);
303 
304  if (state == Qt::CheckState::Unchecked)
305  {
306  newMeasurements.removeOne(itemName);
307  }
308  else if (state == Qt::CheckState::Checked &&
309  !measurements.contains(itemName) &&
310  !newMeasurements.contains(itemName) &&
311  !itemName.isEmpty())
312  {
313  newMeasurements.append(itemName);
314  }
315 
316  QTreeWidgetItem *parent = item->parent();
317  if (parent == nullptr)
318  {
319  return;
320  }
321  for (int j = 0; j < parent->childCount(); ++j)
322  {
323  if (j != parent->indexOfChild(item)
324  && item->checkState(0) != parent->child(j)->checkState(0))
325  {
326  diff = true;
327  }
328  }
329  if (diff)
330  {
331  parent->setCheckState(0, Qt::PartiallyChecked);
332  }
333  else
334  {
335  parent->setCheckState(0, item->checkState(0));
336  }
337 
338  updateChecks(parent, -1);
339  }
340 }
341 
342 //---------------------------------------------------------------------------------------------------------------------
343 void MeasurementDatabaseDialog::showDescription(QTreeWidgetItem *item, int column)
344 {
345  if ((column != 0 && column != -1) || item == nullptr || (item->childCount() != 0 ))
346  {
347  ui->textEdit->clear();
348  return;
349  }
350 
351  const QString name = item->data(0, Qt::UserRole).toString();
352  const VTranslateVars *trv = qApp->TrVars();
353  const QString number = trv->MNumber(name);
354 
355  const QString text = QString("<p align=\"center\" style=\"font-variant: normal; font-style: normal; font-weight: "
356  "normal\"> %1 <br clear=\"left\"><b>%2</b>. <i>%3</i></p>"
357  "<p align=\"left\" style=\"font-variant: normal; font-style: normal; font-weight: "
358  "normal\">%4</p>")
359  .arg(imageUrl(number))
360  .arg(number)
361  .arg(trv->guiText(name))
362  .arg(trv->Description(name));
363 
364  ui->textEdit->setHtml(text);
365 }
366 
367 //---------------------------------------------------------------------------------------------------------------------
369 {
370  // Because item also will be selected need to show description
371  const QModelIndex model = ui->treeWidget->currentIndex();
372  QTreeWidgetItem *item = ui->treeWidget->currentItem();
373  showDescription(item, model.column());
374 
375  QAction *actionCollapseAll = new QAction(tr("Collapse All"), this);
376  connect(actionCollapseAll, &QAction::triggered, ui->treeWidget, &QTreeWidget::collapseAll);
377 
378  QAction *actionExpandeAll = new QAction(tr("Expand All"), this);
379  connect(actionExpandeAll, &QAction::triggered, ui->treeWidget, &QTreeWidget::expandAll);
380 
381  QMenu menu(this);
382  menu.addAction(actionCollapseAll);
383  menu.addAction(actionExpandeAll);
384 
385  if (selectMode)
386  {
387  QString actionName;
388  globalCheckState() == Qt::Checked ? actionName = tr("Check all") : actionName = tr("Uncheck all");
389 
390  QAction *actionRecheckState = new QAction(actionName, this);
391  connect(actionRecheckState, &QAction::triggered, this, &MeasurementDatabaseDialog::recheckState);
392 
393  menu.addAction(actionRecheckState);
394  }
395  menu.exec(ui->treeWidget->mapToGlobal(pos));
396 }
397 
398 //---------------------------------------------------------------------------------------------------------------------
400 {
401  if (selectMode)
402  {
403  const Qt::CheckState check = globalCheckState();
404 
405  changeCheckState(groupA, check);
406  changeCheckState(groupB, check);
407  changeCheckState(groupC, check);
408  changeCheckState(groupD, check);
409  changeCheckState(groupE, check);
410  changeCheckState(groupF, check);
411  changeCheckState(groupG, check);
412  changeCheckState(groupH, check);
413  changeCheckState(groupI, check);
414  changeCheckState(groupJ, check);
415  changeCheckState(groupK, check);
416  changeCheckState(groupL, check);
417  changeCheckState(groupM, check);
418  changeCheckState(groupN, check);
419  changeCheckState(groupO, check);
420  changeCheckState(groupP, check);
421  changeCheckState(groupQ, check);
422  }
423 }
424 
425 //---------------------------------------------------------------------------------------------------------------------
426 void MeasurementDatabaseDialog::initDataBase(const QStringList &list)
427 {
445 }
446 
447 //---------------------------------------------------------------------------------------------------------------------
448 void MeasurementDatabaseDialog::initGroup(QTreeWidgetItem **group, const QString &groupName,
449  const QStringList &groupList, const QStringList &measurementList)
450 {
451  *group = addMeasurementGroup(groupName);
452  for (int i=0; i < groupList.size(); ++i)
453  {
454  addMeasurement(*group, groupList.at(i), measurementList);
455  }
456 }
457 
458 //---------------------------------------------------------------------------------------------------------------------
459 QTreeWidgetItem *MeasurementDatabaseDialog::addMeasurementGroup(const QString &groupName)
460 {
461  QTreeWidgetItem *group = new QTreeWidgetItem(ui->treeWidget);
462  group->setText(0, groupName);
463  group->setToolTip(0, groupName);
464  group->setExpanded(true);
465  if (selectMode)
466  {
467  group->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
468  group->setCheckState(0, Qt::Unchecked);
469  group->setBackground(0, QBrush(Qt::lightGray));
470  }
471  return group;
472 }
473 
474 //---------------------------------------------------------------------------------------------------------------------
475 void MeasurementDatabaseDialog::addMeasurement(QTreeWidgetItem *group, const QString &name, const QStringList &list)
476 {
477  SCASSERT(group != nullptr)
478 
479  QTreeWidgetItem *item = new QTreeWidgetItem(group);
480 
481  if (selectMode)
482  {
483  if (measurements.contains(name))
484  {
485  item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
486  item->setCheckState(0, Qt::Checked);
487  item->setBackground(0, QBrush(QColor(231, 231, 0, 127)));
488  }
489  else if (list.contains(name))
490  {
491  item->setCheckState(0, Qt::Checked);
492  }
493  else
494  {
495  item->setCheckState(0, Qt::Unchecked);
496  }
497 
498  updateChecks(item, 0);
499  }
500 
501  const QString text = qApp->TrVars()->MNumber(name) + ". " + qApp->TrVars()->MToUser(name);
502  item->setText(0, text);
503  item->setToolTip(0, text);
504  item->setData(0, Qt::UserRole, name);
505 }
506 
507 //---------------------------------------------------------------------------------------------------------------------
509 {
510  restoreGeometry(qApp->SeamlyMeSettings()->getDataBaseGeometry());
511 }
512 
513 //---------------------------------------------------------------------------------------------------------------------
515 {
516  qApp->SeamlyMeSettings()->setDataBaseGeometry(saveGeometry());
517 }
518 
519 //---------------------------------------------------------------------------------------------------------------------
520 void MeasurementDatabaseDialog::filterGroups(const QString searchString)
521 {
522  filterGroup(groupA, searchString);
523  filterGroup(groupB, searchString);
524  filterGroup(groupC, searchString);
525  filterGroup(groupD, searchString);
526  filterGroup(groupE, searchString);
527  filterGroup(groupF, searchString);
528  filterGroup(groupG, searchString);
529  filterGroup(groupH, searchString);
530  filterGroup(groupI, searchString);
531  filterGroup(groupJ, searchString);
532  filterGroup(groupK, searchString);
533  filterGroup(groupL, searchString);
534  filterGroup(groupM, searchString);
535  filterGroup(groupN, searchString);
536  filterGroup(groupO, searchString);
537  filterGroup(groupP, searchString);
538  filterGroup(groupQ, searchString);
539 
540  const QList<QTreeWidgetItem *> selected = ui->treeWidget->selectedItems();
541  selected.isEmpty() ? showDescription(nullptr, -1) : showDescription(selected.first(), 0);
542 }
543 
544 void MeasurementDatabaseDialog::filterGroup(QTreeWidgetItem *group, const QString &searchString)
545 {
546  SCASSERT(group != nullptr)
547 
548  bool isMatch = false;
549  for (int i=0; i < group->childCount(); ++i)
550  {
551  QTreeWidgetItem *item = group->child(i);
552  //const QString description = QTextDocumentFragment::fromHtml(ItemFullDescription(item, false))
553  // .toPlainText();
554 
555  //const bool isHidden = !item->text(0).contains(searchString, Qt::CaseInsensitive)
556  // && !description.contains(searchString, Qt::CaseInsensitive);
557 
558  const bool isHidden = !item->text(0).contains(searchString, Qt::CaseInsensitive);
559 
560  item->setHidden(isHidden);
561  if (!isHidden)
562  {
563  isMatch = true;
564  }
565  }
566 
567  group->setHidden(!group->text(0).contains(searchString, Qt::CaseInsensitive) && !isMatch);
568 }
569 
570 //---------------------------------------------------------------------------------------------------------------------
571 void MeasurementDatabaseDialog::retranslateGroup(QTreeWidgetItem *group, const QString &groupName,
572  const QStringList &list)
573 {
574  group->setText(0, groupName);
575  group->setToolTip(0, groupName);
576 
577  for (int i=0; i<list.size(); ++i)
578  {
579  retranslateMeasurement(group, i, list.at(i));
580  }
581 }
582 
583 //---------------------------------------------------------------------------------------------------------------------
584 void MeasurementDatabaseDialog::retranslateMeasurement(QTreeWidgetItem *group, int index, const QString &name)
585 {
586  const QString text = qApp->TrVars()->MNumber(name) + ". " + qApp->TrVars()->MToUser(name);
587 
588  QTreeWidgetItem *item = group->child(index);
589  item->setText(0, text);
590  item->setToolTip(0, text);
591 }
592 
593 //---------------------------------------------------------------------------------------------------------------------
594 void MeasurementDatabaseDialog::changeCheckState(QTreeWidgetItem *group, Qt::CheckState state)
595 {
596  SCASSERT(group != nullptr)
597  group->setCheckState(0, state);
598 }
599 
600 //---------------------------------------------------------------------------------------------------------------------
602 {
603  SCASSERT(groupA != nullptr)
604  SCASSERT(groupB != nullptr)
605  SCASSERT(groupC != nullptr)
606  SCASSERT(groupD != nullptr)
607  SCASSERT(groupE != nullptr)
608  SCASSERT(groupF != nullptr)
609  SCASSERT(groupG != nullptr)
610  SCASSERT(groupH != nullptr)
611  SCASSERT(groupI != nullptr)
612  SCASSERT(groupJ != nullptr)
613  SCASSERT(groupK != nullptr)
614  SCASSERT(groupL != nullptr)
615  SCASSERT(groupM != nullptr)
616  SCASSERT(groupN != nullptr)
617  SCASSERT(groupO != nullptr)
618  SCASSERT(groupP != nullptr)
619  SCASSERT(groupQ != nullptr)
620 
621  if (selectMode)
622  {
623  if (groupA->checkState(0) == Qt::Unchecked &&
624  groupB->checkState(0) == Qt::Unchecked &&
625  groupC->checkState(0) == Qt::Unchecked &&
626  groupD->checkState(0) == Qt::Unchecked &&
627  groupE->checkState(0) == Qt::Unchecked &&
628  groupF->checkState(0) == Qt::Unchecked &&
629  groupG->checkState(0) == Qt::Unchecked &&
630  groupH->checkState(0) == Qt::Unchecked &&
631  groupI->checkState(0) == Qt::Unchecked &&
632  groupJ->checkState(0) == Qt::Unchecked &&
633  groupK->checkState(0) == Qt::Unchecked &&
634  groupL->checkState(0) == Qt::Unchecked &&
635  groupM->checkState(0) == Qt::Unchecked &&
636  groupN->checkState(0) == Qt::Unchecked &&
637  groupO->checkState(0) == Qt::Unchecked &&
638  groupP->checkState(0) == Qt::Unchecked &&
639  groupQ->checkState(0) == Qt::Unchecked)
640  {
641  return Qt::Checked;
642  }
643  else if (groupA->checkState(0) == Qt::Checked &&
644  groupB->checkState(0) == Qt::Checked &&
645  groupC->checkState(0) == Qt::Checked &&
646  groupD->checkState(0) == Qt::Checked &&
647  groupE->checkState(0) == Qt::Checked &&
648  groupF->checkState(0) == Qt::Checked &&
649  groupG->checkState(0) == Qt::Checked &&
650  groupH->checkState(0) == Qt::Checked &&
651  groupI->checkState(0) == Qt::Checked &&
652  groupJ->checkState(0) == Qt::Checked &&
653  groupK->checkState(0) == Qt::Checked &&
654  groupL->checkState(0) == Qt::Checked &&
655  groupM->checkState(0) == Qt::Checked &&
656  groupN->checkState(0) == Qt::Checked &&
657  groupO->checkState(0) == Qt::Checked &&
658  groupP->checkState(0) == Qt::Checked &&
659  groupQ->checkState(0) == Qt::Checked)
660  {
661  return Qt::Unchecked;
662  }
663  return Qt::Checked;
664  }
665 
666  return Qt::Unchecked;
667 }
void addMeasurement(QTreeWidgetItem *group, const QString &groupName, const QStringList &newMeasurements)
QTreeWidgetItem * groupB
void filterGroup(QTreeWidgetItem *group, const QString &searchString)
QTreeWidgetItem * groupH
QTreeWidgetItem * groupP
void updateChecks(QTreeWidgetItem *item, int column)
QTreeWidgetItem * groupM
QStringList getNewMeasurementNames() const
QTreeWidgetItem * groupE
void initDataBase(const QStringList &measurements=QStringList())
virtual bool eventFilter(QObject *target, QEvent *event) Q_DECL_OVERRIDE
Qt::CheckState globalCheckState() const
Q_REQUIRED_RESULT QTreeWidgetItem * addMeasurementGroup(const QString &text)
Ui::DialogMDataBase * ui
QTreeWidgetItem * groupD
QTreeWidgetItem * groupL
QTreeWidgetItem * groupC
QTreeWidgetItem * groupQ
QTreeWidgetItem * groupN
void changeCheckState(QTreeWidgetItem *group, Qt::CheckState state)
MeasurementDatabaseDialog(const QStringList &measurements, QWidget *parent=nullptr)
QTreeWidgetItem * groupJ
void treeContextMenu(const QPoint &pos)
QTreeWidgetItem * groupI
QTreeWidgetItem * groupG
QTreeWidgetItem * groupF
void retranslateMeasurement(QTreeWidgetItem *group, int index, const QString &name)
void retranslateGroup(QTreeWidgetItem *group, const QString &groupName, const QStringList &measurements)
virtual void changeEvent(QEvent *event) Q_DECL_OVERRIDE
virtual ~MeasurementDatabaseDialog() Q_DECL_OVERRIDE
QTreeWidgetItem * groupA
QTreeWidgetItem * groupO
void showDescription(QTreeWidgetItem *item, int column)
void filterGroups(const QString searchString)
void initGroup(QTreeWidgetItem **group, const QString &groupName, const QStringList &groupList, const QStringList &measurementList=QStringList())
QTreeWidgetItem * groupK
static QString imageUrl(const QString &number)
QString guiText(const QString &measurement) const
QString MNumber(const QString &measurement) const
QString Description(const QString &measurement) const
#define SCASSERT(cond)
Definition: def.h:317
QStringList ListGroupP()
QStringList ListGroupN()
QString MapDiagrams(const VTranslateMeasurements *trM, const QString &number)
QStringList ListGroupI()
QStringList ListGroupL()
QStringList ListGroupG()
QStringList ListGroupK()
QStringList ListGroupD()
QStringList ListGroupM()
QStringList ListGroupH()
QStringList ListGroupC()
QStringList ListGroupF()
QStringList ListGroupO()
QStringList ListGroupA()
QStringList ListGroupJ()
QStringList ListGroupE()
QStringList ListGroupQ()
QStringList ListGroupB()
#define qApp
Definition: vapplication.h:67