20 #include <QGridLayout> 21 #include <QFileDialog> 28 , mPhotoLabel( nullptr )
29 , mPhotoPixmapLabel( nullptr )
30 , mLineEdit( nullptr )
38 void QgsPhotoWidgetWrapper::selectFileName()
57 void QgsPhotoWidgetWrapper::loadPixmap(
const QString& fileName )
61 if (
QUrl( fileName ).isRelative() )
67 mWebView->setUrl( filePath );
72 if ( !pm.
isNull() && mPhotoLabel )
84 if ( mPhotoPixmapLabel )
97 pm = pm.
scaled( size, Qt::KeepAspectRatio, Qt::SmoothTransformation );
112 v = mLineEdit->
text();
141 mLineEdit = qobject_cast<
QLineEdit*>( editor );
143 mWebView = qobject_cast<
QWebView*>( editor );
173 connect( mButton, SIGNAL( clicked() ),
this, SLOT( selectFileName() ) );
192 return mPhotoLabel || mLineEdit || mButton || mWebView;
194 return mPhotoLabel || mLineEdit || mButton;
QString toNativeSeparators(const QString &pathName)
void setHeight(int height)
QString relativeFilePath(const QString &fileName) const
void setPixmap(const QPixmap &)
void setPixmap(const QPixmap &)
QString filePath(const QString &fileName) const
QString tr(const char *sourceText, const char *disambiguation, int n)
void setObjectName(const QString &name)
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
Lineedit with builtin clear button.
QPixmap scaled(int width, int height, Qt::AspectRatioMode aspectRatioMode, Qt::TransformationMode transformMode) const
QString cleanPath(const QString &path)
QVariant value(const QString &key, const QVariant &defaultValue) const
static QgsProject * instance()
access to canonical QgsProject 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)
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.
The QgsPixmapLabel class shows a pixmap and adjusts its size to the space given to the widget by the ...
T findChild(const QString &name) const