mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
convert VOutline to VTreeWidget to support simple search
This commit is contained in:
parent
878a272777
commit
8158d22bb4
@ -11,14 +11,13 @@
|
||||
extern VNote *g_vnote;
|
||||
|
||||
VOutline::VOutline(QWidget *parent)
|
||||
: QTreeWidget(parent),
|
||||
: VTreeWidget(parent),
|
||||
VNavigationMode(),
|
||||
m_muted(false)
|
||||
{
|
||||
setColumnCount(1);
|
||||
setHeaderHidden(true);
|
||||
setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||
|
||||
// TODO: jump to the header when user click the same item twice.
|
||||
connect(this, &VOutline::currentItemChanged,
|
||||
@ -219,7 +218,7 @@ void VOutline::keyPressEvent(QKeyEvent *event)
|
||||
break;
|
||||
}
|
||||
|
||||
QTreeWidget::keyPressEvent(event);
|
||||
VTreeWidget::keyPressEvent(event);
|
||||
}
|
||||
|
||||
void VOutline::showNavigation()
|
||||
|
@ -1,10 +1,11 @@
|
||||
#ifndef VOUTLINE_H
|
||||
#define VOUTLINE_H
|
||||
|
||||
#include <QTreeWidget>
|
||||
#include <QVector>
|
||||
#include <QMap>
|
||||
#include <QChar>
|
||||
|
||||
#include "vtreewidget.h"
|
||||
#include "vtableofcontent.h"
|
||||
#include "vnavigationmode.h"
|
||||
|
||||
@ -12,7 +13,7 @@ class QLabel;
|
||||
|
||||
// Display table of content as a tree and enable user to click an item to
|
||||
// jump to that header.
|
||||
class VOutline : public QTreeWidget, public VNavigationMode
|
||||
class VOutline : public VTreeWidget, public VNavigationMode
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QSet>
|
||||
#include <QScrollBar>
|
||||
#include <QDebug>
|
||||
#include <QGraphicsOpacityEffect>
|
||||
#include <QTimer>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user