16#include <QApplication>
28#include "../backend/bookshelfmodel/btbookshelffiltermodel.h"
29#include "../backend/bookshelfmodel/btbookshelftreemodel.h"
30#include "../backend/config/btconfig.h"
31#include "../util/btassert.h"
32#include "../util/btconnect.h"
33#include "../util/cresmgr.h"
43 , m_treeModel(nullptr)
44 , m_leftCornerWidget(nullptr)
45 , m_rightCornerWidget(nullptr)
72 static_cast<void *
>(module)));
141 QVBoxLayout *layout(
new QVBoxLayout);
142 layout->setContentsMargins(0, 8, 0, 0);
145 m_toolBar->setContentsMargins(3, 0, 0, 0);
175 m_groupingButton->setToolTip(tr(
"Change the grouping of items in the bookshelf."));
182 if (event->type() == QEvent::KeyPress) {
183 QKeyEvent *e =
static_cast<QKeyEvent*
>(event);
199 const QModelIndex& index,
201 QStringList * expandedPaths) {
202 QString path = index.data(Qt::DisplayRole).toString();
204 if (! prefix.isEmpty())
205 path = QStringLiteral(
"%1/%2").arg(prefix, path);
206 expandedPaths->append(path);
209 for (
int row = 0; row < rows; ++row) {
216 if (nodeList.isEmpty())
218 QString firstNode = nodeList.first();
219 QStringList remainingNodes = nodeList;
220 remainingNodes.removeFirst();
222 for (
int row = 0; row < rows; ++row) {
224 QString text = childIndex.data(Qt::DisplayRole).toString();
225 if (firstNode == text) {
236 QStringLiteral(
"GUI/MainWindow/Docks/Bookshelf/expandPaths"));
238 for (
auto const & path : paths) {
239 QStringList nodeList = path.split(
'/');
250 QStringLiteral(
"GUI/MainWindow/Docks/Bookshelf/expandPaths"),
BtConfig & btConfig()
This is a shortchand for BtConfig::getInstance().
void setShowHidden(bool show)
void setNameFilterFixedString(QString const &nameFilter)
auto const & list() const noexcept
void groupingOrderChanged(BtBookshelfTreeModel::Grouping newGrouping)
void setGroupingOrder(BtBookshelfTreeModel::Grouping const &groupingOrder, bool emitSignal=true)
Grouping const & groupingOrder() const
void setSourceModel(std::shared_ptr< QAbstractItemModel > sourceModel)
void contextMenuActivated(QPoint pos)
void moduleContextMenuActivated(CSwordModuleInfo *item, QPoint pos)
T value(QString const &key, T const &defaultValue=T()) const
Returns the settings value for the given global key.
void setValue(QString const &key, T const &value)
Sets a value for a key.