All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions
Qtilities::CoreGui::SideWidgetFileSystem Class Reference

A widget which provides access to the file system as a side widget. More...

#include <SideWidgetFileSystem.h>

List of all members.

Public Member Functions

QString filePath () const
 Function to get the path of this side viewer widget.
QString path () const
 Function to get the path of this side viewer widget.
void releasePath ()
 Reconstructs the QFileSystemModel used inside the widget.
void selectPath (const QString &path)
 Attempts to select the specified path in the view.
void setPath (const QString &path)
 Function to set the path of this side viewer widget.
 SideWidgetFileSystem (const QString &start_path=QString(), QWidget *parent=0)
 Constructs a side widget file system object.
void toggleDoubleClickFileOpen (bool open_file)
 Function which enables/disables opening of files when double clicking on them.

Detailed Description

A widget which provides access to the file system as a side widget.

A side widget which can be used in the Qtilities main window architecture. For example:

#define MODE_ID 101
DynamicSideWidgetViewer* side_viewer_widget = new DynamicSideWidgetViewer(MODE_ID);
QMap<QString, ISideViewerWidget*> text_iface_map;
QList<int> file_system_modes;
file_system_modes << MODE_ID;
SideViewerWidgetFactory* factory = new SideViewerWidgetFactory(&SideWidgetFileSystem::factory,"My Label",file_system_modes,QList<int>(),false);
text_iface_map[factory->widgetLabel()] = factory;
connect(factory,SIGNAL(newWidgetCreated(QWidget*)),SLOT(handleNewFileSystemWidget(QWidget*)));
side_viewer_widget->setIFaceMap(text_iface_map,true);
side_viewer_widget->show();
See also:
DynamicSideWidgetViewer, SideViewerWidgetFactory

This class was added in Qtilities v0.2.


Constructor & Destructor Documentation

Qtilities::CoreGui::SideWidgetFileSystem::SideWidgetFileSystem ( const QString &  start_path = QString(),
QWidget *  parent = 0 
)
explicit

Constructs a side widget file system object.

Parameters:
start_pathThe path to use when this widget is constructed. By default it will use QDir::currentPath(), as well as in the case where start_path does not exist.
parentThe parent widget.

Member Function Documentation

QString Qtilities::CoreGui::SideWidgetFileSystem::filePath ( ) const

Function to get the path of this side viewer widget.

This function was added in Qtilities v1.1.

void Qtilities::CoreGui::SideWidgetFileSystem::releasePath ( )

Reconstructs the QFileSystemModel used inside the widget.

There is known problem with QFileSystemWatcher/QFileSystemModel which causes directories to not be deleted property when they are viewed. Thus, thus function will destroy and reconstruct the model with the path pointed to QApplication::applicationDirPath().

void Qtilities::CoreGui::SideWidgetFileSystem::selectPath ( const QString &  path)

Attempts to select the specified path in the view.

This function was added in Qtilities v1.2.

void Qtilities::CoreGui::SideWidgetFileSystem::toggleDoubleClickFileOpen ( bool  open_file)

Function which enables/disables opening of files when double clicking on them.

This is enabled by default.

This function was added in Qtilities v1.1.



Qtilities : Reference Documentation Back to top Copyright © 2009-2013, Jaco Naudé