I am trying to make a browser button in PyQt5 and hence I tried reading the documentation for Qt regarding getOpenFileName. Here is an script of the documentation:
QString QFileDialog::getOpenFileName(QWidget *parent = nullptr, const QString &caption = QString(),
const QString &dir = QString(), const QString &filter = QString(), QString *selectedFilter = nullptr,
QFileDialog::Options options = Options())
What does the * mean in QWidget *parent or QString *selectedFilter = nullptr?
What does & mean in const QString &caption = QString()
Do these *,& apply for Qt use in C? or do they also apply if I use Python to use Qt?
I understand that:
The first argument is the parent class which also can be set to
noneThe second argument is a string which will be used as the caption of the window
const QString &filter = QString()means the filter to select files.
However, I do not understand QString *selectedFilter = nullptr. According to the documentation:
The filter selected is set to selectedFilter.
Is it the default filter? Then how to implement it? When I experiment it seems the first filter is the default one and hence it seems there is no need for this option!
*and&are pointers and references in C/C++.