Qt5 compile fixes
This commit is contained in:
committed by
craig.p.drummond
parent
00e10307d0
commit
0f87f5905c
@@ -27,7 +27,6 @@
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QMenuBar>
|
||||
#include <qmenudata.h>
|
||||
#include <QMetaClassInfo>
|
||||
#include <QObject>
|
||||
#include <QList>
|
||||
@@ -70,6 +69,14 @@
|
||||
|
||||
*********************************************************************/
|
||||
|
||||
static inline QString esc(const QString &orig)
|
||||
{
|
||||
#if QT_VERSION < 0x050000
|
||||
return Qt::escape(orig);
|
||||
#else
|
||||
return orig.toHtmlEscaped();
|
||||
#endif
|
||||
}
|
||||
|
||||
class AcceleratorManagerPrivate
|
||||
{
|
||||
@@ -85,12 +92,12 @@ public:
|
||||
if (t1 != t2)
|
||||
{
|
||||
if (as.accel() == -1) {
|
||||
removed_string += "<tr><td>" + Qt::escape(t1) + "</td></tr>";
|
||||
removed_string += "<tr><td>" + esc(t1) + "</td></tr>";
|
||||
} else if (as.originalAccel() == -1) {
|
||||
added_string += "<tr><td>" + Qt::escape(t2) + "</td></tr>";
|
||||
added_string += "<tr><td>" + esc(t2) + "</td></tr>";
|
||||
} else {
|
||||
changed_string += "<tr><td>" + Qt::escape(t1) + "</td>";
|
||||
changed_string += "<td>" + Qt::escape(t2) + "</td></tr>";
|
||||
changed_string += "<tr><td>" + esc(t1) + "</td>";
|
||||
changed_string += "<td>" + esc(t2) + "</td></tr>";
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ bool ShortcutHandler::eventFilter(QObject *o, QEvent *e)
|
||||
} else {
|
||||
widget = widget->window();
|
||||
seenAlt.insert(widget);
|
||||
QList<QWidget *> l = qFindChildren<QWidget *>(widget);
|
||||
QList<QWidget *> l = widget->findChildren<QWidget*>();
|
||||
for (int pos=0 ; pos < l.size() ; ++pos) {
|
||||
QWidget *w = l.at(pos);
|
||||
if (!(w->isWindow() || !w->isVisible())) { // || w->style()->styleHint(QStyle::SH_UnderlineShortcut, 0, w)))
|
||||
@@ -98,7 +98,7 @@ bool ShortcutHandler::eventFilter(QObject *o, QEvent *e)
|
||||
}
|
||||
}
|
||||
|
||||
QList<QMenuBar *> m = qFindChildren<QMenuBar *>(widget);
|
||||
QList<QMenuBar *> m = widget->findChildren<QMenuBar*>();
|
||||
for (int i = 0; i < m.size(); ++i) {
|
||||
updateWidget(m.at(i));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user