UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | List of all members
hds::DbTreeWid Class Reference

#include <db_tree_wid.hpp>

Inheritance diagram for hds::DbTreeWid:
hds::db::HdbTreeWid hds::LdbTreeWid

Public Types

enum  ItemType {
  IT_NONE = QTreeWidgetItem::UserType, IT_PROJECT, IT_FOLDER, IT_SEISMIC,
  IT_TABLE
}
 
enum  ItemOptions { IOM_OPENABLE = 1, IOM_REMOVABLE = 2, IOM_SELECTABLE = 4 }
 

Public Slots

virtual void refreshTree ()
 
virtual void expandTree ()
 
virtual void collapseTree ()
 

Signals

void itemChanged (const int type, const QString &project, const QString &name)
 
void errorOccurred (const int &ec)
 

Public Member Functions

 DbTreeWid (QWidget *parent=0, Qt::WindowFlags f=0)
 
virtual ~DbTreeWid ()
 
void selectProject (const QString &project_str)
 
void setRemoveObjectsMode (const bool mode)
 
void setOpenObjectsMode (const bool mode)
 

Protected Slots

virtual void showContextMenu (QPoint pos)
 
virtual void openObject (QTreeWidgetItem *)
 
virtual void removeObject (QTreeWidgetItem *)
 
virtual void changeCurrentItem (QTreeWidgetItem *, QTreeWidgetItem *)
 

Protected Member Functions

QTreeWidget * ptw ()
 
const QTreeWidget * ptw () const
 
const QPoint & contextMenuPos () const
 

Item name to be shown.

Generates new widget item of provided type. 
Parameters
typeType of item.
virtual QTreeWidgetItem * newTreeWidgetItem (const ItemType type, const QString &name, QTreeWidgetItem *parent=NULL) const
 
QTreeWidgetItem * projectItem (QTreeWidgetItem *item) const
 
QTreeWidgetItem * projectItem (const QString &project_str) const
 
QString projectNameStr (QTreeWidgetItem *item) const
 
int itemOptions (const QTreeWidgetItem *item) const
 
void setItemOptions (QTreeWidgetItem *item, const int &mask) const
 
virtual bool event (QEvent *ev)
 

Detailed Description

Abstract database tree widget.

Member Enumeration Documentation

Item options mask.

Enumerator
IOM_OPENABLE 

Item can be opened.

IOM_REMOVABLE 

Item can be removed.

IOM_SELECTABLE 

Item can be selected.

Type of data base object item.

Enumerator
IT_NONE 

Undefined item.

IT_PROJECT 

Project item.

IT_FOLDER 

Folder with database objects.

IT_SEISMIC 

Seismic data.

IT_TABLE 

Database table item.

Constructor & Destructor Documentation

hds::DbTreeWid::DbTreeWid ( QWidget *  parent = 0,
Qt::WindowFlags  f = 0 
)

Default widget constructor.

virtual hds::DbTreeWid::~DbTreeWid ( )
virtual

Destroy widget.

Member Function Documentation

virtual void hds::DbTreeWid::changeCurrentItem ( QTreeWidgetItem *  ,
QTreeWidgetItem *   
)
inlineprotectedvirtualslot
Change current item. 
Parameters
cur_itemCurrent selected item.
prev_itemPrevious selected item.
virtual void hds::DbTreeWid::collapseTree ( )
virtualslot

Collapse all expanded tree items.

const QPoint& hds::DbTreeWid::contextMenuPos ( ) const
inlineprotected

Current context menu position.

void hds::DbTreeWid::errorOccurred ( const int &  ec)
signal
Emits when database error occurred. 
Parameters
ecError code.
virtual bool hds::DbTreeWid::event ( QEvent *  ev)
protectedvirtual

Events processing.

virtual void hds::DbTreeWid::expandTree ( )
virtualslot

Expand all tree items.

void hds::DbTreeWid::itemChanged ( const int  type,
const QString &  project,
const QString &  name 
)
signal

Emits when current item is changed.

int hds::DbTreeWid::itemOptions ( const QTreeWidgetItem *  item) const
protected

Return item options mask.

virtual void hds::DbTreeWid::openObject ( QTreeWidgetItem *  )
inlineprotectedvirtualslot

Open object from provided item.

QTreeWidgetItem* hds::DbTreeWid::projectItem ( QTreeWidgetItem *  item) const
protected
Get project item which always is root item for provided one.

If project item provided => this item is returned.

Parameters
itemInitial item for project item determination.
Returns
resulted root project item.
QTreeWidgetItem* hds::DbTreeWid::projectItem ( const QString &  project_str) const
protected
Get project item with provided project name.
Parameters
project_strName of project.
Returns
resulted project item or NULL if no item with provided project name present.
QString hds::DbTreeWid::projectNameStr ( QTreeWidgetItem *  item) const
protected
Get project name for provided item.
Parameters
itemInitial item for project name determination.
Returns
name of the project.
QTreeWidget* hds::DbTreeWid::ptw ( )
inlineprotected

Access to tree widget.

const QTreeWidget* hds::DbTreeWid::ptw ( ) const
inlineprotected

Readonly access to tree widget.

virtual void hds::DbTreeWid::refreshTree ( )
virtualslot

Refresh current tree.

virtual void hds::DbTreeWid::removeObject ( QTreeWidgetItem *  )
inlineprotectedvirtualslot

Remove object from provided item.

void hds::DbTreeWid::selectProject ( const QString &  project_str)
Select project. Only selected project will be shown. 
Parameters
project_strName of project to be selected. All porjects are shown if empty name provided.
void hds::DbTreeWid::setItemOptions ( QTreeWidgetItem *  item,
const int &  mask 
) const
protected

Set item options mask.

void hds::DbTreeWid::setOpenObjectsMode ( const bool  mode)
Turn on/off open objects mode. 
Parameters
modeTrue => can remove objects, can't remove objects otherwise.
void hds::DbTreeWid::setRemoveObjectsMode ( const bool  mode)
Turn on/off remove objects mode. 
Parameters
modeTrue => can remove objects, can't remove objects otherwise.
virtual void hds::DbTreeWid::showContextMenu ( QPoint  pos)
protectedvirtualslot

Show context menu at the position provided.


The documentation for this class was generated from the following file: