CuteLogger
Fast and simple logging solution for Qt based applications
recentdock.h
1/*
2 * Copyright (c) 2012-2020 Meltytech, LLC
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef RECENTDOCK_H
19#define RECENTDOCK_H
20
21#include <QDockWidget>
22#include <QStandardItemModel>
23#include <QSortFilterProxyModel>
24
25namespace Ui {
26class RecentDock;
27}
28
29class RecentDock : public QDockWidget
30{
31 Q_OBJECT
32
33public:
34 explicit RecentDock(QWidget *parent = 0);
35 ~RecentDock();
36
37signals:
38 void itemActivated(const QString &url);
39 void deleted(const QString &url);
40
41public slots:
42 void add(const QString &);
43 QString remove(const QString &s);
44 void find();
45
46protected:
47 void keyPressEvent(QKeyEvent *event);
48
49private:
50 Ui::RecentDock *ui;
51 QStringList m_recent;
52 QStandardItemModel m_model;
53 QSortFilterProxyModel m_proxyModel;
54
55private slots:
56 void on_listWidget_activated(const QModelIndex &i);
57 void on_lineEdit_textChanged(const QString &search);
58 void on_actionDelete_triggered();
59 void on_listWidget_customContextMenuRequested(const QPoint &pos);
60};
61
62#endif // RECENTDOCK_H