pqWidgetCompleter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
3 #ifndef pqWidgetCompleter_h
4 #define pqWidgetCompleter_h
5 
6 #include "pqWidgetsModule.h"
7 
8 #include <QCompleter>
9 #include <QWidget>
10 
16 class PQWIDGETS_EXPORT pqWidgetCompleter : public QCompleter
17 {
18 public:
19  pqWidgetCompleter(QWidget* parent) { this->setParent(parent); }
20 
25  virtual void updateCompletionModel(const QString& prompt);
26 
28 
32  bool getCompleteEmptyPrompts() { return this->CompleteEmptyPrompts; };
33  void setCompleteEmptyPrompts(bool newValue) { this->CompleteEmptyPrompts = newValue; };
35 
36 protected:
40  virtual QStringList getCompletions(const QString& prompt) = 0;
41 
45  virtual QString getCompletionPrefix(const QString& prompt) = 0;
46 
47 private:
48  bool CompleteEmptyPrompts = false;
49 };
50 #endif
pqWidgetCompleter(QWidget *parent)
Abstact class for widget completers.
#define PQWIDGETS_EXPORT
void setCompleteEmptyPrompts(bool newValue)
get/set CompleteEmptyPrompts, indicating whether or not the completer should show anything if an empt...
bool getCompleteEmptyPrompts()
get/set CompleteEmptyPrompts, indicating whether or not the completer should show anything if an empt...