PageRenderTime 30ms CodeModel.GetById 2ms app.highlight 22ms RepoModel.GetById 1ms app.codeStats 0ms

/vp_plugins/tEditor/undoframe.cpp

http://cupsfilter.googlecode.com/
C++ | 88 lines | 68 code | 19 blank | 1 comment | 1 complexity | 7feeb1440686c9cdebd3a61f048dc6a4 MD5 | raw file
 1#include "undoframe.h"
 2
 3
 4#include <QtGui/QDockWidget>
 5#include <QtGui/QHBoxLayout>
 6#include <QtGui/QLabel>
 7#include <QtGui/QSpacerItem>
 8#include <QtGui/QSpinBox>
 9#include <QtGui/QUndoView>
10#include <QtGui/QVBoxLayout>
11#include <QtGui/QWidget>
12#include <QtGui/QUndoGroup>
13
14UndoFrame::UndoFrame(QWidget *parent) :
15        QDockWidget(parent)
16{
17    //resize(100, 420);
18    dockWidgetContents = new QWidget();
19    dockWidgetContents->setObjectName(QString::fromUtf8("dockWidgetContents"));
20    vboxLayout = new QVBoxLayout(dockWidgetContents);
21    vboxLayout->setSpacing(4);
22    vboxLayout->setMargin(0);
23    vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
24    hboxLayout = new QHBoxLayout();
25#ifndef Q_OS_MAC
26    hboxLayout->setSpacing(6);
27#endif
28#ifndef Q_OS_MAC
29    hboxLayout->setMargin(0);
30#endif
31    hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
32    spacerItem = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
33
34    hboxLayout->addItem(spacerItem);
35
36    label = new QLabel(dockWidgetContents);
37    label->setObjectName(QString::fromUtf8("label"));
38
39    hboxLayout->addWidget(label);
40
41    undoLimit = new QSpinBox(dockWidgetContents);
42    undoLimit->setObjectName(QString::fromUtf8("undoLimit"));
43
44    hboxLayout->addWidget(undoLimit);
45    vboxLayout->addLayout(hboxLayout);
46
47    undoView = new QUndoView(dockWidgetContents);
48    undoView->setObjectName(QString::fromUtf8("undoView"));
49    undoView->setAlternatingRowColors(false);
50
51    vboxLayout->addWidget(undoView);
52
53    setWidget(dockWidgetContents);
54    retranslateUi();
55
56    connect (undoLimit, SIGNAL(valueChanged(int)),
57             this,      SIGNAL(undoLimitChange(int))
58             );
59}
60
61
62
63void UndoFrame::setUndoViewGroup(QUndoGroup * undoGroup)
64{
65    undoView->setGroup(undoGroup);
66    undoView->setEmptyLabel(QObject::trUtf8("??? ?????????"));
67    undoView->setCleanIcon(QIcon(":/ok.png"));
68}
69
70
71void UndoFrame::retranslateUi()
72{
73    this->setWindowTitle(QObject::trUtf8("???????..."));
74    label->setText(QObject::trUtf8("????? ?????"));
75
76} // retranslateUi
77
78void UndoFrame::changeEvent(QEvent *e)
79{
80    QDockWidget::changeEvent(e);
81    switch (e->type()) {
82    case QEvent::LanguageChange:
83        this->retranslateUi();
84        break;
85    default:
86        break;
87    }
88}