QMAKEVERSION = $$[QMAKE_VERSION]
ISQT4 = $$find(QMAKEVERSION, ^[2-9])
isEmpty( ISQT4 ) {
- error("Use the qmake include with Qt4.4 or greater, on Debian that is qmake-qt4");
+ error("Use the qmake include with Qt4.7 or greater, on Debian that is qmake-qt4");
}
TEMPLATE = subdirs
TEMPLATE = app
TARGET = confclerk
DESTDIR = ../bin
-QT += sql xml network widgets
+QT += sql xml network
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG(maemo5) {
QT += maemo5
}
#include "appsettings.h"
#endif
+QString toHtmlEscaped(const QString& string) {
+#if QT_VERSION >= 0x050000
+ return string.toHtmlEscaped();
+#else
+ return Qt::escape(string);
+#endif
+}
+
EventDialog::EventDialog(int conferenceId, int eventId, QWidget *parent): QDialog(parent), mConferenceId(conferenceId), mEventId(eventId) {
setupUi(this);
QString info;
// title
- info.append(QString("<h1>%1</h1>\n").arg(event.title().toHtmlEscaped()));
+ info.append(QString("<h1>%1</h1>\n").arg(toHtmlEscaped(event.title())));
// persons
info += QString("<h2>%1</h2>\n").arg(tr("Persons"));
QStringList persons = event.persons();
- for (int i = 0; i != persons.size(); ++i) persons[i] = persons[i].toHtmlEscaped();
+ for (int i = 0; i != persons.size(); ++i) persons[i] = toHtmlEscaped(persons[i]);
info += QString("<p>%1</p>\n").arg(persons.join(", "));
// abstract
QString name(i.key());
if (url.isEmpty() || url == "http://") continue;
if (name.isEmpty()) name = url;
- info += QString("<li><a href=\"%1\">%2</a></li>\n").arg(url.toHtmlEscaped(), name.toHtmlEscaped());
+ info += QString("<li><a href=\"%1\">%2</a></li>\n").arg(toHtmlEscaped(url), toHtmlEscaped(name));
}
info += QString("</ul>\n");
eventInfoTextBrowser->setHtml(info);
CONFIG += static
QT += sql \
xml \
- network \
- widgets
+ network
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
QMAKE_CLEAN += ../bin/libgui.a
# module dependencies
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
+#include "qglobal.h"
+#if QT_VERSION >= 0x050000
#include <QtWidgets>
+#else
+#include <QtGui/QMainWindow>
+#endif
#include <QSslError>
#include "ui_mainwindow.h"
#ifndef SEARCHHEAD_H
#define SEARCHHEAD_H
+#include "qglobal.h"
+#if QT_VERSION >= 0x050000
#include <QtWidgets>
+#else
+#include <QtGui/QWidget>
+#endif
#include <QDebug>
#include "ui_searchhead.h"
#ifndef DELEGATE_H
#define DELEGATE_H
+#include "qglobal.h"
+#if QT_VERSION >= 0x050000
#include <QtWidgets>
+#else
+#include <QtGui>
+#endif
class Delegate : public QItemDelegate
{
if (!parent.isValid())
{
- return createIndex(row, column, (quintptr) 0);
+ return createIndex(row, column);
}
else if (parent.internalId() == 0)
{
Event * event = static_cast<Event*>(index.internalPointer());
- return createIndex(mParents[event->id()], 0, (quintptr) 0);
+ return createIndex(mParents[event->id()], 0);
}
return QModelIndex();
TARGET = mvc
DESTDIR = ../bin
CONFIG += static
-QT += sql \
- widgets
+QT += sql
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
QMAKE_CLEAN += ../bin/libmvc.a
# module dependencies
#include <QSqlRecord>
#include <QVariant>
#include <QDateTime>
+#include "qglobal.h"
+#if QT_VERSION >= 0x050000
#include <QStandardPaths>
+#else
+#include <QDesktopServices>
+#endif
#include <QDir>
#include "sqlengine.h"
const QString TIME_FORMAT ("hh:mm");
SqlEngine::SqlEngine(QObject *aParent): QObject(aParent) {
+#if QT_VERSION >= 0x050000
QDir dbPath(QStandardPaths::writableLocation(QStandardPaths::DataLocation));
+#else
+ QDir dbPath(QDesktopServices::storageLocation(QDesktopServices::DataLocation));
+#endif
dbFilename = dbPath.absoluteFilePath("ConfClerk.sqlite");
}