Move some connect() from propertieswidget to their corresponding widget

This commit is contained in:
thalieht 2018-05-08 16:13:17 +03:00 committed by sledgehammer999
parent 0c988a5fd4
commit 8707a1bc86
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2
3 changed files with 7 additions and 7 deletions

View file

@ -130,6 +130,9 @@ PeerListWidget::PeerListWidget(PropertiesWidget *parent)
header()->setContextMenuPolicy(Qt::CustomContextMenu); header()->setContextMenuPolicy(Qt::CustomContextMenu);
connect(header(), &QWidget::customContextMenuRequested, this, &PeerListWidget::displayToggleColumnsMenu); connect(header(), &QWidget::customContextMenuRequested, this, &PeerListWidget::displayToggleColumnsMenu);
connect(header(), &QHeaderView::sectionClicked, this, &PeerListWidget::handleSortColumnChanged); connect(header(), &QHeaderView::sectionClicked, this, &PeerListWidget::handleSortColumnChanged);
connect(header(), &QHeaderView::sectionMoved, this, &PeerListWidget::saveSettings);
connect(header(), &QHeaderView::sectionResized, this, &PeerListWidget::saveSettings);
connect(header(), &QHeaderView::sortIndicatorChanged, this, &PeerListWidget::saveSettings);
handleSortColumnChanged(header()->sortIndicatorSection()); handleSortColumnChanged(header()->sortIndicatorSection());
m_copyHotkey = new QShortcut(QKeySequence::Copy, this, nullptr, nullptr, Qt::WidgetShortcut); m_copyHotkey = new QShortcut(QKeySequence::Copy, this, nullptr, nullptr, Qt::WidgetShortcut);
connect(m_copyHotkey, &QShortcut::activated, this, &PeerListWidget::copySelectedPeers); connect(m_copyHotkey, &QShortcut::activated, this, &PeerListWidget::copySelectedPeers);

View file

@ -140,15 +140,9 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow *mainWindow, Tran
connect(m_ui->trackerUpButton, &QPushButton::clicked, m_trackerList, &TrackerList::moveSelectionUp); connect(m_ui->trackerUpButton, &QPushButton::clicked, m_trackerList, &TrackerList::moveSelectionUp);
connect(m_ui->trackerDownButton, &QPushButton::clicked, m_trackerList, &TrackerList::moveSelectionDown); connect(m_ui->trackerDownButton, &QPushButton::clicked, m_trackerList, &TrackerList::moveSelectionDown);
m_ui->horizontalLayout_trackers->insertWidget(0, m_trackerList); m_ui->horizontalLayout_trackers->insertWidget(0, m_trackerList);
connect(m_trackerList->header(), SIGNAL(sectionMoved(int,int,int)), m_trackerList, SLOT(saveSettings()));
connect(m_trackerList->header(), SIGNAL(sectionResized(int,int,int)), m_trackerList, SLOT(saveSettings()));
connect(m_trackerList->header(), SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), m_trackerList, SLOT(saveSettings()));
// Peers list // Peers list
m_peerList = new PeerListWidget(this); m_peerList = new PeerListWidget(this);
m_ui->peerpage_layout->addWidget(m_peerList); m_ui->peerpage_layout->addWidget(m_peerList);
connect(m_peerList->header(), SIGNAL(sectionMoved(int,int,int)), m_peerList, SLOT(saveSettings()));
connect(m_peerList->header(), SIGNAL(sectionResized(int,int,int)), m_peerList, SLOT(saveSettings()));
connect(m_peerList->header(), SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), m_peerList, SLOT(saveSettings()));
// Speed widget // Speed widget
m_speedWidget = new SpeedWidget(this); m_speedWidget = new SpeedWidget(this);
m_ui->speedLayout->addWidget(m_speedWidget); m_ui->speedLayout->addWidget(m_speedWidget);

View file

@ -79,9 +79,12 @@ TrackerList::TrackerList(PropertiesWidget *properties)
// Context menu // Context menu
setContextMenuPolicy(Qt::CustomContextMenu); setContextMenuPolicy(Qt::CustomContextMenu);
connect(this, &QWidget::customContextMenuRequested, this, &TrackerList::showTrackerListMenu); connect(this, &QWidget::customContextMenuRequested, this, &TrackerList::showTrackerListMenu);
// Header context menu // Header
header()->setContextMenuPolicy(Qt::CustomContextMenu); header()->setContextMenuPolicy(Qt::CustomContextMenu);
connect(header(), &QWidget::customContextMenuRequested, this, &TrackerList::displayToggleColumnsMenu); connect(header(), &QWidget::customContextMenuRequested, this, &TrackerList::displayToggleColumnsMenu);
connect(header(), &QHeaderView::sectionMoved, this, &TrackerList::saveSettings);
connect(header(), &QHeaderView::sectionResized, this, &TrackerList::saveSettings);
connect(header(), &QHeaderView::sortIndicatorChanged, this, &TrackerList::saveSettings);
// Set DHT, PeX, LSD items // Set DHT, PeX, LSD items
m_DHTItem = new QTreeWidgetItem({ "", "** [DHT] **", "", "0", "", "", "0" }); m_DHTItem = new QTreeWidgetItem({ "", "** [DHT] **", "", "0", "", "", "0" });
insertTopLevelItem(0, m_DHTItem); insertTopLevelItem(0, m_DHTItem);