Schim
insertcompleter.h
1 #ifndef INSERTCOMPLETER_H
2 #define INSERTCOMPLETER_H
3 
4 #include "completer.h"
5 #include "model/object.h"
6 #include "ui/vim.h"
7 
8 #include <QDialog>
9 
10 namespace Ui {
11 class InsertCompleter;
12 }
13 
14 class InsertCompleter : public QDialog
15 {
16  Q_OBJECT
17 
18 public:
19  explicit InsertCompleter(QWidget *parent);
20  ~InsertCompleter();
21 
22  void setVisible(bool visible) override;
23 
24 signals:
32  void insertionRequested(const Object &obj);
33 
34 private slots:
39  void onActivated(const QModelIndex &index);
40  void onFocusChanged(QWidget *a, QWidget *b);
41 
42 private:
43  // EVENTS
44  void keyPressEvent(QKeyEvent *event) override;
45  void mousePressEvent(QMouseEvent *event) override;
46  void mouseMoveEvent(QMouseEvent *event) override;
47 
48  // ATTRIBUTES
49  Ui::InsertCompleter *ui;
50  QPoint _moveOffset; // Used when moving the completer with the mouse
51  Completer *completer{};
52 };
53 
54 #endif // INSERTCOMPLETER_H
The abstract base class for all objects in a sheet.
Definition: object.h:21
Definition: mainwindow.h:16
Definition: insertcompleter.h:14
Custom QCompleter.
Definition: completer.h:67