This allows Wireshark to be built on RedHat EL 7.2, with Qt 4.8.5.
Bug: 13909
Change-Id: Ia39a288cc342afa2bd0217cb59dac84c3227086c
Reviewed-on: https://code.wireshark.org/review/23322
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
}
}
+#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
static void mainwindow_add_toolbar(const iface_toolbar *toolbar_entry)
{
if (gbl_cur_main_window_ && toolbar_entry)
gbl_cur_main_window_->removeInterfaceToolbar(menu_title);
}
}
+#endif
QMenu* MainWindow::findOrAddMenu(QMenu *parent_menu, QString& menu_text) {
QList<QAction *> actions = parent_menu->actions();
class MainWindow;
}
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+Q_DECLARE_METATYPE(QToolBar *)
+#endif
Q_DECLARE_METATYPE(ts_type)
Q_DECLARE_METATYPE(ts_precision)
graph_data_col_ = src_port_col_ // QCPGraph
};
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+Q_DECLARE_METATYPE(RtpAudioStream *)
+Q_DECLARE_METATYPE(QCPGraph *)
+#endif
+
#ifdef QT_MULTIMEDIA_LIB
static const double wf_graph_normal_width_ = 0.5;
static const double wf_graph_selected_width_ = 2.0;
#include <QLineEdit>
#include <QKeyEvent>
#include <QTreeWidgetItemIterator>
+#include <QUrl>
#include <QDebug>
#include <QLayout>
#include <QMimeData>
#include <QMouseEvent>
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <QWindow>
+#endif
#define drag_drop_toolbar_action_ "drag_drop_toolbar_action_"
elem->property(drag_drop_toolbar_action_).toByteArray());
drag->setMimeData(mimeData);
+#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
qreal dpr = window()->windowHandle()->devicePixelRatio();
QPixmap pixmap(elem->size() * dpr);
pixmap.setDevicePixelRatio(dpr);
+#else
+ QPixmap pixmap(elem->size());
+#endif
elem->render(&pixmap);
drag->setPixmap(pixmap);
void WirelessTimeline::mousePressEvent(QMouseEvent *event)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
start_x = last_x = event->localPos().x();
+#else
+ start_x = last_x = event->posF().x();
+#endif
}
if (event->buttons() == Qt::NoButton)
return;
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
qreal offset = event->localPos().x() - last_x;
last_x = event->localPos().x();
+#else
+ qreal offset = event->posF().x() - last_x;
+ last_x = event->posF().x();
+#endif
qreal shift = ((qreal) (end_tsf - start_tsf))/width() * offset;
start_tsf -= shift;
void WirelessTimeline::mouseReleaseEvent(QMouseEvent *event)
{
- qreal offset = event->localPos().x() - start_x;
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
+ QPointF localPos = event->localPos();
+#else
+ QPointF localPos = event->posF();
+#endif
+ qreal offset = localPos.x() - start_x;
/* if this was a drag, ignore it */
if (std::abs(offset) > 3)
return;
/* this was a click */
- guint num = find_packet(event->localPos().x());
+ guint num = find_packet(localPos.x());
if (num == 0)
return;
QPainter p(this);
// painting is done in device pixels in the x axis, get the ratio here
- float ratio = p.device()->devicePixelRatio();
+ float ratio = 1.0;
+#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
+ ratio = p.device()->devicePixelRatio();
+#endif
unsigned int packet;
double zoom;
#endif /* _WIN32 */
#include <QAction>
+#include <QApplication>
#include <QDesktopServices>
#include <QDir>
#include <QEvent>
qApp->setStyleSheet(app_style_sheet);
// If our window text is lighter than the window background, assume the theme is dark.
- QPalette gui_pal = QGuiApplication::palette();
+ QPalette gui_pal = qApp->palette();
prefs_set_gui_theme_is_dark(gui_pal.windowText().color().value() > gui_pal.window().color().value());
#ifdef HAVE_SOFTWARE_UPDATE