Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
editor_file_dialog.h
Go to the documentation of this file.
1
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
23class EditorFileDialog : public QLineEdit
24{
25 Q_OBJECT
26public:
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);
58
63 virtual void focusOutEvent(QFocusEvent *event);
64
71 virtual bool eventFilter(QObject *obj, QEvent *event);
72
73signals:
78 void acceptEdit(const QModelIndex& index);
79
80private slots:
84 void applyFilename();
85
86protected:
90 void resizeEvent(QResizeEvent *);
91
93 QPushButton* file_dialog_button_;
94
96 const QModelIndex index_;
97
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_ */
A QLineEdit combined with a file dialog button, designed for use as a table cell editor.
Definition editor_file_dialog.h:24
virtual bool eventFilter(QObject *obj, QEvent *event)
Event filter to monitor specific events on the widget or its children.
Definition editor_file_dialog.cpp:67
void setOption(QFileDialog::Option option, bool on=true)
Sets or unsets a QFileDialog option.
Definition editor_file_dialog.cpp:40
QPushButton * file_dialog_button_
Definition editor_file_dialog.h:93
void acceptEdit(const QModelIndex &index)
Signal emitted to accept the edit and update the model.
virtual void focusInEvent(QFocusEvent *event)
Handles focus in events.
Definition editor_file_dialog.cpp:55
enum FileMode mode_
Definition editor_file_dialog.h:99
virtual void focusOutEvent(QFocusEvent *event)
Handles focus out events.
Definition editor_file_dialog.cpp:61
QFileDialog::Options options_
Definition editor_file_dialog.h:111
QString filter_
Definition editor_file_dialog.h:108
QString directory_
Definition editor_file_dialog.h:105
const QModelIndex index_
Definition editor_file_dialog.h:96
QString caption_
Definition editor_file_dialog.h:102
FileMode
Determines whether the dialog selects files or directories.
Definition editor_file_dialog.h:30
@ Directory
Definition editor_file_dialog.h:32
@ ExistingFile
Definition editor_file_dialog.h:31
void resizeEvent(QResizeEvent *)
Handles resize events to adjust the layout of the line edit and button.
Definition editor_file_dialog.cpp:79