Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
bookmarkmanager.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3#ifndef BOOKMARKMANAGER_H
4#define BOOKMARKMANAGER_H
5
6#include <QtCore/QMutex>
7#include <QtWidgets/QTreeView>
8
9#include "ui_bookmarkwidget.h"
10
12
14class BookmarkModel;
16class QKeyEvent;
17class QSortFilterProxyModel;
18class QToolBar;
19
21{
23 class BookmarkWidget;
24 class BookmarkTreeView;
25 class BookmarkListView;
27
28public:
29 static BookmarkManager* instance();
30 static void destroy();
31
33 void setBookmarksMenu(QMenu* menu);
34 void setBookmarksToolbar(QToolBar *toolBar);
35
36public slots:
37 void addBookmark(const QString &title, const QString &url);
38
41 void setSource(const QUrl &url);
42 void setSourceInNewTab(const QUrl &url);
43
44private:
45 BookmarkManager();
47
48 void removeItem(const QModelIndex &index);
49 bool eventFilter(QObject *object, QEvent *event) override;
50 void buildBookmarksMenu(const QModelIndex &index, QMenu *menu);
51 void showBookmarkDialog(const QString &name, const QString &url);
52
53private slots:
54 void setupFinished();
55 void storeBookmarks();
56
57 void addBookmarkActivated();
58 void removeBookmarkActivated();
59 void manageBookmarks();
60 void refreshBookmarkMenu();
61 void refreshBookmarkToolBar();
62 void renameBookmark(const QModelIndex &index);
63
64 void setSourceFromAction();
65 void setSourceFromIndex(const QModelIndex &index, bool newTab);
66
67 void focusInEventOccurred();
68 void managerWidgetAboutToClose();
69 void textChanged(const QString &text);
70 void customContextMenuRequested(const QPoint &point);
71
72private:
73 bool typeAndSearch = false;
74
75 static QMutex mutex;
76 static BookmarkManager *bookmarkManager;
77
78 QMenu *bookmarkMenu = nullptr;
79 QToolBar *m_toolBar = nullptr;
80
81 BookmarkModel *bookmarkModel;
82 BookmarkFilterModel *bookmarkFilterModel = nullptr;
83 QSortFilterProxyModel *typeAndSearchModel = nullptr;
84
85 BookmarkWidget *bookmarkWidget;
86 BookmarkTreeView *bookmarkTreeView;
87 BookmarkManagerWidget *bookmarkManagerWidget = nullptr;
88};
89
91{
93public:
95 : QWidget(parent) { ui.setupUi(this); }
97
99
100signals:
102
103private:
104 void focusInEvent(QFocusEvent *event) override;
105};
106
108{
110public:
111 BookmarkTreeView(QWidget *parent = nullptr);
113
114 void subclassKeyPressEvent(QKeyEvent *event);
115
116signals:
118
119protected slots:
121
122private slots:
123 void setExpandedData(const QModelIndex &index);
124};
125
126QT_END_NAMESPACE
127
128#endif // BOOKMARKMANAGER_H
QString documentTitle() const
void setText(const QString &text, const QByteArray &resources)
void setPixmap(const QPixmap &pixmap)
QSize minimumSizeHint() const override
QVariant loadResource(int type, const QUrl &name) override
This function is called when the document is loaded and for each image in the document.
void doSetSource(const QUrl &name, QTextDocument::ResourceType type) override
Attempts to load the document at the given url with the specified type.
void setText(const QString &text, const QByteArray &resources)
void subclassKeyPressEvent(QKeyEvent *event)
void focusInEvent(QFocusEvent *event) override
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus receive...
void setBookmarksToolbar(QToolBar *toolBar)
void setSource(const QUrl &url)
void setSourceInNewTab(const QUrl &url)
QWidget * bookmarkDockWidget() const
~BookmarkManager() override
static void destroy()
bool eventFilter(QObject *object, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
static CentralWidget * instance()
HelpViewer * currentHelpViewer() const
void updateUserInterface()
ShowState index() const
ShowState contents() const
ShowState bookmarks() const
bool enableRemoteControl() const
bool collectionFileGiven() const
ShowState search() const
void escapePressed()
void expandToDepth(int depth)
QAction * findAction() const
QAction * zoomInAction() const
QAction * nextAction() const
QAction * homeAction() const
QAction * backAction() const
QAction * printAction() const
QAction * zoomOutAction() const
QHelpFilterEngine * filterEngine() const
QHelpSearchEngine * searchEngine() const
static HelpEngineWrapper & instance()
bool addressBarEnabled() const
bool addressBarVisible() const
void setUseBrowserFont(bool useBrowserFont)
QHelpIndexModel * indexModel() const
bool filterFunctionalityEnabled() const
bool filterToolbarVisible() const
void setUseAppFont(bool useAppFont)
QHelpContentModel * contentModel() const
void escapePressed()
void closeEvent(QCloseEvent *event) override
[21]
void setIndexString(const QString &str)
~MainWindow() override
void syncContents()
void setBookmarksVisible(bool visible)
static void activateCurrentBrowser()
void activateCurrentCentralWidgetTab()
void expandTOC(int depth)
void setIndexVisible(bool visible)
void setSearchVisible(bool visible)
void currentFilterChanged(const QString &filter)
bool usesDefaultCollection() const
QAbstractItemView * openPagesWidget() const
HelpViewer * createNewPageFromSearch(const QUrl &url)
void pageAdded(int index)
HelpViewer * createBlankPage()
static OpenPagesManager * instance()
void updateApplicationFont()
void updateUserInterface()
void docsInstalled(bool newDocsInstalled)
QUrl link() const
Combined button and popup list for selecting options.
static const char * docs[]
static QStringList newQtDocumentation()
@ warnAboutMissingModules
#define TRACE_OBJ
Definition tracer.h:34