forked from qt-creator/qt-creator
Help: Use Qt5-style connects
The heavy lifting was done by clazy. Change-Id: Ied9c7fcc031e530c41b342de950e2f0ac730bbb1 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
700239c681
commit
d01adc134d
@@ -50,14 +50,12 @@ public:
|
||||
void apply();
|
||||
void finish();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void addDocumentation();
|
||||
|
||||
private:
|
||||
bool eventFilter(QObject *object, QEvent *event);
|
||||
void removeDocumentation(const QList<QModelIndex> &items);
|
||||
|
||||
private:
|
||||
QList<QModelIndex> currentSelection() const;
|
||||
|
||||
Ui::DocSettingsPage m_ui;
|
||||
|
@@ -63,8 +63,8 @@ QWidget *FilterSettingsPage::widget()
|
||||
this, &FilterSettingsPage::addFilter);
|
||||
connect(m_ui.filterRemoveButton, &QPushButton::clicked,
|
||||
this, &FilterSettingsPage::removeFilter);
|
||||
connect(HelpManager::instance(), SIGNAL(documentationChanged()),
|
||||
this, SLOT(updateFilterPage()));
|
||||
connect(HelpManager::instance(), &HelpManager::documentationChanged,
|
||||
this, &FilterSettingsPage::updateFilterPage);
|
||||
}
|
||||
return m_widget;
|
||||
}
|
||||
@@ -221,8 +221,8 @@ void FilterSettingsPage::apply()
|
||||
|
||||
void FilterSettingsPage::finish()
|
||||
{
|
||||
disconnect(HelpManager::instance(), SIGNAL(documentationChanged()),
|
||||
this, SLOT(updateFilterPage()));
|
||||
disconnect(HelpManager::instance(), &HelpManager::documentationChanged,
|
||||
this, &FilterSettingsPage::updateFilterPage);
|
||||
delete m_widget;
|
||||
}
|
||||
|
||||
|
@@ -47,18 +47,15 @@ public:
|
||||
signals:
|
||||
void filtersChanged();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void updateAttributes(QListWidgetItem *item);
|
||||
void updateFilterMap();
|
||||
void updateFilterPage();
|
||||
void addFilter();
|
||||
void removeFilter();
|
||||
|
||||
private:
|
||||
void updateFilterDescription(const QString &filter);
|
||||
|
||||
private:
|
||||
QString msgFilterLabel(const QString &filter) const;
|
||||
|
||||
Ui::FilterSettingsPage m_ui;
|
||||
QPointer<QWidget> m_widget;
|
||||
|
||||
|
@@ -49,20 +49,18 @@ public:
|
||||
signals:
|
||||
void fontChanged();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void setCurrentPage();
|
||||
void setBlankPage();
|
||||
void setDefaultPage();
|
||||
void importBookmarks();
|
||||
void exportBookmarks();
|
||||
|
||||
private:
|
||||
void updateFontSize();
|
||||
void updateFontStyle();
|
||||
void updateFontFamily();
|
||||
int closestPointSizeIndex(int desiredPointSize) const;
|
||||
|
||||
private:
|
||||
QFont m_font;
|
||||
QFontDatabase m_fontDatabase;
|
||||
|
||||
|
@@ -151,24 +151,24 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
addAutoReleasedObject(m_searchTaskHandler = new SearchTaskHandler);
|
||||
|
||||
m_centralWidget = new CentralWidget(Context("Help.CentralHelpWidget"));
|
||||
connect(m_centralWidget, SIGNAL(sourceChanged(QUrl)), this,
|
||||
SLOT(updateSideBarSource(QUrl)));
|
||||
connect(m_centralWidget, &HelpWidget::sourceChanged, this,
|
||||
&HelpPlugin::updateSideBarSource);
|
||||
connect(m_centralWidget, &CentralWidget::closeButtonClicked,
|
||||
&OpenPagesManager::instance(), &OpenPagesManager::closeCurrentPage);
|
||||
|
||||
connect(LocalHelpManager::instance(), &LocalHelpManager::returnOnCloseChanged,
|
||||
m_centralWidget, &CentralWidget::updateCloseButton);
|
||||
connect(HelpManager::instance(), SIGNAL(helpRequested(QUrl,Core::HelpManager::HelpViewerLocation)),
|
||||
this, SLOT(handleHelpRequest(QUrl,Core::HelpManager::HelpViewerLocation)));
|
||||
connect(m_searchTaskHandler, SIGNAL(search(QUrl)), this,
|
||||
SLOT(showLinkInHelpMode(QUrl)));
|
||||
connect(HelpManager::instance(), &HelpManager::helpRequested,
|
||||
this, &HelpPlugin::handleHelpRequest);
|
||||
connect(m_searchTaskHandler, &SearchTaskHandler::search, this,
|
||||
&HelpPlugin::showLinkInHelpMode);
|
||||
|
||||
connect(m_filterSettingsPage, SIGNAL(filtersChanged()), this,
|
||||
SLOT(setupHelpEngineIfNeeded()));
|
||||
connect(HelpManager::instance(), SIGNAL(documentationChanged()), this,
|
||||
SLOT(setupHelpEngineIfNeeded()));
|
||||
connect(HelpManager::instance(), SIGNAL(collectionFileChanged()), this,
|
||||
SLOT(setupHelpEngineIfNeeded()));
|
||||
connect(m_filterSettingsPage, &FilterSettingsPage::filtersChanged, this,
|
||||
&HelpPlugin::setupHelpEngineIfNeeded);
|
||||
connect(HelpManager::instance(), &HelpManager::documentationChanged, this,
|
||||
&HelpPlugin::setupHelpEngineIfNeeded);
|
||||
connect(HelpManager::instance(), &HelpManager::collectionFileChanged, this,
|
||||
&HelpPlugin::setupHelpEngineIfNeeded);
|
||||
|
||||
connect(ToolTip::instance(), &ToolTip::shown, ICore::instance(), []() {
|
||||
ICore::addAdditionalContext(Context(kToolTipHelpContext), ICore::ContextPriority::High);
|
||||
@@ -185,29 +185,29 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
tr(Constants::SB_CONTENTS), this);
|
||||
cmd = ActionManager::registerAction(action, "Help.ContentsMenu");
|
||||
ActionManager::actionContainer(Core::Constants::M_HELP)->addAction(cmd, Core::Constants::G_HELP_HELP);
|
||||
connect(action, SIGNAL(triggered()), this, SLOT(activateContents()));
|
||||
connect(action, &QAction::triggered, this, &HelpPlugin::activateContents);
|
||||
|
||||
action = new QAction(tr(Constants::SB_INDEX), this);
|
||||
cmd = ActionManager::registerAction(action, "Help.IndexMenu");
|
||||
ActionManager::actionContainer(Core::Constants::M_HELP)->addAction(cmd, Core::Constants::G_HELP_HELP);
|
||||
connect(action, SIGNAL(triggered()), this, SLOT(activateIndex()));
|
||||
connect(action, &QAction::triggered, this, &HelpPlugin::activateIndex);
|
||||
|
||||
action = new QAction(tr("Context Help"), this);
|
||||
cmd = ActionManager::registerAction(action, Help::Constants::CONTEXT_HELP,
|
||||
Context(kToolTipHelpContext, Core::Constants::C_GLOBAL));
|
||||
ActionManager::actionContainer(Core::Constants::M_HELP)->addAction(cmd, Core::Constants::G_HELP_HELP);
|
||||
cmd->setDefaultKeySequence(QKeySequence(Qt::Key_F1));
|
||||
connect(action, SIGNAL(triggered()), this, SLOT(showContextHelp()));
|
||||
connect(action, &QAction::triggered, this, &HelpPlugin::showContextHelp);
|
||||
|
||||
action = new QAction(tr("Technical Support"), this);
|
||||
cmd = ActionManager::registerAction(action, "Help.TechSupport");
|
||||
ActionManager::actionContainer(Core::Constants::M_HELP)->addAction(cmd, Core::Constants::G_HELP_SUPPORT);
|
||||
connect(action, SIGNAL(triggered()), this, SLOT(slotOpenSupportPage()));
|
||||
connect(action, &QAction::triggered, this, &HelpPlugin::slotOpenSupportPage);
|
||||
|
||||
action = new QAction(tr("Report Bug..."), this);
|
||||
cmd = ActionManager::registerAction(action, "Help.ReportBug");
|
||||
ActionManager::actionContainer(Core::Constants::M_HELP)->addAction(cmd, Core::Constants::G_HELP_SUPPORT);
|
||||
connect(action, SIGNAL(triggered()), this, SLOT(slotReportBug()));
|
||||
connect(action, &QAction::triggered, this, &HelpPlugin::slotReportBug);
|
||||
|
||||
if (ActionContainer *windowMenu = ActionManager::actionContainer(Core::Constants::M_WINDOW)) {
|
||||
// reuse EditorManager constants to avoid a second pair of menu actions
|
||||
@@ -216,16 +216,16 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
Command *ctrlTab = ActionManager::registerAction(action, Core::Constants::GOTOPREVINHISTORY,
|
||||
modecontext);
|
||||
windowMenu->addAction(ctrlTab, Core::Constants::G_WINDOW_NAVIGATE);
|
||||
connect(action, SIGNAL(triggered()), &OpenPagesManager::instance(),
|
||||
SLOT(gotoPreviousPage()));
|
||||
connect(action, &QAction::triggered, &OpenPagesManager::instance(),
|
||||
&OpenPagesManager::gotoPreviousPage);
|
||||
|
||||
// Goto Next In History Action
|
||||
action = new QAction(this);
|
||||
Command *ctrlShiftTab = ActionManager::registerAction(action, Core::Constants::GOTONEXTINHISTORY,
|
||||
modecontext);
|
||||
windowMenu->addAction(ctrlShiftTab, Core::Constants::G_WINDOW_NAVIGATE);
|
||||
connect(action, SIGNAL(triggered()), &OpenPagesManager::instance(),
|
||||
SLOT(gotoNextPage()));
|
||||
connect(action, &QAction::triggered, &OpenPagesManager::instance(),
|
||||
&OpenPagesManager::gotoNextPage);
|
||||
}
|
||||
|
||||
auto helpIndexFilter = new HelpIndexFilter();
|
||||
@@ -237,8 +237,8 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
|
||||
RemoteHelpFilter *remoteHelpFilter = new RemoteHelpFilter();
|
||||
addAutoReleasedObject(remoteHelpFilter);
|
||||
connect(remoteHelpFilter, SIGNAL(linkActivated(QUrl)), this,
|
||||
SLOT(showLinkInHelpMode(QUrl)));
|
||||
connect(remoteHelpFilter, &RemoteHelpFilter::linkActivated, this,
|
||||
&HelpPlugin::showLinkInHelpMode);
|
||||
|
||||
QDesktopServices::setUrlHandler(QLatin1String("qthelp"), HelpManager::instance(), "handleHelpRequest");
|
||||
connect(ModeManager::instance(), &ModeManager::currentModeChanged,
|
||||
@@ -318,14 +318,14 @@ HelpWidget *HelpPlugin::createHelpWidget(const Context &context, HelpWidget::Wid
|
||||
{
|
||||
HelpWidget *widget = new HelpWidget(context, style);
|
||||
|
||||
connect(widget->currentViewer(), SIGNAL(loadFinished()),
|
||||
this, SLOT(highlightSearchTermsInContextHelp()));
|
||||
connect(widget, SIGNAL(openHelpMode(QUrl)),
|
||||
this, SLOT(showLinkInHelpMode(QUrl)));
|
||||
connect(widget, SIGNAL(closeButtonClicked()),
|
||||
this, SLOT(slotHideRightPane()));
|
||||
connect(widget, SIGNAL(aboutToClose()),
|
||||
this, SLOT(saveExternalWindowSettings()));
|
||||
connect(widget->currentViewer(), &HelpViewer::loadFinished,
|
||||
this, &HelpPlugin::highlightSearchTermsInContextHelp);
|
||||
connect(widget, &HelpWidget::openHelpMode,
|
||||
this, &HelpPlugin::showLinkInHelpMode);
|
||||
connect(widget, &HelpWidget::closeButtonClicked,
|
||||
this, &HelpPlugin::slotHideRightPane);
|
||||
connect(widget, &HelpWidget::aboutToClose,
|
||||
this, &HelpPlugin::saveExternalWindowSettings);
|
||||
|
||||
// force setup, as we might have never switched to full help mode
|
||||
// thus the help engine might still run without collection file setup
|
||||
@@ -455,15 +455,6 @@ void HelpPlugin::modeChanged(Core::Id mode, Core::Id old)
|
||||
}
|
||||
}
|
||||
|
||||
void HelpPlugin::updateSideBarSource()
|
||||
{
|
||||
if (HelpViewer *viewer = m_centralWidget->currentViewer()) {
|
||||
const QUrl &url = viewer->source();
|
||||
if (url.isValid())
|
||||
updateSideBarSource(url);
|
||||
}
|
||||
}
|
||||
|
||||
void HelpPlugin::updateSideBarSource(const QUrl &newUrl)
|
||||
{
|
||||
if (m_rightPaneSideBarWidget) {
|
||||
|
@@ -77,7 +77,7 @@ public:
|
||||
|
||||
static HelpViewer *createHelpViewer(qreal zoom);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void modeChanged(Core::Id mode, Core::Id old);
|
||||
|
||||
void showContextHelp();
|
||||
@@ -89,7 +89,6 @@ private slots:
|
||||
void showLinksInHelpMode(const QMap<QString, QUrl> &links, const QString &key);
|
||||
void slotHideRightPane();
|
||||
|
||||
void updateSideBarSource();
|
||||
void updateSideBarSource(const QUrl &newUrl);
|
||||
|
||||
void setupHelpEngineIfNeeded();
|
||||
@@ -100,7 +99,6 @@ private slots:
|
||||
void slotOpenSupportPage();
|
||||
void slotReportBug();
|
||||
|
||||
private:
|
||||
void resetFilter();
|
||||
void activateHelpMode();
|
||||
bool canShowHelpSideBySide() const;
|
||||
@@ -112,7 +110,6 @@ private:
|
||||
|
||||
void doSetupIfNeeded();
|
||||
|
||||
private:
|
||||
HelpMode *m_mode;
|
||||
CentralWidget *m_centralWidget;
|
||||
HelpWidget *m_rightPaneSideBarWidget;
|
||||
|
@@ -77,7 +77,6 @@ public:
|
||||
static QString mimeFromUrl(const QUrl &url);
|
||||
static bool launchWithExternalApp(const QUrl &url);
|
||||
|
||||
public slots:
|
||||
void home();
|
||||
|
||||
virtual void scaleUp() = 0;
|
||||
@@ -97,7 +96,7 @@ signals:
|
||||
void backwardAvailable(bool);
|
||||
void loadFinished();
|
||||
|
||||
protected slots:
|
||||
protected:
|
||||
void slotLoadStarted();
|
||||
void slotLoadFinished();
|
||||
};
|
||||
|
@@ -246,7 +246,7 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
|
||||
|
||||
if (style != ExternalWindow) {
|
||||
m_closeAction = new QAction(Core::Icons::CLOSE_TOOLBAR.icon(), QString(), toolBar);
|
||||
connect(m_closeAction, SIGNAL(triggered()), this, SIGNAL(closeButtonClicked()));
|
||||
connect(m_closeAction, &QAction::triggered, this, &HelpWidget::closeButtonClicked);
|
||||
button = new QToolButton;
|
||||
button->setDefaultAction(m_closeAction);
|
||||
layout->addWidget(button);
|
||||
|
@@ -78,7 +78,7 @@ public:
|
||||
bool newPage = false);
|
||||
void activateSideBarItem(const QString &id);
|
||||
|
||||
public slots:
|
||||
public:
|
||||
void setSource(const QUrl &url);
|
||||
void updateCloseButton();
|
||||
|
||||
@@ -92,13 +92,12 @@ signals:
|
||||
void sourceChanged(const QUrl &url);
|
||||
void filterActivated(const QString &name);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void updateBackMenu();
|
||||
void updateForwardMenu();
|
||||
void updateWindowTitle();
|
||||
void helpModeButtonClicked();
|
||||
|
||||
private:
|
||||
void goHome();
|
||||
void addBookmark();
|
||||
void copy();
|
||||
|
@@ -47,7 +47,7 @@ class MacResponderHack : public QObject
|
||||
public:
|
||||
MacResponderHack(QObject *parent);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void responderHack(QWidget *old, QWidget *now);
|
||||
};
|
||||
|
||||
@@ -109,7 +109,7 @@ public:
|
||||
|
||||
MacWebKitHelpWidget *widget() const { return m_widget; }
|
||||
|
||||
public slots:
|
||||
public:
|
||||
void scaleUp();
|
||||
void scaleDown();
|
||||
void resetScale();
|
||||
@@ -119,14 +119,12 @@ public slots:
|
||||
void backward();
|
||||
void print(QPrinter *printer);
|
||||
|
||||
public slots:
|
||||
void slotLoadStarted();
|
||||
void slotLoadFinished();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void goToHistoryItem();
|
||||
|
||||
private:
|
||||
DOMRange *findText(NSString *text, bool forward, bool caseSensitive, DOMNode *startNode,
|
||||
int startOffset);
|
||||
MacWebKitHelpWidget *m_widget;
|
||||
|
@@ -657,7 +657,7 @@ void MacWebKitHelpViewer::addBackHistoryItems(QMenu *backMenu)
|
||||
QAction *action = new QAction(backMenu);
|
||||
action->setText(QString::fromNSString([list itemAtIndex:historyIndex].title));
|
||||
action->setData(historyIndex);
|
||||
connect(action, SIGNAL(triggered()), this, SLOT(goToHistoryItem()));
|
||||
connect(action, &QAction::triggered, this, &MacWebKitHelpViewer::goToHistoryItem);
|
||||
backMenu->addAction(action);
|
||||
}
|
||||
}
|
||||
@@ -673,7 +673,7 @@ void MacWebKitHelpViewer::addForwardHistoryItems(QMenu *forwardMenu)
|
||||
QAction *action = new QAction(forwardMenu);
|
||||
action->setText(QString::fromNSString([list itemAtIndex:historyIndex].title));
|
||||
action->setData(historyIndex);
|
||||
connect(action, SIGNAL(triggered()), this, SLOT(goToHistoryItem()));
|
||||
connect(action, &QAction::triggered, this, &MacWebKitHelpViewer::goToHistoryItem);
|
||||
forwardMenu->addAction(action);
|
||||
}
|
||||
}
|
||||
@@ -878,8 +878,8 @@ void MacWebKitHelpViewer::goToHistoryItem()
|
||||
MacResponderHack::MacResponderHack(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
connect(qApp, SIGNAL(focusChanged(QWidget*,QWidget*)),
|
||||
this, SLOT(responderHack(QWidget*,QWidget*)));
|
||||
connect(qApp, &QApplication::focusChanged,
|
||||
this, &MacResponderHack::responderHack);
|
||||
}
|
||||
|
||||
void MacResponderHack::responderHack(QWidget *old, QWidget *now)
|
||||
|
@@ -65,15 +65,16 @@ OpenPagesManager::OpenPagesManager(QObject *parent)
|
||||
m_comboBox = new QComboBox;
|
||||
m_comboBox->setModel(m_model);
|
||||
m_comboBox->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(m_comboBox, SIGNAL(activated(int)), this, SLOT(setCurrentPage(int)));
|
||||
connect(m_comboBox, SIGNAL(customContextMenuRequested(QPoint)), this,
|
||||
SLOT(openPagesContextMenu(QPoint)));
|
||||
connect(m_comboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
|
||||
this, &OpenPagesManager::setCurrentPageByRow);
|
||||
connect(m_comboBox, &QWidget::customContextMenuRequested, this,
|
||||
&OpenPagesManager::openPagesContextMenu);
|
||||
|
||||
m_openPagesSwitcher = new OpenPagesSwitcher(m_model);
|
||||
connect(m_openPagesSwitcher, SIGNAL(closePage(QModelIndex)), this,
|
||||
SLOT(closePage(QModelIndex)));
|
||||
connect(m_openPagesSwitcher, SIGNAL(setCurrentPage(QModelIndex)), this,
|
||||
SLOT(setCurrentPage(QModelIndex)));
|
||||
connect(m_openPagesSwitcher, &OpenPagesSwitcher::closePage, this,
|
||||
&OpenPagesManager::closePage);
|
||||
connect(m_openPagesSwitcher, &OpenPagesSwitcher::setCurrentPage,
|
||||
this, &OpenPagesManager::setCurrentPage);
|
||||
}
|
||||
|
||||
OpenPagesManager ::~OpenPagesManager()
|
||||
@@ -92,12 +93,12 @@ QWidget *OpenPagesManager::openPagesWidget() const
|
||||
{
|
||||
if (!m_openPagesWidget) {
|
||||
m_openPagesWidget = new OpenPagesWidget(m_model);
|
||||
connect(m_openPagesWidget, SIGNAL(setCurrentPage(QModelIndex)), this,
|
||||
SLOT(setCurrentPage(QModelIndex)));
|
||||
connect(m_openPagesWidget, SIGNAL(closePage(QModelIndex)), this,
|
||||
SLOT(closePage(QModelIndex)));
|
||||
connect(m_openPagesWidget, SIGNAL(closePagesExcept(QModelIndex)), this,
|
||||
SLOT(closePagesExcept(QModelIndex)));
|
||||
connect(m_openPagesWidget, &OpenPagesWidget::setCurrentPage,
|
||||
this, &OpenPagesManager::setCurrentPage);
|
||||
connect(m_openPagesWidget, &OpenPagesWidget::closePage,
|
||||
this, &OpenPagesManager::closePage);
|
||||
connect(m_openPagesWidget, &OpenPagesWidget::closePagesExcept,
|
||||
this, &OpenPagesManager::closePagesExcept);
|
||||
}
|
||||
return m_openPagesWidget;
|
||||
}
|
||||
@@ -166,13 +167,11 @@ void OpenPagesManager::setupInitialPages()
|
||||
CentralWidget::instance()->addViewer(m_model->pageAt(i));
|
||||
|
||||
emit pagesChanged();
|
||||
setCurrentPage((initialPage >= m_model->rowCount())
|
||||
setCurrentPageByRow((initialPage >= m_model->rowCount())
|
||||
? m_model->rowCount() - 1 : initialPage);
|
||||
m_openPagesSwitcher->selectCurrentPage();
|
||||
}
|
||||
|
||||
// -- public slots
|
||||
|
||||
HelpViewer *OpenPagesManager::createPage()
|
||||
{
|
||||
return createPage(QUrl(Help::Constants::AboutBlank));
|
||||
@@ -190,12 +189,12 @@ HelpViewer *OpenPagesManager::createPage(const QUrl &url)
|
||||
CentralWidget::instance()->addViewer(page);
|
||||
|
||||
emit pagesChanged();
|
||||
setCurrentPage(index);
|
||||
setCurrentPageByRow(index);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
void OpenPagesManager::setCurrentPage(int index)
|
||||
void OpenPagesManager::setCurrentPageByRow(int index)
|
||||
{
|
||||
CentralWidget::instance()->setCurrentViewer(m_model->pageAt(index));
|
||||
|
||||
@@ -207,7 +206,7 @@ void OpenPagesManager::setCurrentPage(int index)
|
||||
void OpenPagesManager::setCurrentPage(const QModelIndex &index)
|
||||
{
|
||||
if (index.isValid())
|
||||
setCurrentPage(index.row());
|
||||
setCurrentPageByRow(index.row());
|
||||
}
|
||||
|
||||
void OpenPagesManager::closeCurrentPage()
|
||||
@@ -299,8 +298,6 @@ void OpenPagesManager::showTwicherOrSelectPage() const
|
||||
}
|
||||
}
|
||||
|
||||
// -- private slots
|
||||
|
||||
void OpenPagesManager::openPagesContextMenu(const QPoint &point)
|
||||
{
|
||||
const QModelIndex &index = m_model->index(m_comboBox->currentIndex(), 0);
|
||||
|
@@ -58,11 +58,10 @@ public:
|
||||
int pageCount() const;
|
||||
void setupInitialPages();
|
||||
|
||||
public slots:
|
||||
HelpViewer *createPage();
|
||||
HelpViewer *createPage(const QUrl &url);
|
||||
|
||||
void setCurrentPage(int index);
|
||||
void setCurrentPageByRow(int index);
|
||||
void setCurrentPage(const QModelIndex &index);
|
||||
|
||||
void closeCurrentPage();
|
||||
@@ -78,11 +77,8 @@ signals:
|
||||
private:
|
||||
void removePage(int index);
|
||||
void showTwicherOrSelectPage() const;
|
||||
|
||||
private slots:
|
||||
void openPagesContextMenu(const QPoint &point);
|
||||
|
||||
private:
|
||||
QComboBox *m_comboBox;
|
||||
OpenPagesModel *m_model;
|
||||
mutable OpenPagesWidget *m_openPagesWidget;
|
||||
|
@@ -50,10 +50,9 @@ public:
|
||||
void removePage(int index);
|
||||
HelpViewer *pageAt(int index) const;
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void handleTitleChanged();
|
||||
|
||||
private:
|
||||
QList<HelpViewer *> m_pages;
|
||||
};
|
||||
|
||||
|
@@ -53,10 +53,10 @@ OpenPagesWidget::OpenPagesWidget(OpenPagesModel *sourceModel, QWidget *parent)
|
||||
this, &OpenPagesWidget::handleCloseActivated);
|
||||
connect(this, &OpenDocumentsTreeView::customContextMenuRequested,
|
||||
this, &OpenPagesWidget::contextMenuRequested);
|
||||
connect(model(), SIGNAL(rowsInserted(QModelIndex,int,int)),
|
||||
this, SLOT(updateCloseButtonVisibility()));
|
||||
connect(model(), SIGNAL(rowsRemoved(QModelIndex,int,int)),
|
||||
this, SLOT(updateCloseButtonVisibility()));
|
||||
connect(model(), &QAbstractItemModel::rowsInserted,
|
||||
this, &OpenPagesWidget::updateCloseButtonVisibility);
|
||||
connect(model(), &QAbstractItemModel::rowsRemoved,
|
||||
this, &OpenPagesWidget::updateCloseButtonVisibility);
|
||||
}
|
||||
|
||||
OpenPagesWidget::~OpenPagesWidget()
|
||||
@@ -77,7 +77,7 @@ void OpenPagesWidget::allowContextMenu(bool ok)
|
||||
m_allowContextMenu = ok;
|
||||
}
|
||||
|
||||
// -- private slots
|
||||
// -- private
|
||||
|
||||
void OpenPagesWidget::contextMenuRequested(QPoint pos)
|
||||
{
|
||||
|
@@ -49,13 +49,12 @@ signals:
|
||||
void closePage(const QModelIndex &index);
|
||||
void closePagesExcept(const QModelIndex &index);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void contextMenuRequested(QPoint pos);
|
||||
void handleActivated(const QModelIndex &index);
|
||||
void handleCloseActivated(const QModelIndex &index);
|
||||
void updateCloseButtonVisibility();
|
||||
|
||||
private:
|
||||
bool m_allowContextMenu;
|
||||
};
|
||||
|
||||
|
@@ -94,9 +94,9 @@ HelpNetworkReply::HelpNetworkReply(const QNetworkRequest &request,
|
||||
|
||||
setHeader(QNetworkRequest::ContentTypeHeader, mimeType);
|
||||
setHeader(QNetworkRequest::ContentLengthHeader, QByteArray::number(dataLength));
|
||||
QTimer::singleShot(0, this, SIGNAL(metaDataChanged()));
|
||||
QTimer::singleShot(0, this, SIGNAL(readyRead()));
|
||||
QTimer::singleShot(0, this, SIGNAL(finished()));
|
||||
QTimer::singleShot(0, this, &QNetworkReply::metaDataChanged);
|
||||
QTimer::singleShot(0, this, &QIODevice::readyRead);
|
||||
QTimer::singleShot(0, this, &QNetworkReply::finished);
|
||||
}
|
||||
|
||||
qint64 HelpNetworkReply::readData(char *buffer, qint64 maxlen)
|
||||
@@ -145,8 +145,8 @@ QtWebKitHelpPage::QtWebKitHelpPage(QObject *parent)
|
||||
, m_keyboardModifiers(Qt::NoModifier)
|
||||
{
|
||||
setForwardUnsupportedContent(true);
|
||||
connect(this, SIGNAL(unsupportedContent(QNetworkReply*)), this,
|
||||
SLOT(onHandleUnsupportedContent(QNetworkReply*)));
|
||||
connect(this, &QWebPage::unsupportedContent, this,
|
||||
&QtWebKitHelpPage::onHandleUnsupportedContent);
|
||||
}
|
||||
|
||||
QWebPage *QtWebKitHelpPage::createWindow(QWebPage::WebWindowType)
|
||||
@@ -257,8 +257,8 @@ QtWebKitHelpWidget::QtWebKitHelpWidget(QtWebKitHelpViewer *parent)
|
||||
setPage(new QtWebKitHelpPage(this));
|
||||
HelpNetworkAccessManager *manager = new HelpNetworkAccessManager(this);
|
||||
page()->setNetworkAccessManager(manager);
|
||||
connect(manager, SIGNAL(finished(QNetworkReply*)), this,
|
||||
SLOT(slotNetworkReplyFinished(QNetworkReply*)));
|
||||
connect(manager, &QNetworkAccessManager::finished, this,
|
||||
&QtWebKitHelpWidget::slotNetworkReplyFinished);
|
||||
|
||||
QAction* action = pageAction(QWebPage::OpenLinkInNewWindow);
|
||||
action->setText(tr("Open Link as New Page"));
|
||||
@@ -267,12 +267,12 @@ QtWebKitHelpWidget::QtWebKitHelpWidget(QtWebKitHelpViewer *parent)
|
||||
pageAction(QWebPage::DownloadImageToDisk)->setVisible(false);
|
||||
pageAction(QWebPage::OpenImageInNewWindow)->setVisible(false);
|
||||
|
||||
connect(pageAction(QWebPage::Copy), SIGNAL(changed()), this,
|
||||
SLOT(actionChanged()));
|
||||
connect(pageAction(QWebPage::Back), SIGNAL(changed()), this,
|
||||
SLOT(actionChanged()));
|
||||
connect(pageAction(QWebPage::Forward), SIGNAL(changed()), this,
|
||||
SLOT(actionChanged()));
|
||||
connect(pageAction(QWebPage::Copy), &QAction::changed, this,
|
||||
&QtWebKitHelpWidget::actionChanged);
|
||||
connect(pageAction(QWebPage::Back), &QAction::changed, this,
|
||||
&QtWebKitHelpWidget::actionChanged);
|
||||
connect(pageAction(QWebPage::Forward), &QAction::changed, this,
|
||||
&QtWebKitHelpWidget::actionChanged);
|
||||
}
|
||||
|
||||
QtWebKitHelpWidget::~QtWebKitHelpWidget()
|
||||
@@ -289,8 +289,6 @@ void QtWebKitHelpWidget::scaleDown()
|
||||
setZoomFactor(qMax(qreal(0.0), zoomFactor() - qreal(0.1)));
|
||||
}
|
||||
|
||||
// -- public slots
|
||||
|
||||
void QtWebKitHelpWidget::copy()
|
||||
{
|
||||
triggerPageAction(QWebPage::Copy);
|
||||
@@ -348,7 +346,7 @@ void QtWebKitHelpWidget::contextMenuEvent(QContextMenuEvent *event)
|
||||
delete menu;
|
||||
}
|
||||
|
||||
// -- private slots
|
||||
// -- private
|
||||
|
||||
void QtWebKitHelpWidget::actionChanged()
|
||||
{
|
||||
@@ -395,13 +393,13 @@ QtWebKitHelpViewer::QtWebKitHelpViewer(QWidget *parent)
|
||||
p.setColor(QPalette::Text, Qt::black);
|
||||
setPalette(p);
|
||||
|
||||
connect(m_webView, SIGNAL(urlChanged(QUrl)), this, SIGNAL(sourceChanged(QUrl)));
|
||||
connect(m_webView, SIGNAL(loadStarted()), this, SLOT(slotLoadStarted()));
|
||||
connect(m_webView, SIGNAL(loadFinished(bool)), this, SLOT(slotLoadFinished()));
|
||||
connect(m_webView, SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged()));
|
||||
connect(m_webView->page(), SIGNAL(printRequested(QWebFrame*)), this, SIGNAL(printRequested()));
|
||||
connect(m_webView, SIGNAL(backwardAvailable(bool)), this, SIGNAL(backwardAvailable(bool)));
|
||||
connect(m_webView, SIGNAL(forwardAvailable(bool)), this, SIGNAL(forwardAvailable(bool)));
|
||||
connect(m_webView, &QWebView::urlChanged, this, &HelpViewer::sourceChanged);
|
||||
connect(m_webView, &QWebView::loadStarted, this, &QtWebKitHelpViewer::slotLoadStarted);
|
||||
connect(m_webView, &QWebView::loadFinished, this, &QtWebKitHelpViewer::slotLoadFinished);
|
||||
connect(m_webView, &QWebView::titleChanged, this, &HelpViewer::titleChanged);
|
||||
connect(m_webView->page(), &QWebPage::printRequested, this, &HelpViewer::printRequested);
|
||||
connect(m_webView, &QtWebKitHelpWidget::backwardAvailable, this, &HelpViewer::backwardAvailable);
|
||||
connect(m_webView, &QtWebKitHelpWidget::forwardAvailable, this, &HelpViewer::forwardAvailable);
|
||||
connect(page(), &QtWebKitHelpPage::linkHovered, this, &QtWebKitHelpViewer::setToolTip);
|
||||
}
|
||||
|
||||
@@ -531,7 +529,7 @@ void QtWebKitHelpViewer::addBackHistoryItems(QMenu *backMenu)
|
||||
QAction *action = new QAction(backMenu);
|
||||
action->setText(items.at(i).title());
|
||||
action->setData(i);
|
||||
connect(action, SIGNAL(triggered()), this, SLOT(goToBackHistoryItem()));
|
||||
connect(action, &QAction::triggered, this, &QtWebKitHelpViewer::goToBackHistoryItem);
|
||||
backMenu->addAction(action);
|
||||
}
|
||||
}
|
||||
@@ -545,7 +543,7 @@ void QtWebKitHelpViewer::addForwardHistoryItems(QMenu *forwardMenu)
|
||||
QAction *action = new QAction(forwardMenu);
|
||||
action->setText(items.at(i).title());
|
||||
action->setData(i);
|
||||
connect(action, SIGNAL(triggered()), this, SLOT(goToForwardHistoryItem()));
|
||||
connect(action, &QAction::triggered, this, &QtWebKitHelpViewer::goToForwardHistoryItem);
|
||||
forwardMenu->addAction(action);
|
||||
}
|
||||
}
|
||||
|
@@ -71,7 +71,6 @@ public:
|
||||
|
||||
QtWebKitHelpPage *page() const;
|
||||
|
||||
public slots:
|
||||
void scaleUp();
|
||||
void scaleDown();
|
||||
void resetScale();
|
||||
@@ -81,12 +80,11 @@ public slots:
|
||||
void backward();
|
||||
void print(QPrinter *printer);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void goToBackHistoryItem();
|
||||
void goToForwardHistoryItem();
|
||||
void goToHistoryItem(bool forward);
|
||||
|
||||
private:
|
||||
QString m_oldHighlightId;
|
||||
QString m_oldHighlightStyle;
|
||||
QtWebKitHelpWidget *m_webView;
|
||||
@@ -102,8 +100,6 @@ public:
|
||||
|
||||
void scaleUp();
|
||||
void scaleDown();
|
||||
|
||||
public slots:
|
||||
void copy();
|
||||
|
||||
signals:
|
||||
@@ -117,11 +113,9 @@ protected:
|
||||
void mouseReleaseEvent(QMouseEvent *event);
|
||||
void contextMenuEvent(QContextMenuEvent *event);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void actionChanged();
|
||||
void slotNetworkReplyFinished(QNetworkReply *reply);
|
||||
|
||||
private:
|
||||
bool eventFilter(QObject *obj, QEvent *event);
|
||||
|
||||
QtWebKitHelpViewer *m_parent;
|
||||
@@ -140,10 +134,9 @@ protected:
|
||||
virtual bool acceptNavigationRequest(QWebFrame *frame,
|
||||
const QNetworkRequest &request, NavigationType type);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void onHandleUnsupportedContent(QNetworkReply *reply);
|
||||
|
||||
private:
|
||||
QUrl m_loadingUrl;
|
||||
bool closeNewTabIfNeeded;
|
||||
|
||||
|
@@ -53,7 +53,8 @@ RemoteFilterOptions::RemoteFilterOptions(RemoteHelpFilter *filter, QWidget *pare
|
||||
this, &RemoteFilterOptions::addNewItem);
|
||||
connect(m_ui.remove, &QPushButton::clicked,
|
||||
this, &RemoteFilterOptions::removeItem);
|
||||
connect(m_ui.listWidget, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), SLOT(updateRemoveButton()));
|
||||
connect(m_ui.listWidget, &QListWidget::currentItemChanged,
|
||||
this, &RemoteFilterOptions::updateRemoveButton);
|
||||
updateRemoveButton();
|
||||
}
|
||||
|
||||
|
@@ -69,12 +69,11 @@ class RemoteFilterOptions : public QDialog
|
||||
public:
|
||||
explicit RemoteFilterOptions(RemoteHelpFilter *filter, QWidget *parent = 0);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void addNewItem();
|
||||
void removeItem();
|
||||
void updateRemoveButton();
|
||||
|
||||
private:
|
||||
RemoteHelpFilter *m_filter;
|
||||
Ui::RemoteFilterOptions m_ui;
|
||||
};
|
||||
|
@@ -131,24 +131,24 @@ void SearchWidget::showEvent(QShowEvent *event)
|
||||
|
||||
setFocusProxy(queryWidget);
|
||||
|
||||
connect(queryWidget, SIGNAL(search()), this, SLOT(search()));
|
||||
connect(queryWidget, &QHelpSearchQueryWidget::search, this, &SearchWidget::search);
|
||||
connect(resultWidget, &QHelpSearchResultWidget::requestShowLink, this,
|
||||
[this](const QUrl &url) {
|
||||
emit linkActivated(url, currentSearchTerms(), false/*newPage*/);
|
||||
});
|
||||
|
||||
connect(searchEngine, SIGNAL(searchingStarted()), this,
|
||||
SLOT(searchingStarted()));
|
||||
connect(searchEngine, SIGNAL(searchingFinished(int)), this,
|
||||
SLOT(searchingFinished(int)));
|
||||
connect(searchEngine, &QHelpSearchEngine::searchingStarted, this,
|
||||
&SearchWidget::searchingStarted);
|
||||
connect(searchEngine, &QHelpSearchEngine::searchingFinished, this,
|
||||
&SearchWidget::searchingFinished);
|
||||
|
||||
QTextBrowser* browser = resultWidget->findChild<QTextBrowser*>();
|
||||
browser->viewport()->installEventFilter(this);
|
||||
|
||||
connect(searchEngine, SIGNAL(indexingStarted()), this,
|
||||
SLOT(indexingStarted()));
|
||||
connect(searchEngine, SIGNAL(indexingFinished()), this,
|
||||
SLOT(indexingFinished()));
|
||||
connect(searchEngine, &QHelpSearchEngine::indexingStarted, this,
|
||||
&SearchWidget::indexingStarted);
|
||||
connect(searchEngine, &QHelpSearchEngine::indexingFinished, this,
|
||||
&SearchWidget::indexingFinished);
|
||||
|
||||
QMetaObject::invokeMethod(&LocalHelpManager::helpEngine(), "setupFinished",
|
||||
Qt::QueuedConnection);
|
||||
@@ -207,7 +207,8 @@ void SearchWidget::indexingStarted()
|
||||
m_progress->reportStarted();
|
||||
|
||||
m_watcher.setFuture(m_progress->future());
|
||||
connect(&m_watcher, SIGNAL(canceled()), searchEngine, SLOT(cancelIndexing()));
|
||||
connect(&m_watcher, &QFutureWatcherBase::canceled,
|
||||
searchEngine, &QHelpSearchEngine::cancelIndexing);
|
||||
}
|
||||
|
||||
void SearchWidget::indexingFinished()
|
||||
@@ -259,9 +260,9 @@ void SearchWidget::contextMenuEvent(QContextMenuEvent *contextMenuEvent)
|
||||
openLinkInNewTab = menu.addAction(tr("Open Link as New Page"));
|
||||
copyAnchorAction = menu.addAction(tr("Copy Link"));
|
||||
} else if (browser->textCursor().hasSelection()) {
|
||||
menu.addAction(tr("Copy"), browser, SLOT(copy()));
|
||||
connect(menu.addAction(tr("Copy")), &QAction::triggered, browser, &QTextEdit::copy);
|
||||
} else {
|
||||
menu.addAction(tr("Reload"), browser, SLOT(reload()));
|
||||
connect(menu.addAction(tr("Reload")), &QAction::triggered, browser, &QTextBrowser::reload);
|
||||
}
|
||||
|
||||
QAction *usedAction = menu.exec(mapToGlobal(contextMenuEvent->pos()));
|
||||
@@ -301,8 +302,8 @@ SearchSideBarItem::SearchSideBarItem()
|
||||
: SideBarItem(new SearchWidget, QLatin1String(Constants::HELP_SEARCH))
|
||||
{
|
||||
widget()->setWindowTitle(HelpPlugin::tr(Constants::SB_SEARCH));
|
||||
connect(widget(), SIGNAL(linkActivated(QUrl,QStringList,bool)),
|
||||
this, SIGNAL(linkActivated(QUrl,QStringList,bool)));
|
||||
connect(static_cast<SearchWidget *>(widget()), &SearchWidget::linkActivated,
|
||||
this, &SearchSideBarItem::linkActivated);
|
||||
}
|
||||
|
||||
QList<QToolButton *> SearchSideBarItem::createToolBarWidgets()
|
||||
@@ -310,7 +311,7 @@ QList<QToolButton *> SearchSideBarItem::createToolBarWidgets()
|
||||
QToolButton *reindexButton = new QToolButton;
|
||||
reindexButton->setIcon(Core::Icons::RELOAD.icon());
|
||||
reindexButton->setToolTip(tr("Regenerate Index"));
|
||||
connect(reindexButton, SIGNAL(clicked()),
|
||||
widget(), SLOT(reindexDocumentation()));
|
||||
connect(reindexButton, &QAbstractButton::clicked,
|
||||
static_cast<SearchWidget *>(widget()), &SearchWidget::reindexDocumentation);
|
||||
return QList<QToolButton *>() << reindexButton;
|
||||
}
|
||||
|
@@ -66,8 +66,6 @@ public:
|
||||
void zoomOut();
|
||||
void resetZoom();
|
||||
|
||||
|
||||
public slots:
|
||||
void reindexDocumentation();
|
||||
|
||||
signals:
|
||||
@@ -76,7 +74,7 @@ signals:
|
||||
protected:
|
||||
void showEvent(QShowEvent *event);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void search() const;
|
||||
|
||||
void searchingStarted();
|
||||
@@ -85,12 +83,10 @@ private slots:
|
||||
void indexingStarted();
|
||||
void indexingFinished();
|
||||
|
||||
private:
|
||||
bool eventFilter(QObject* o, QEvent *e);
|
||||
void contextMenuEvent(QContextMenuEvent *contextMenuEvent);
|
||||
QStringList currentSearchTerms() const;
|
||||
|
||||
private:
|
||||
int zoomCount;
|
||||
|
||||
QFutureWatcher<void> m_watcher;
|
||||
|
@@ -68,9 +68,9 @@ TextBrowserHelpViewer::TextBrowserHelpViewer(QWidget *parent)
|
||||
|
||||
connect(m_textBrowser, &TextBrowserHelpWidget::anchorClicked,
|
||||
this, &TextBrowserHelpViewer::setSource);
|
||||
connect(m_textBrowser, SIGNAL(sourceChanged(QUrl)), this, SIGNAL(titleChanged()));
|
||||
connect(m_textBrowser, SIGNAL(forwardAvailable(bool)), this, SIGNAL(forwardAvailable(bool)));
|
||||
connect(m_textBrowser, SIGNAL(backwardAvailable(bool)), this, SIGNAL(backwardAvailable(bool)));
|
||||
connect(m_textBrowser, &QTextBrowser::sourceChanged, this, &HelpViewer::titleChanged);
|
||||
connect(m_textBrowser, &QTextBrowser::forwardAvailable, this, &HelpViewer::forwardAvailable);
|
||||
connect(m_textBrowser, &QTextBrowser::backwardAvailable, this, &HelpViewer::backwardAvailable);
|
||||
}
|
||||
|
||||
TextBrowserHelpViewer::~TextBrowserHelpViewer()
|
||||
@@ -256,8 +256,6 @@ bool TextBrowserHelpViewer::findText(const QString &text, Core::FindFlags flags,
|
||||
return !cursorIsNull;
|
||||
}
|
||||
|
||||
// -- public slots
|
||||
|
||||
void TextBrowserHelpViewer::copy()
|
||||
{
|
||||
m_textBrowser->copy();
|
||||
@@ -386,9 +384,9 @@ void TextBrowserHelpWidget::contextMenuEvent(QContextMenuEvent *event)
|
||||
}
|
||||
copyAnchorAction = menu.addAction(tr("Copy Link"));
|
||||
} else if (!textCursor().selectedText().isEmpty()) {
|
||||
menu.addAction(tr("Copy"), this, SLOT(copy()));
|
||||
connect(menu.addAction(tr("Copy")), &QAction::triggered, this, &QTextEdit::copy);
|
||||
} else {
|
||||
menu.addAction(tr("Reload"), this, SLOT(reload()));
|
||||
connect(menu.addAction(tr("Reload")), &QAction::triggered, this, &QTextBrowser::reload);
|
||||
}
|
||||
|
||||
if (copyAnchorAction == menu.exec(event->globalPos()))
|
||||
|
@@ -67,7 +67,6 @@ public:
|
||||
bool findText(const QString &text, Core::FindFlags flags,
|
||||
bool incremental, bool fromSearch, bool *wrapped = 0);
|
||||
|
||||
public slots:
|
||||
void scaleUp();
|
||||
void scaleDown();
|
||||
void resetScale();
|
||||
@@ -77,10 +76,9 @@ public slots:
|
||||
void backward();
|
||||
void print(QPrinter *printer);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void goToHistoryItem();
|
||||
|
||||
private:
|
||||
TextBrowserHelpWidget *m_textBrowser;
|
||||
};
|
||||
|
||||
|
@@ -85,7 +85,6 @@ public:
|
||||
|
||||
WebEngineHelpPage *page() const;
|
||||
|
||||
public slots:
|
||||
void scaleUp() override;
|
||||
void scaleDown() override;
|
||||
void resetScale() override;
|
||||
|
@@ -102,8 +102,8 @@ BookmarkDialog::BookmarkDialog(BookmarkManager *manager, const QString &title,
|
||||
connect(ui.treeView, &TreeView::customContextMenuRequested,
|
||||
this, &BookmarkDialog::customContextMenuRequested);
|
||||
|
||||
connect(ui.treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)),
|
||||
this, SLOT(currentChanged(QModelIndex)));
|
||||
connect(ui.treeView->selectionModel(), &QItemSelectionModel::currentChanged,
|
||||
this, &BookmarkDialog::currentChanged);
|
||||
}
|
||||
|
||||
BookmarkDialog::~BookmarkDialog()
|
||||
|
@@ -64,7 +64,7 @@ public:
|
||||
const QString &url, QWidget *parent = 0);
|
||||
~BookmarkDialog();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void addAccepted();
|
||||
void addNewFolder();
|
||||
void toolButtonClicked();
|
||||
@@ -73,11 +73,8 @@ private slots:
|
||||
void selectBookmarkFolder(const QString &folderName);
|
||||
void customContextMenuRequested(const QPoint &point);
|
||||
void currentChanged(const QModelIndex& current);
|
||||
|
||||
private:
|
||||
bool eventFilter(QObject *object, QEvent *e);
|
||||
|
||||
private:
|
||||
QString m_url;
|
||||
QString m_title;
|
||||
|
||||
@@ -116,19 +113,16 @@ signals:
|
||||
void linkActivated(const QUrl &url);
|
||||
void createPage(const QUrl &url, bool fromSearch);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void removeClicked();
|
||||
void filterChanged();
|
||||
void expand(const QModelIndex& index);
|
||||
void activated(const QModelIndex &index);
|
||||
void customContextMenuRequested(const QPoint &point);
|
||||
|
||||
private:
|
||||
void setup();
|
||||
void expandItems();
|
||||
bool eventFilter(QObject *object, QEvent *event);
|
||||
|
||||
private:
|
||||
QRegExp regExp;
|
||||
TreeView *treeView;
|
||||
Utils::FancyLineEdit *searchField;
|
||||
@@ -168,16 +162,13 @@ public:
|
||||
void addNewBookmark(const QModelIndex &index, const QString &name, const QString &url);
|
||||
void setupBookmarkModels();
|
||||
|
||||
private slots:
|
||||
void itemChanged(QStandardItem *item);
|
||||
|
||||
private:
|
||||
void itemChanged(QStandardItem *item);
|
||||
QString uniqueFolderName() const;
|
||||
void removeBookmarkFolderItems(QStandardItem *item);
|
||||
void readBookmarksRecursive(const QStandardItem *item, QDataStream &stream,
|
||||
const qint32 depth) const;
|
||||
|
||||
private:
|
||||
const QIcon m_folderIcon;
|
||||
const QIcon m_bookmarkIcon;
|
||||
|
||||
|
@@ -32,11 +32,11 @@ FilterNameDialog::FilterNameDialog(QWidget *parent)
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
connect(m_ui.buttonBox->button(QDialogButtonBox::Ok),
|
||||
SIGNAL(clicked()), this, SLOT(accept()));
|
||||
&QAbstractButton::clicked, this, &QDialog::accept);
|
||||
connect(m_ui.buttonBox->button(QDialogButtonBox::Cancel),
|
||||
SIGNAL(clicked()), this, SLOT(reject()));
|
||||
connect(m_ui.lineEdit, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(updateOkButton()));
|
||||
&QAbstractButton::clicked, this, &QDialog::reject);
|
||||
connect(m_ui.lineEdit, &QLineEdit::textChanged,
|
||||
this, &FilterNameDialog::updateOkButton);
|
||||
m_ui.buttonBox->button(QDialogButtonBox::Ok)->setDisabled(true);
|
||||
|
||||
}
|
||||
|
@@ -36,9 +36,8 @@ public:
|
||||
FilterNameDialog(QWidget *parent = 0);
|
||||
QString filterName() const;
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void updateOkButton();
|
||||
|
||||
private:
|
||||
Ui::FilterNameDialogClass m_ui;
|
||||
};
|
||||
|
@@ -239,25 +239,25 @@ void IndexFilterModel::setSourceModel(QAbstractItemModel *sm)
|
||||
{
|
||||
QAbstractItemModel *previousModel = sourceModel();
|
||||
if (previousModel) {
|
||||
disconnect(previousModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
|
||||
this, SLOT(sourceDataChanged(QModelIndex,QModelIndex)));
|
||||
disconnect(previousModel, SIGNAL(rowsInserted(QModelIndex,int,int)),
|
||||
this, SLOT(sourceRowsInserted(QModelIndex,int,int)));
|
||||
disconnect(previousModel, SIGNAL(rowsRemoved(QModelIndex,int,int)),
|
||||
this, SLOT(sourceRowsRemoved(QModelIndex,int,int)));
|
||||
disconnect(previousModel, SIGNAL(modelReset()),
|
||||
this, SLOT(sourceModelReset()));
|
||||
disconnect(previousModel, &QAbstractItemModel::dataChanged,
|
||||
this, &IndexFilterModel::sourceDataChanged);
|
||||
disconnect(previousModel, &QAbstractItemModel::rowsInserted,
|
||||
this, &IndexFilterModel::sourceRowsInserted);
|
||||
disconnect(previousModel, &QAbstractItemModel::rowsRemoved,
|
||||
this, &IndexFilterModel::sourceRowsRemoved);
|
||||
disconnect(previousModel, &QAbstractItemModel::modelReset,
|
||||
this, &IndexFilterModel::sourceModelReset);
|
||||
}
|
||||
QAbstractProxyModel::setSourceModel(sm);
|
||||
if (sm) {
|
||||
connect(sm, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
|
||||
this, SLOT(sourceDataChanged(QModelIndex,QModelIndex)));
|
||||
connect(sm, SIGNAL(rowsInserted(QModelIndex,int,int)),
|
||||
this, SLOT(sourceRowsInserted(QModelIndex,int,int)));
|
||||
connect(sm, SIGNAL(rowsRemoved(QModelIndex,int,int)),
|
||||
this, SLOT(sourceRowsRemoved(QModelIndex,int,int)));
|
||||
connect(sm, SIGNAL(modelReset()),
|
||||
this, SLOT(sourceModelReset()));
|
||||
connect(sm, &QAbstractItemModel::dataChanged,
|
||||
this, &IndexFilterModel::sourceDataChanged);
|
||||
connect(sm, &QAbstractItemModel::rowsInserted,
|
||||
this, &IndexFilterModel::sourceRowsInserted);
|
||||
connect(sm, &QAbstractItemModel::rowsRemoved,
|
||||
this, &IndexFilterModel::sourceRowsRemoved);
|
||||
connect(sm, &QAbstractItemModel::modelReset,
|
||||
this, &IndexFilterModel::sourceModelReset);
|
||||
}
|
||||
filter(m_filter, m_wildcard);
|
||||
}
|
||||
|
@@ -65,13 +65,13 @@ public:
|
||||
QModelIndex sibling(int row, int column, const QModelIndex &idx) const;
|
||||
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
private slots:
|
||||
|
||||
private:
|
||||
void sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
|
||||
void sourceRowsRemoved(const QModelIndex &parent, int start, int end);
|
||||
void sourceRowsInserted(const QModelIndex &parent, int start, int end);
|
||||
void sourceModelReset();
|
||||
|
||||
private:
|
||||
QString m_filter;
|
||||
QString m_wildcard;
|
||||
QList<int> m_toSource;
|
||||
|
@@ -46,15 +46,12 @@ public:
|
||||
|
||||
QUrl link() const;
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void acceptDialog();
|
||||
void setFilter(const QString &pattern);
|
||||
void activated(const QModelIndex &index);
|
||||
|
||||
private:
|
||||
bool eventFilter(QObject *object, QEvent *event);
|
||||
|
||||
private:
|
||||
Ui::TopicChooser ui;
|
||||
QList<QUrl> m_links;
|
||||
|
||||
|
Reference in New Issue
Block a user