21 #include <QFileDialog> 23 #include <QGridLayout> 27 , mLineEdit( nullptr )
28 , mPushButton( nullptr )
42 value = mLineEdit->
text();
46 value = mLabel->
text();
53 return mLineEdit || mLabel;
88 mLineEdit = qobject_cast<
QLineEdit*>( editor );
97 connect( mPushButton, SIGNAL( clicked() ),
this, SLOT( selectFileName() ) );
99 mLabel = qobject_cast<
QLabel*>( editor );
127 void QgsFileNameWidgetWrapper::selectFileName()
132 text = mLineEdit->
text();
135 text = mLabel->
text();
149 mLineEdit->
setText( fileName );
152 mLineEdit->
setText( fileName );
155 void QgsFileNameWidgetWrapper::updateConstraintWidgetStatus(
bool constraintValid )
159 if ( constraintValid )
163 mLineEdit->
setStyleSheet(
"QgsFilterLineEdit { background-color: #dd7777; }" );
QString toNativeSeparators(const QString &pathName)
QString relativeFilePath(const QString &fileName) const
QString tr(const char *sourceText, const char *disambiguation, int n)
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
QLineEdit subclass with built in support for clearing the widget's value and handling custom null val...
void setMargin(int margin)
QString cleanPath(const QString &path)
QVariant value(const QString &key, const QVariant &defaultValue) const
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
static QgsProject * instance()
Returns the QgsProject singleton instance.
QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFlags< QFileDialog::Option > options)
void setNullValue(const QString &nullValue)
Sets the string representation for null values in the widget.
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Represents a vector layer which manages a vector based data sets.
QVariant::Type type() const
Gets variant type of the field as it will be retrieved from data source.
T findChild(const QString &name) const