Drop Qt 4 support

This commit is contained in:
Eugene Shalygin
2017-01-19 13:10:09 +01:00
parent 60998a68eb
commit e64bb1de8c
67 changed files with 48 additions and 8809 deletions

View File

@@ -44,6 +44,4 @@ speedplotview.cpp
add_library(qbt_properties STATIC ${QBT_PROPERTIES_HEADERS} ${QBT_PROPERTIES_SOURCES})
target_link_libraries(qbt_properties qbt_base)
if (NOT QT4_FOUND)
target_link_libraries(qbt_properties Qt5::Widgets Qt5::Concurrent)
endif (NOT QT4_FOUND)
target_link_libraries(qbt_properties Qt5::Widgets Qt5::Concurrent)

View File

@@ -36,9 +36,7 @@
#include <QClipboard>
#include <QMessageBox>
#include <QWheelEvent>
#ifdef QBT_USES_QT5
#include <QTableView>
#endif
#include "base/net/reverseresolution.h"
#include "base/bittorrent/torrenthandle.h"
@@ -135,14 +133,12 @@ PeerListWidget::PeerListWidget(PropertiesWidget *parent)
handleSortColumnChanged(header()->sortIndicatorSection());
m_copyHotkey = new QShortcut(QKeySequence::Copy, this, SLOT(copySelectedPeers()), 0, Qt::WidgetShortcut);
#ifdef QBT_USES_QT5
// This hack fixes reordering of first column with Qt5.
// https://github.com/qtproject/qtbase/commit/e0fc088c0c8bc61dbcaf5928b24986cd61a22777
QTableView unused;
unused.setVerticalHeader(this->header());
this->header()->setParent(this);
unused.setVerticalHeader(new QHeaderView(Qt::Horizontal));
#endif
}
PeerListWidget::~PeerListWidget()

View File

@@ -39,10 +39,8 @@ PeersAdditionDlg::PeersAdditionDlg(QWidget *parent)
setupUi(this);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(validateInput()));
#ifdef QBT_USES_QT5
label_format->hide();
peers_txt->setPlaceholderText("Format: IPv4:port / [IPv6]:port");
#endif
}
QList<BitTorrent::PeerAddress> PeersAdditionDlg::askForPeers()

View File

@@ -102,15 +102,8 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow *main_window, Tra
connect(filesList->header(), SIGNAL(sectionResized(int,int,int)), this, SLOT(saveSettings()));
connect(filesList->header(), SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), this, SLOT(saveSettings()));
#ifdef QBT_USES_QT5
// set bar height relative to screen dpi
int barHeight = devicePixelRatio() * 18;
#else
// set bar height relative to font height
QFont defFont;
QFontMetrics fMetrics(defFont, 0); // need to be device-dependent
int barHeight = fMetrics.height() * 5 / 4;
#endif
// Downloaded pieces progress bar
tempProgressBarArea->setVisible(false);

View File

@@ -36,12 +36,8 @@
#include <QStyleOptionProgressBar>
#ifdef Q_OS_WIN
#ifndef QBT_USES_QT5
#include <QPlastiqueStyle>
#else
#include <QProxyStyle>
#endif
#endif
#include "base/utils/misc.h"
#include "base/utils/string.h"
@@ -106,11 +102,7 @@ void PropListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter);
#else
// XXX: To avoid having the progress text on the right of the bar
#ifndef QBT_USES_QT5
QPlastiqueStyle st;
#else
QProxyStyle st("fusion");
#endif
st.drawControl(QStyle::CE_ProgressBar, &newopt, painter, 0);
#endif
}

View File

@@ -37,10 +37,8 @@
#include <QDebug>
#include <QUrl>
#include <QMessageBox>
#ifdef QBT_USES_QT5
#include <QTableView>
#include <QHeaderView>
#endif
#include "base/bittorrent/session.h"
#include "base/bittorrent/torrenthandle.h"
@@ -88,14 +86,12 @@ TrackerList::TrackerList(PropertiesWidget *properties): QTreeWidget(), propertie
deleteHotkey = new QShortcut(QKeySequence::Delete, this, SLOT(deleteSelectedTrackers()), 0, Qt::WidgetShortcut);
copyHotkey = new QShortcut(QKeySequence::Copy, this, SLOT(copyTrackerUrl()), 0, Qt::WidgetShortcut);
#ifdef QBT_USES_QT5
// This hack fixes reordering of first column with Qt5.
// https://github.com/qtproject/qtbase/commit/e0fc088c0c8bc61dbcaf5928b24986cd61a22777
QTableView unused;
unused.setVerticalHeader(this->header());
this->header()->setParent(this);
unused.setVerticalHeader(new QHeaderView(Qt::Horizontal));
#endif
loadSettings();
}