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