Skip to content

Commit

Permalink
- Use monospaced font as default for TextEditor.
Browse files Browse the repository at this point in the history
- Use TextEditor instead of QPlainText when showing generated files.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25361 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Apr 2, 2015
1 parent 82d0a19 commit eeb3c94
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
12 changes: 10 additions & 2 deletions OMEdit/OMEditGUI/Editors/TextEditor.cpp
Expand Up @@ -37,10 +37,18 @@

#include "TextEditor.h"

TextEditor::TextEditor(ModelWidget *pParent)
: BaseEditor(pParent)
TextEditor::TextEditor(ModelWidget *pModelWidget)
: BaseEditor(pModelWidget)
{
//! @todo for now set the font of TextEditor to default monospaced font. Later define settings for it and read from there.
setFont(QFont(Helper::monospacedFontInfo.family()));
}

TextEditor::TextEditor(MainWindow *pMainWindow)
: BaseEditor(pMainWindow)
{
//! @todo for now set the font of TextEditor to default monospaced font. Later define settings for it and read from there.
setFont(QFont(Helper::monospacedFontInfo.family()));
}

/*!
Expand Down
3 changes: 2 additions & 1 deletion OMEdit/OMEditGUI/Editors/TextEditor.h
Expand Up @@ -50,7 +50,8 @@ class TextEditor : public BaseEditor
{
Q_OBJECT
public:
TextEditor(ModelWidget *pParent);
TextEditor(ModelWidget *pModelWidget);
TextEditor(MainWindow *pMainWindow);
private slots:
virtual void showContextMenu(QPoint point);
public slots:
Expand Down
6 changes: 3 additions & 3 deletions OMEdit/OMEditGUI/Simulation/SimulationOutputWidget.cpp
Expand Up @@ -316,9 +316,9 @@ void SimulationOutputWidget::addGeneratedFileTab(QString fileName)
QFileInfo fileInfo(fileName);
if (file.exists()) {
file.open(QIODevice::ReadOnly);
QPlainTextEdit *pPlainTextEdit = new QPlainTextEdit(QString(file.readAll()));
pPlainTextEdit->setFont(QFont(Helper::monospacedFontInfo.family()));
mpGeneratedFilesTabWidget->addTab(pPlainTextEdit, fileInfo.fileName());
TextEditor *pTextEditor = new TextEditor(mpMainWindow);
pTextEditor->setPlainText(QString(file.readAll()));
mpGeneratedFilesTabWidget->addTab(pTextEditor, fileInfo.fileName());
file.close();
}
}
Expand Down

0 comments on commit eeb3c94

Please sign in to comment.