43 this->setVerticalScrollMode(ScrollMode::ScrollPerPixel);
45 setObjectName(QString::fromUtf8(
"tableLog"));
46 QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Expanding);
47 sizePolicy2.setHorizontalStretch(10);
48 sizePolicy2.setVerticalStretch(10);
49 sizePolicy2.setHeightForWidth(sizePolicy().hasHeightForWidth());
50 setSizePolicy(sizePolicy2);
51 setSizeIncrement(QSize(1, 0));
52 setEditTriggers(QAbstractItemView::DoubleClicked);
53 setAlternatingRowColors(
true);
55 setGridStyle(Qt::SolidLine);
56 setSortingEnabled(
false);
58 setCornerButtonEnabled(
true);
60 setSelectionMode(QAbstractItemView::SingleSelection);
61 setSelectionBehavior(QAbstractItemView::SelectRows);
63 horizontalHeader()->setVisible(
true);
64 horizontalHeader()->setCascadingSectionResizes(
true);
65 horizontalHeader()->setDefaultSectionSize(100);
66 horizontalHeader()->setMinimumSectionSize(20);
67 horizontalHeader()->setStretchLastSection(
true);
68 verticalHeader()->setVisible(
false);
69 verticalHeader()->setDefaultSectionSize(20);
75 setColumnWidth(0, 90);
76 setColumnWidth(1, 90);
77 setColumnWidth(2, 90);
78 setColumnWidth(3, 60);
79 setColumnWidth(4, 700);
80 setColumnWidth(5, 150);
81 setColumnWidth(6, 200);
92 QAbstractItemModel* absmodel = qobject_cast<QAbstractItemModel*>(model());
94 SIGNAL(rowsAboutToBeInserted(QModelIndex,
int,
int)),
98 this, SIGNAL(doubleClicked(QModelIndex)),
this, SLOT(
doubleClickOnCell(QModelIndex)));
100 setContextMenuPolicy(Qt::CustomContextMenu);
102 SIGNAL(customContextMenuRequested(QPoint)),
106 SIGNAL(dataChanged(QModelIndex, QModelIndex)),
109 connect(verticalScrollBar(), SIGNAL(valueChanged(
int)),
this, SLOT(
checkAutoScroll()));
180 int rowCount = model()->rowCount();
182 for (
int i = startRow; i < rowCount; i++)
186 setRowHidden(i,
true);
190 qApp->processEvents();
209 int rowCount = model()->rowCount();
211 for (
int i = startRow; i < rowCount; i++)
217 setRowHidden(i,
false);
222 setRowHidden(i,
true);
226 qApp->processEvents();
400 int checkCounter = 0;
401 int tempSelectedSearchIndex = indexAt(QPoint(10, 10)).row();
403 if (selectedIndexes().size() > 0)
405 tempSelectedSearchIndex = selectedIndexes()[0].row();
408 int oldSelectedSearchIndex = tempSelectedSearchIndex;
413 if ((tempSelectedSearchIndex != oldSelectedSearchIndex || keepSelectionIfPossible) &&
414 getModel()->rowContainsString(tempSelectedSearchIndex,
417 selectRow(tempSelectedSearchIndex);
423 tempSelectedSearchIndex--;
427 tempSelectedSearchIndex++;
430 if (tempSelectedSearchIndex >= model()->rowCount())
432 tempSelectedSearchIndex = 0;
435 if (tempSelectedSearchIndex < 0)
437 tempSelectedSearchIndex = model()->rowCount() - 1;
443 if (checkCounter > model()->rowCount())
447 }
while (tempSelectedSearchIndex != oldSelectedSearchIndex);
460 std::string fileWithLineNumber = model()->data(
index).toString().toStdString();
461 const auto colonPos = fileWithLineNumber.rfind(
':');
462 if (colonPos == std::string::npos)
467 std::string file = fileWithLineNumber.substr(0, colonPos);
468 std::string line = fileWithLineNumber.substr(colonPos + 1);
470 if (!std::filesystem::exists(file))
472 ARMARX_INFO <<
"File '" << file <<
"' does not exists - cannot open it.";
476 fileOpener.openFileWithDefaultEditor(file, atoi(line.c_str()));