Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- Text based error messages since QTreeView gets very slow with multi-line messages and many entries.
- Create links for errors.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23862 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Dec 18, 2014
1 parent b0914b2 commit 68c71a0
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 689 deletions.
7 changes: 4 additions & 3 deletions OMEdit/OMEditGUI/MainWindow.cpp
Expand Up @@ -217,10 +217,11 @@ MainWindow::MainWindow(QSplashScreen *pSplashScreen, QWidget *parent)
if (mpOptionsDialog->getGeneralSettingsPage()->getPreserveUserCustomizations())
{
restoreGeometry(pSettings->value("application/geometry").toByteArray());
bool restoreMessagesWidget = false;
if (mpMessagesWidget->getMessagesModel()->getRootMessageItem()->children().size() > 0) restoreMessagesWidget = true;
bool restoreMessagesWidget = !mpMessagesWidget->getMessagesTextBrowser()->toPlainText().isEmpty();
restoreState(pSettings->value("application/windowState").toByteArray());
if (restoreMessagesWidget) mpMessagesDockWidget->show();
if (restoreMessagesWidget) {
mpMessagesDockWidget->show();
}
}
switchToWelcomePerspective();
// read last Open Directory location
Expand Down
10 changes: 3 additions & 7 deletions OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.cpp
Expand Up @@ -203,17 +203,13 @@ QSize ItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelInd
if (value.isValid())
return qvariant_cast<QSize>(value);
QSize size = QItemDelegate::sizeHint(option, index);
/* Only calculate the height of the item based on the text for MessagesTreeView items. Fix for multi line messages. Ticket #2269. */
if (mDrawRichText && parent() && (qobject_cast<MessagesTreeView*>(parent()) || qobject_cast<SimulationOutputTree*>(parent()))) {
MessagesTreeView *pMessagesTreeView = qobject_cast<MessagesTreeView*>(parent());
/* Only calculate the height of the item based on the text for SimulationOutputTree items. Fix for multi line messages. */
if (mDrawRichText && parent() && qobject_cast<SimulationOutputTree*>(parent())) {
SimulationOutputTree *pSimulationOutputTree = qobject_cast<SimulationOutputTree*>(parent());
int width;
if (pMessagesTreeView) {
width = pMessagesTreeView->columnWidth(index.column()) - (pMessagesTreeView->indentation() * pMessagesTreeView->getDepth(index));
} else if (pSimulationOutputTree) {
if (pSimulationOutputTree) {
width = pSimulationOutputTree->columnWidth(index.column()) - (pSimulationOutputTree->indentation() * pSimulationOutputTree->getDepth(index));
}

QVariant value = index.data(Qt::DisplayRole);
QString text;
if (value.isValid()) {
Expand Down

0 comments on commit 68c71a0

Please sign in to comment.