Skip to content

Commit

Permalink
Fixed the view grid lines.
Browse files Browse the repository at this point in the history
Fixed some warnings.
  • Loading branch information
adeas31 committed Apr 6, 2016
1 parent 25e182c commit 3c28781
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 24 deletions.
7 changes: 7 additions & 0 deletions OMEdit/OMEditGUI/Editors/CEditor.cpp
Expand Up @@ -58,6 +58,13 @@ void CEditor::showContextMenu(QPoint point)
delete pMenu;
}

void CEditor::contentsHasChanged(int position, int charsRemoved, int charsAdded)
{
Q_UNUSED(position);
Q_UNUSED(charsRemoved);
Q_UNUSED(charsAdded);
}

/*!
* \class CHighlighter
* \brief A syntax highlighter for CEditor.
Expand Down
2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/Editors/CEditor.h
Expand Up @@ -49,7 +49,7 @@ class CEditor : public BaseEditor
private slots:
virtual void showContextMenu(QPoint point);
public slots:
virtual void contentsHasChanged(int position, int charsRemoved, int charsAdded) {}
virtual void contentsHasChanged(int position, int charsRemoved, int charsAdded);
virtual void toggleCommentSelection() {}
};

Expand Down
9 changes: 5 additions & 4 deletions OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.cpp
Expand Up @@ -204,11 +204,12 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,

void ItemDelegate::drawHover(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
if (option.state & QStyle::State_MouseOver)
{
Q_UNUSED(index);
if (option.state & QStyle::State_MouseOver) {
QPalette::ColorGroup cg = option.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled;
if (cg == QPalette::Normal && !(option.state & QStyle::State_Active))
if (cg == QPalette::Normal && !(option.state & QStyle::State_Active)) {
cg = QPalette::Inactive;
}
painter->fillRect(option.rect, option.palette.brush(cg, QPalette::Highlight));
}
}
Expand Down Expand Up @@ -1755,7 +1756,7 @@ bool LibraryTreeModel::unloadLibraryTreeItem(LibraryTreeItem *pLibraryTreeItem,
*/
int row = pLibraryTreeItem->row();
LibraryTreeItem *pNextLibraryTreeItem = 0;
bool expandState;
bool expandState = false;
if (pLibraryTreeItem->parent()->getChildren().size() > row + 1) {
pNextLibraryTreeItem = pLibraryTreeItem->parent()->child(row + 1);
QModelIndex modelIndex = libraryTreeItemIndex(pNextLibraryTreeItem);
Expand Down
20 changes: 11 additions & 9 deletions OMEdit/OMEditGUI/Modeling/ModelWidgetContainer.cpp
Expand Up @@ -1484,7 +1484,10 @@ void GraphicsView::drawBackground(QPainter *painter, const QRectF &rect)
return;
}
// draw scene rectangle white background
painter->setPen(Qt::NoPen);
QPen pen;
pen.setWidth(0);
pen.setStyle(Qt::SolidLine);
painter->setPen(pen);
if (mViewType == StringHandler::Icon) {
painter->setBrush(QBrush(QColor(229, 244, 255), Qt::SolidPattern));
} else {
Expand All @@ -1495,7 +1498,8 @@ void GraphicsView::drawBackground(QPainter *painter, const QRectF &rect)
painter->drawRect(getExtentRectangle());
if (mpModelWidget->getModelWidgetContainer()->isShowGridLines()) {
painter->setBrush(Qt::NoBrush);
painter->setPen(QColor(229, 229, 229));
pen.setColor(QColor(229, 229, 229));
painter->setPen(pen);
/* Draw left half vertical lines */
int horizontalGridStep = mCoOrdinateSystem.getHorizontalGridStep() * 10;
qreal xAxisStep = 0;
Expand Down Expand Up @@ -1527,12 +1531,14 @@ void GraphicsView::drawBackground(QPainter *painter, const QRectF &rect)
yAxisStep -= verticalGridStep;
}
/* set the middle horizontal and vertical line gray */
painter->setPen(QColor(192, 192, 192));
pen.setColor(QColor(192, 192, 192));
painter->setPen(pen);
painter->drawLine(QPointF(rect.left(), 0), QPointF(rect.right(), 0));
painter->drawLine(QPointF(0, rect.top()), QPointF(0, rect.bottom()));
}
// draw scene rectangle
painter->setPen(QColor(192, 192, 192));
pen.setColor(QColor(192, 192, 192));
painter->setPen(pen);
painter->drawRect(getExtentRectangle());
}

