Commit c4f8018f authored by Mike Kremer's avatar Mike Kremer

Added the ui file for the process manager

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@8599 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 9a7a0afd
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2009 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 83 $ *
* $Author: kremer $ *
* $Date: 2009-02-27 17:31:45 +0100 (Fr, 27. Feb 2009) $ *
* *
\*===========================================================================*/
#ifndef PROCESSITEM_HH
#define PROCESSITEM_HH
#include <QString>
#include <QList>
#include <vector>
#include <OpenFlipper/common/Types.hh>
class ProcessItem {
public :
ProcessItem(QString _name, QString _description, float _progress, float _progressMax, ProcessItem* _parent) :
name_(_name),
description_(_description),
progress_(_progress),
progressMax_(_progressMax),
parent_(_parent) {};
// dynamic members
public:
/// name
QString name( ) { return name_; };
void name( QString _name ) { name_ = _name; };
/// description
QString description( ) { return description_; };
void description( QString _description ) { description_ = _description; };
float progress() { return progress_; }
void progress(float _progress) { progress_ = _progress; };
float progressMax() { return progressMax_; }
void progressMax(float _progressMax) { progressMax_ = _progressMax; };
private:
QString name_;
QString description_;
float progress_;
float progressMax_;
private:
/// Parent item or 0 if rootnode
ProcessItem *parent_;
/// Children of this node
QList<ProcessItem*> children_;
public:
//===========================================================================
/** @name Tree : Parent nodes
* @{ */
//===========================================================================
/// get the row of this item from the parent
int row() const {
if (parent_)
return parent_->children_.indexOf(const_cast<ProcessItem*>(this));
return 0;
};
/// Get the parent item ( 0 if rootitem )
ProcessItem *parent() { return parent_; };
/// Set the parent pointer
void setParent(ProcessItem* _parent) { parent_ = _parent; };
/** @} */
//===========================================================================
/** @name Tree : Children
* @{ */
//===========================================================================
/// Remove a child from this object
void removeChild( ProcessItem* _item ) {
bool found = false;
QList<ProcessItem*>::iterator i;
for (i = children_.begin(); i != children_.end(); ++i) {
if ( *i == _item ) {
found = true;
break;
}
}
if ( !found ) {
std::cerr << "ProcessItem: Illegal remove request" << std::endl;
return;
}
children_.erase(i);
};
ProcessItem* child(int row)
{
return children_.value(row);
}
int childCount() const
{
return children_.count();
}
/** @} */
};
//=============================================================================
#endif // PROCESSITEM_HH defined
//=============================================================================
This diff is collapsed.
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2009 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 6747 $ *
* $Author: kremer $ *
* $Date: 2009-08-05 11:36:43 +0200 (Wed, 05 Aug 2009) $ *
* *
\*===========================================================================*/
#ifndef PROCESSITEMMODEL_H
#define PROCESSITEMMODEL_H
#include <QAbstractItemModel>
#include <QModelIndex>
#include <QVariant>
#include "ProcessItem.hh"
class ProcessItemModel : public QAbstractItemModel
{
Q_OBJECT
public:
/// Constructor
ProcessItemModel ( QObject *_parent = 0 );
/// Destructor
~ProcessItemModel();
//===========================================================================
/** @name inherited from QAbstractItemModel
* @{ */
//===========================================================================
public:
/// Get the data of the corresponding entry
QVariant data ( const QModelIndex &index, int role ) const;
/// return the types of the corresponding entry
Qt::ItemFlags flags ( const QModelIndex &index ) const;
/// return the header data of the model
QVariant headerData ( int section,
Qt::Orientation orientation,
int role = Qt::DisplayRole ) const;
/// Get the ModelIndex at given row,column
QModelIndex index ( int row, int column,
const QModelIndex &parent = QModelIndex() ) const;
/// Get the parent ModelIndex
QModelIndex parent ( const QModelIndex &index ) const;
/// get the number of rows
int rowCount ( const QModelIndex &parent = QModelIndex() ) const;
/// get the number of columns
int columnCount ( const QModelIndex &parent = QModelIndex() ) const;
/// Set the data at the given index
bool setData ( const QModelIndex &index, const QVariant &value , int role );
/** @} */
//===========================================================================
/** @name Internal DataStructure (the ProcessItem)
* @{ */
//===========================================================================
public:
/// Return the ModelIndex corresponding to a given ProcessItem and Column
QModelIndex getModelIndex ( ProcessItem* _object, int _column );
/// Check if the given item is the root item
bool isRoot ( ProcessItem* _item );
/// Get the ProcessItem corresponding to a given ModelIndex
ProcessItem *getItem ( const QModelIndex &index ) const;
/// Get the name of a ProcessItem corresponding to a given ModelIndex
QString itemName ( const QModelIndex &index ) const;
/// Get the id of a ProcessItem corresponding to a given ModelIndex
int itemId ( const QModelIndex &index ) const;
private:
/// Rootitem of the list
ProcessItem* rootItem_;
/** @} */
};
#endif
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ProcessManagerWidget</class>
<widget class="QWidget" name="ProcessManagerWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>595</width>
<height>269</height>
</rect>
</property>
<property name="windowTitle">
<string>Process Manager Window</string>
</property>
<widget class="QTableWidget" name="processList">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>571</width>
<height>241</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>200</height>
</size>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="showDropIndicator" stdset="0">
<bool>true</bool>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="textElideMode">
<enum>Qt::ElideRight</enum>
</property>
<property name="showGrid">
<bool>true</bool>
</property>
<property name="cornerButtonEnabled">
<bool>false</bool>
</property>
<column>
<property name="text">
<string>Process</string>
</property>
</column>
<column>
<property name="text">
<string>Description</string>
</property>
</column>
<column>
<property name="text">
<string>Progress</string>
</property>
</column>
<column>
<property name="text">
<string>Controls</string>
</property>
</column>
</widget>
</widget>
<resources/>
<connections/>
</ui>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment