Public Member Functions

TimeConstraintToolBar Class Reference

Widgets which allows adjusting the global TimeConstraint. More...

#include <globaltimeconstraint.h>

Inheritance diagram for TimeConstraintToolBar:
Inheritance graph
[legend]
Collaboration diagram for TimeConstraintToolBar:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TimeConstraintToolBar (QWidget *parent=0)

Detailed Description

Widgets which allows adjusting the global TimeConstraint.

timeconstrainttoolbar_sample.png

Here you select the interval for data you are interested in. It is a global application setting for data requests and is therefore reflected in ProjectTree's data preview as in the Factory.

It is mainly used for performance reasons to allow users select only data from within the timeframe they need. Selecting very large intervals slows down data retrieval, especially over slow network connections.

U can use the double arrows to scroll left or right over the specified interval.


Constructor & Destructor Documentation

TimeConstraintToolBar::TimeConstraintToolBar ( QWidget parent = 0  )  [inline]

                                               : QToolBar("Global time-constraint on data", parent){
        setObjectName("TimeConstraintToolBar");
        setWindowTitle("Global time constraint");
        setToolTip(tr("This constraint is applied to all the data fetched from the database.\n"
                      "Note that for large intervals, fetching might take a considerable amount of time."));

        // setup layout
        moveLeft = new QAction("<<", this);
        addAction(moveLeft);
        addWidget(new QLabel("From: ", this));
        beginTimeEditor = new QDateTimeEdit(this);
        beginTimeEditor->setDisplayFormat("yyyy-MM-dd hh:mm");
        beginTimeEditor->setCalendarPopup(true);
        addWidget(beginTimeEditor);
        addWidget(new QLabel("To: ", this));
        endTimeEditor = new QDateTimeEdit(this);
        endTimeEditor->setDisplayFormat("yyyy-MM-dd hh:mm");
        endTimeEditor->setCalendarPopup(true);
        addWidget(endTimeEditor);
        moveRight = new QAction(">>",this);
        addAction(moveRight);

        // setup values
        syncThis(TimeConstraint::TypeBeginTime);
        syncThis(TimeConstraint::TypeEndTime);

        // setup sync connections
        connect(TimeConstraint::instance(), SIGNAL(signalOnTimeConstraintChange(TimeConstraint::ConstraintType, QDateTime)),
                this, SLOT(onTimeConstraintChange(TimeConstraint::ConstraintType, QDateTime)));
        connect(beginTimeEditor, SIGNAL(dateTimeChanged(QDateTime)), this, SLOT(onBeginTimeEdit(QDateTime)));
        connect(endTimeEditor, SIGNAL(dateTimeChanged(QDateTime)), this, SLOT(onEndTimeEdit(QDateTime)));
        connect(moveLeft, SIGNAL(triggered()), this, SLOT(onMoveLeftActionTrigger()));
        connect(moveRight, SIGNAL(triggered()), this, SLOT(onMoveRightActionTrigger()));
    }


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