| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
editor_file_dialog.h
Go to the documentation of this file.
1
11
12#ifndef EDITOR_FILE_DIALOG_H_
13#define EDITOR_FILE_DIALOG_H_
14
15#include <QModelIndex>
16#include <QLineEdit>
17#include <QFileDialog>
18#include <QPushButton>
19
23 class EditorFileDialog : public QLineEdit
24{
25 Q_OBJECT
26 public:
30 enum FileMode {
31 ExistingFile,
32 Directory
33 };
34
44 explicit EditorFileDialog(const QModelIndex& index, enum FileMode mode, QWidget* parent = 0, const QString & caption = QString(), const QString & directory = QString(), const QString & filter = QString());
45
51 void setOption(QFileDialog::Option option, bool on = true);
52
57 virtual void focusInEvent(QFocusEvent *event) override;
58
63 virtual void focusOutEvent(QFocusEvent *event) override;
64
71 virtual bool eventFilter(QObject *obj, QEvent *event) override;
72
73signals:
78 void acceptEdit(const QModelIndex& index);
79
80 private slots:
84 void applyFilename();
85
86 protected:
90 void resizeEvent(QResizeEvent *) override;
91
93 QPushButton* file_dialog_button_;
94
96 const QModelIndex index_;
97
99 enum FileMode mode_;
100
102 QString caption_;
103
105 QString directory_;
106
108 QString filter_;
109
111 QFileDialog::Options options_;
112};
113
114#endif /* EDITOR_FILE_DIALOG_H_ */
EditorFileDialog::EditorFileDialog
EditorFileDialog(const QModelIndex &index, enum FileMode mode, QWidget *parent=0, const QString &caption=QString(), const QString &directory=QString(), const QString &filter=QString())
Constructs a new EditorFileDialog.
Definition editor_file_dialog.cpp:20
EditorFileDialog::focusOutEvent
virtual void focusOutEvent(QFocusEvent *event) override
Handles focus out events.
Definition editor_file_dialog.cpp:61
EditorFileDialog::setOption
void setOption(QFileDialog::Option option, bool on=true)
Sets or unsets a QFileDialog option.
Definition editor_file_dialog.cpp:40
EditorFileDialog::file_dialog_button_
QPushButton * file_dialog_button_
Definition editor_file_dialog.h:93
EditorFileDialog::acceptEdit
void acceptEdit(const QModelIndex &index)
Signal emitted to accept the edit and update the model.
EditorFileDialog::mode_
enum FileMode mode_
Definition editor_file_dialog.h:99
EditorFileDialog::focusInEvent
virtual void focusInEvent(QFocusEvent *event) override
Handles focus in events.
Definition editor_file_dialog.cpp:55
EditorFileDialog::options_
QFileDialog::Options options_
Definition editor_file_dialog.h:111
EditorFileDialog::filter_
QString filter_
Definition editor_file_dialog.h:108
EditorFileDialog::directory_
QString directory_
Definition editor_file_dialog.h:105
EditorFileDialog::resizeEvent
void resizeEvent(QResizeEvent *) override
Handles resize events to adjust the layout of the line edit and button.
Definition editor_file_dialog.cpp:79
EditorFileDialog::index_
const QModelIndex index_
Definition editor_file_dialog.h:96
EditorFileDialog::caption_
QString caption_
Definition editor_file_dialog.h:102
EditorFileDialog::FileMode
FileMode
Determines whether the dialog selects files or directories.
Definition editor_file_dialog.h:30
EditorFileDialog::Directory
@ Directory
Definition editor_file_dialog.h:32
EditorFileDialog::ExistingFile
@ ExistingFile
Definition editor_file_dialog.h:31
EditorFileDialog::eventFilter
virtual bool eventFilter(QObject *obj, QEvent *event) override
Event filter to monitor specific events on the widget or its children.
Definition editor_file_dialog.cpp:67