45 #ifndef QT_NO_FILEDIALOG 65 if (!qvariant_cast<bool>(value))
112 for (
int i = 0; i < indexes.
count(); ++i) {
121 #ifndef QT_NO_DRAGANDDROP 133 const QList<QUrl> list =
event->mimeData()->urls();
134 for (
int i = 0; i < list.
count(); ++i) {
157 #endif // QT_NO_DRAGANDDROP 214 if (size.
width() < 32) {
246 for (
int i = list.
count() - 1; i >= 0; --i) {
254 for (
int j = 0; move && j <
rowCount(); ++j) {
256 #if defined(Q_OS_WIN) 283 for (
int i = 0; i <
rowCount(); ++i)
327 if ( index.
row() >= topLeft.
row()
328 && index.
row() <= bottomRight.
row()
346 for (
int i = 0; i < paths.
count(); ++i) {
362 for (
int i = 0; i <
rowCount(); ++i) {
386 #ifndef QT_NO_DRAGANDDROP 400 #ifndef QT_NO_DRAGANDDROP 406 #endif // QT_NO_DRAGANDDROP 441 if (
indexAt(position).isValid()) {
448 if (actions.
count() > 0)
462 for (
int i = 0; i < idxs.
count(); i++)
465 for (
int i = 0; i < indexes.
count(); ++i)
The QVariant class acts like a union for the most common Qt data types.
QSize sizeHintForIndex(const QModelIndex &index) const
Returns the size hint for the item with the specified index or an invalid size for invalid indexes...
int row() const
Returns the row this persistent model index refers to.
QMimeData * mimeData(const QModelIndexList &indexes) const
Reimplemented Function
The QKeyEvent class describes a key event.
The QFileSystemModel class provides a data model for the local filesystem.
bool isValid() const
Returns true if the URL is valid; otherwise returns false.
virtual void clear()
Clears the selection model.
bool removeRow(int row, const QModelIndex &parent=QModelIndex())
Removes the given row from the child items of the parent specified.
QList< QUrl > urls() const
Return the complete list of urls in a QList.
void addPixmap(const QPixmap &pixmap, Mode mode=Normal, State state=Off)
Adds pixmap to the icon, as a specialization for mode and state.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
virtual QStringList formats() const
Returns a list of formats supported by the object.
QPixmap scaledToWidth(int w, Qt::TransformationMode mode=Qt::FastTransformation) const
Returns a scaled copy of the image.
QVariant data(int role=Qt::DisplayRole) const
Returns the data for the given role for the item referred to by the index.
bool isNull() const
Returns true if this is a NULL variant, false otherwise.
QStyle::State state
the style flags that are used when drawing the control
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
QModelIndexList selectedIndexes() const
Returns a list of all selected model item indexes.
void setIconSize(const QSize &size)
bool canDrop(QDragEnterEvent *event)
Decide based upon the data if it should be accepted or not.
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
Qt::ItemFlags flags(const QModelIndex &index) const
Reimplemented Function
virtual QIcon icon(IconType type) const
Returns an icon set for the given type.
void changed(const QString &path)
The following path changed data update our copy of that data.
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Reimplemented Function
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int count(const T &t) const
Returns the number of occurrences of value in the list.
The QStandardItemModel class provides a generic model for storing custom data.
QFileSystemModel * fileSystemModel
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Reimplemented Function
QFileIconProvider * iconProvider() const
Returns the file icon provider for this directory model.
The QObject class is the base class of all Qt objects.
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
void setUniformItemSizes(bool enable)
QModelIndex indexAt(const QPoint &p) const
Reimplemented Function
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
QVariant data(int role=Qt::DisplayRole) const
Returns the data for the given role for the item referred to by the index.
QString path() const
Returns the path of the URL.
bool event(QEvent *e)
Reimplemented Function
void currentChanged(const QModelIndex ¤t, const QModelIndex &previous)
Reimplemented Function
QStringList mimeTypes() const
Reimplemented Function
virtual void setModel(QAbstractItemModel *model)
Sets the model for the view to present.
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const =0
Returns the index of the item in the model specified by the given row, column and parent index...
int key() const
Returns the code of the key that was pressed or released.
int width() const
Returns the width.
void append(const T &t)
Inserts value at the end of the list.
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
void setUrl(const QModelIndex &index, const QUrl &url, const QModelIndex &dirIndex)
#define QT_BEGIN_NAMESPACE
This macro expands to.
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
static bool isEmpty(const char *str)
QList< QUrl > invalidUrls
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex())
Reimplemented Function
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Reimplemented Function
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QItemSelectionModel * selectionModel() const
Returns the current selection model.
Qt::ItemFlags flags(const QModelIndex &index) const
Reimplemented Function
int row() const
Returns the row this model index refers to.
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
Reimplemented Function
void setUrls(const QList< QUrl > &list)
const T & at(int i) const
Returns the item at index position i in the list.
const QAbstractItemModel * model() const
Returns a pointer to the model containing the item that this index refers to.
bool isDir(const QModelIndex &index) const
Returns true if the model item index represents a directory; otherwise returns false.
The QStringList class provides a list of strings.
QUrlModel(QObject *parent=0)
QUrlModel lets you have indexes from a QFileSystemModel to a list.
void setCurrentIndex(const QModelIndex &index)
Sets the current item to be the item at index.
void setUrls(const QList< QUrl > &urls)
Sets the URLs stored in the MIME data object to those specified by urls.
int rowCount(const QModelIndex &parent=QModelIndex()) const
Reimplemented Function
void setDragDropMode(DragDropMode behavior)
QVariant myComputer(int role=Qt::DisplayRole) const
Returns the data stored under the given role for the item "My Computer".
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
QList< QUrl > urls() const
Returns a list of URLs contained within the MIME data object.
void clear()
Removes all items from the list.
static QString cleanPath(const QString &path)
Removes all multiple directory separators "/" and resolves any "."s or ".."s found in the path...
QList< QPair< QModelIndex, QString > > watching
The QMimeData class provides a container for data that records information about its MIME type...
QString toLocalFile() const
Returns the path of this URL formatted as a local file path.
QUrl toUrl() const
Returns the variant as a QUrl if the variant has type() Url ; otherwise returns an invalid QUrl...
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
bool insertColumns(int column, int count, const QModelIndex &parent=QModelIndex())
Reimplemented Function
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
QString scheme() const
Returns the scheme of the URL.
The QListView class provides a list or icon view onto a model.
qint64 cacheKey() const
Returns a number that identifies the contents of this QIcon object.
void layoutChanged()
Re-get all of our data, anything could have changed!
void dragEnterEvent(QDragEnterEvent *event)
This function is called with the given event when a drag and drop operation enters the widget...
virtual void select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
Selects the model item index using the specified command, and emits selectionChanged().
QSize actualSize(const QSize &size, Mode mode=Normal, State state=Off) const
Returns the actual size of the icon for the requested size, mode, and state.
Type type() const
Returns the storage type of the value stored in the variant.
QObject * parent() const
Returns a pointer to the parent object.
void addUrls(const QList< QUrl > &urls, int row=-1, bool move=true)
Add urls list into the list at row.
Q_OUTOFLINE_TEMPLATE QPair< T1, T2 > qMakePair(const T1 &x, const T2 &y)
The QDragEnterEvent class provides an event which is sent to a widget when a drag and drop action ent...
The QPoint class defines a point in the plane using integer precision.
QString toLower() const Q_REQUIRED_RESULT
Returns a lowercase copy of the string.
The QModelIndex class is used to locate data in a data model.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Reimplemented Function
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Reimplemented Function
bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex())
Reimplemented Function
T qvariant_cast(const QVariant &)
The QPixmap class is an off-screen image representation that can be used as a paint device...
virtual void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const
Initialize option with the values using the index index.
QPixmap pixmap(const QSize &size, Mode mode=Normal, State state=Off) const
Returns a pixmap with the requested size, mode, and state, generating one if necessary.
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
const QMimeData * mimeData() const
Returns the data that was dropped on the widget and its associated MIME type information.
The QSize class defines the size of a two-dimensional object using integer point precision.
void setItemDelegate(QAbstractItemDelegate *delegate)
Sets the item delegate for this view and its model to delegate.
The QStyleOptionViewItem class is used to describe the parameters used to draw an item in a view widg...
The QFileInfo class provides system-independent file information.
bool isValid() const
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false...
QAbstractItemModel * model() const
Returns the model that this view is presenting.
static QString toNativeSeparators(const QString &pathName)
Returns pathName with the '/' separators converted to separators that are appropriate for the underly...
void clear()
Removes all items (including header items) from the model and sets the number of rows and columns to ...
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
static QUrl toUrl(Register *reg, int type, QDeclarativeContextData *context, bool *ok=0)
void rowsRemoved(const QModelIndex &parent, int first, int last)
This signal is emitted after rows have been removed from the model.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
static QString fileName(const QString &fileUrl)
The QFocusEvent class contains event parameters for widget focus events.
void setFileSystemModel(QFileSystemModel *model)
QFileSystemModel to get index's from, clears existing rows.
The QAction class provides an abstract user interface action that can be inserted into widgets...
int column() const
Returns the column this model index refers to.
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Reimplemented Function
The QIcon class provides scalable icons in different modes and states.