提交 6472d068 编写于 作者: D dev

Qt5 old version compablity

上级 55fc0d96
......@@ -35,6 +35,11 @@ const QColor TagInfo::DefaultColor(Qt::lightGray);
const QString TagInfo::strUntagged("Untagged");
Bookmarks* Bookmarks::m_pThis = 0;
#if QT_VERSION < 0x051500
#define ENDL endl
#else
#define ENDL Qt::endl
#endif
Bookmarks::Bookmarks()
{
TagInfo tag(TagInfo::strUntagged);
......@@ -155,7 +160,7 @@ bool Bookmarks::save()
QTextStream stream(&file);
stream << QString("# Tag name").leftJustified(20) + "; " +
QString(" color") << Qt::endl;
QString(" color") << ENDL;
QSet<TagInfo*> usedTags;
for (int iBookmark = 0; iBookmark < m_BookmarkList.size(); iBookmark++)
......@@ -171,16 +176,16 @@ bool Bookmarks::save()
for (QSet<TagInfo*>::iterator i = usedTags.begin(); i != usedTags.end(); i++)
{
TagInfo& info = **i;
stream << info.name.leftJustified(20) + "; " + info.color.name() << Qt::endl;
stream << info.name.leftJustified(20) + "; " + info.color.name() << ENDL;
}
stream << Qt::endl;
stream << ENDL;
stream << QString("# Frequency").leftJustified(12) + "; " +
QString("Name").leftJustified(25)+ "; " +
QString("Modulation").leftJustified(20) + "; " +
QString("Bandwidth").rightJustified(10) + "; " +
QString("Tags") << Qt::endl;
QString("Tags") << ENDL;
for (int i = 0; i < m_BookmarkList.size(); i++)
{
......@@ -199,7 +204,7 @@ bool Bookmarks::save()
line.append(tag.name);
}
stream << line << Qt::endl;
stream << line << ENDL;
}
file.close();
......
......@@ -471,7 +471,11 @@ void CFreqCtrl::mousePressEvent(QMouseEvent *event)
void CFreqCtrl::wheelEvent(QWheelEvent *event)
{
#if QT_VERSION >=0x051500
QPointF pt = event->position();
#else
QPoint pt = event->pos();
#endif
int numDegrees = (event->angleDelta().x() +event->angleDelta().y() ) / 8;
int numSteps = numDegrees / 15;
......
......@@ -827,7 +827,11 @@ void CPlotter::zoomOnXAxis(double level)
// Called when a mouse wheel is turned
void CPlotter::wheelEvent(QWheelEvent * event)
{
QPointF pt = event->position();
#if QT_VERSION >=0x051500
QPointF pt = event->position();
#else
QPoint pt = event->pos();
#endif
pt.setX(pt.x() / pixRatio()+.5);
pt.setY(pt.y() / pixRatio()+.5);
int numDegrees = (event->angleDelta().x() + event->angleDelta().y()) / 8;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册