Expand Down Expand Up @@ -4234,7 +4240,7 @@ bool ModelWidgetContainer::openRecentModelWidget(QListWidgetItem *pListWidgetIte
*/
void ModelWidgetContainer::currentModelWidgetChanged(QMdiSubWindow *pSubWindow)
{
bool enabled, modelica, text, metaModel;
bool enabled, modelica, metaModel;
ModelWidget *pModelWidget;
LibraryTreeItem *pLibraryTreeItem;
if (pSubWindow) {
Expand All @@ -4243,21 +4249,17 @@ void ModelWidgetContainer::currentModelWidgetChanged(QMdiSubWindow *pSubWindow)
pLibraryTreeItem = pModelWidget->getLibraryTreeItem();
if (pLibraryTreeItem->getLibraryType() == LibraryTreeItem::Modelica) {
modelica = true;
text = false;
metaModel = false;
} else if (pLibraryTreeItem->getLibraryType() == LibraryTreeItem::Text) {
modelica = false;
text = true;
metaModel = false;
} else {
modelica = false;
text = false;
metaModel = true;
}
} else {
enabled = false;
modelica = false;
text = false;
metaModel = false;
pModelWidget = 0;
pLibraryTreeItem = 0;
Expand Down
16 changes: 6 additions & 10 deletions OMEdit/OMEditGUI/OMEditGUI.pro
Expand Up @@ -30,7 +30,7 @@

QT += network core gui webkit xml xmlpatterns svg
greaterThan(QT_MAJOR_VERSION, 4) {
QT *= printsupport widgets webkitwidgets
QT += printsupport widgets webkitwidgets
}

TRANSLATIONS = Resources/nls/OMEdit_de.ts \
Expand Down Expand Up @@ -66,15 +66,11 @@ win32 {
QMAKE_LFLAGS_RELEASE =
# required for backtrace
# win32 vs. win64
UNAME = $$system(uname)
isEmpty(UNAME): UNAME = MINGW32
ISMINGW32 = $$find(UNAME, MINGW32)
message(uname: $$UNAME)
count( ISMINGW32, 1 ) {
LIBS += -L$$(OMDEV)/tools/msys/mingw32/bin -L$$(OMDEV)/tools/msys/mingw32/lib -L$$(OMDEV)/tools/msys/mingw32/lib/binutils -limagehlp -lbfd -lintl -liberty
} else {
LIBS += -L$$(OMDEV)/tools/msys/mingw64/bin -L$$(OMDEV)/tools/msys/mingw64/lib -L$$(OMDEV)/tools/msys/mingw64/lib/binutils -limagehlp -lbfd -lintl -liberty
}
contains(QT_ARCH, i386) { # 32-bit
LIBS += -L$$(OMDEV)/tools/msys/mingw32/lib/binutils -L$$(OMDEV)/tools/msys/mingw32/bin -limagehlp -lbfd -lintl -liberty
} else { # 64-bit
LIBS += -L$$(OMDEV)/tools/msys/mingw64/lib/binutils -L$$(OMDEV)/tools/msys/mingw64/bin -limagehlp -lbfd -lintl -liberty
}
}
LIBS += -L../OMEditGUI/Debugger/Parser -lGDBMIParser \
-L$$(OMBUILDDIR)/lib/omc -lomantlr3 -lOMPlot -lomqwt \
Expand Down
4 changes: 4 additions & 0 deletions OMEdit/OMEditGUI/TransformationalDebugger/OMDumpXML.cpp
Expand Up @@ -317,6 +317,8 @@ bool MyHandler::characters( const QString & ch )

bool MyHandler::startElement( const QString & namespaceURI, const QString & localName, const QString & qName, const QXmlAttributes & atts)
{
Q_UNUSED(namespaceURI);
Q_UNUSED(localName);
if (qName == "variable") {
currentVariable.name = atts.value("name");
currentVariable.comment = atts.value("comment");
Expand Down Expand Up @@ -366,6 +368,8 @@ bool MyHandler::startElement( const QString & namespaceURI, const QString & loca

bool MyHandler::endElement( const QString & namespaceURI, const QString & localName, const QString & qName)
{
Q_UNUSED(namespaceURI);
Q_UNUSED(localName);
if (qName == "type") {
currentVariable.types.append(currentText);
} else if (operationExpTags.contains(qName) || equationPartTags.contains(qName)) {
Expand Down
Expand Up @@ -766,6 +766,7 @@ static OMOperation* variantToOperationPtr(QVariantMap var)

static void variantToSource(QVariantMap var, OMInfo &info, QStringList &types, QList<OMOperation*> &ops)
{
Q_UNUSED(types);
QVariantMap vinfo = var["info"].toMap();
info.file = vinfo["file"].toString();
info.lineStart = vinfo["lineStart"].toInt();
Expand Down

0 comments on commit 3c28781

Please sign in to comment.