Changeset View
Changeset View
Standalone View
Standalone View
step/toolgraphics.cc
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | |||||
65 | #include <KIO/Job> | 65 | #include <KIO/Job> | ||
66 | #include <KJobWidgets> | 66 | #include <KJobWidgets> | ||
67 | #include <KLocalizedString> | 67 | #include <KLocalizedString> | ||
68 | #include <KMessageBox> | 68 | #include <KMessageBox> | ||
69 | #include <KPlotAxis> | 69 | #include <KPlotAxis> | ||
70 | #include <KPlotObject> | 70 | #include <KPlotObject> | ||
71 | #include <KPlotPoint> | 71 | #include <KPlotPoint> | ||
72 | #include <KPlotWidget> | 72 | #include <KPlotWidget> | ||
73 | #include <KProgressDialog> | | |||
74 | #include <KToggleAction> | 73 | #include <KToggleAction> | ||
75 | #include <KToolBar> | 74 | #include <KToolBar> | ||
76 | 75 | | |||
77 | #include <float.h> | 76 | #include <float.h> | ||
78 | 77 | | |||
79 | 78 | | |||
80 | StepCore::Vector2d WidgetVertexHandlerGraphicsItem::value() | 79 | StepCore::Vector2d WidgetVertexHandlerGraphicsItem::value() | ||
81 | { | 80 | { | ||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | 88 | { | |||
129 | _worldModel->setProperty(_item, "size", QVariant::fromValue((newSize*s).eval())); | 128 | _worldModel->setProperty(_item, "size", QVariant::fromValue((newSize*s).eval())); | ||
130 | } | 129 | } | ||
131 | 130 | | |||
132 | WidgetGraphicsItem::WidgetGraphicsItem(StepCore::Item* item, WorldModel* worldModel) | 131 | WidgetGraphicsItem::WidgetGraphicsItem(StepCore::Item* item, WorldModel* worldModel) | ||
133 | : StepGraphicsItem(item, worldModel), _centralWidget(0) | 132 | : StepGraphicsItem(item, worldModel), _centralWidget(0) | ||
134 | { | 133 | { | ||
135 | setFlag(QGraphicsItem::ItemIsSelectable); | 134 | setFlag(QGraphicsItem::ItemIsSelectable); | ||
136 | setFlag(QGraphicsItem::ItemIsMovable); | 135 | setFlag(QGraphicsItem::ItemIsMovable); | ||
137 | setAcceptsHoverEvents(true); | 136 | setAcceptHoverEvents(true); | ||
138 | 137 | | |||
139 | _backgroundBrush = Qt::NoBrush; | 138 | _backgroundBrush = Qt::NoBrush; | ||
140 | 139 | | |||
141 | _boundingRect = QRectF(0, 0, 0, 0); | 140 | _boundingRect = QRectF(0, 0, 0, 0); | ||
142 | } | 141 | } | ||
143 | 142 | | |||
144 | WidgetGraphicsItem::~WidgetGraphicsItem() | 143 | WidgetGraphicsItem::~WidgetGraphicsItem() | ||
145 | { | 144 | { | ||
▲ Show 20 Lines • Show All 219 Lines • ▼ Show 20 Line(s) | |||||
365 | } | 364 | } | ||
366 | 365 | | |||
367 | NoteGraphicsItem::NoteGraphicsItem(StepCore::Item* item, WorldModel* worldModel) | 366 | NoteGraphicsItem::NoteGraphicsItem(StepCore::Item* item, WorldModel* worldModel) | ||
368 | : WidgetGraphicsItem(item, worldModel) | 367 | : WidgetGraphicsItem(item, worldModel) | ||
369 | { | 368 | { | ||
370 | Q_ASSERT(dynamic_cast<StepCore::Note*>(_item) != NULL); | 369 | Q_ASSERT(dynamic_cast<StepCore::Note*>(_item) != NULL); | ||
371 | setFlag(QGraphicsItem::ItemIsSelectable); | 370 | setFlag(QGraphicsItem::ItemIsSelectable); | ||
372 | setFlag(QGraphicsItem::ItemIsMovable); | 371 | setFlag(QGraphicsItem::ItemIsMovable); | ||
373 | setAcceptsHoverEvents(true); | 372 | setAcceptHoverEvents(true); | ||
374 | 373 | | |||
375 | _widget = new QWidget(); | 374 | _widget = new QWidget(); | ||
376 | _widget->setPalette(QPalette(Qt::lightGray)); | 375 | _widget->setPalette(QPalette(Qt::lightGray)); | ||
377 | 376 | | |||
378 | _textEdit = new NoteTextEdit(this, _widget); | 377 | _textEdit = new NoteTextEdit(this, _widget); | ||
379 | _textEdit->setFrameShape(QFrame::NoFrame); | 378 | _textEdit->setFrameShape(QFrame::NoFrame); | ||
380 | QPalette p = _textEdit->palette(); | 379 | QPalette p = _textEdit->palette(); | ||
381 | p.setColor(QPalette::Base, Qt::transparent); | 380 | p.setColor(QPalette::Base, Qt::transparent); | ||
▲ Show 20 Lines • Show All 513 Lines • ▼ Show 20 Line(s) | |||||
895 | 894 | | |||
896 | //////////////////////////////////////////////////// | 895 | //////////////////////////////////////////////////// | ||
897 | GraphGraphicsItem::GraphGraphicsItem(StepCore::Item* item, WorldModel* worldModel) | 896 | GraphGraphicsItem::GraphGraphicsItem(StepCore::Item* item, WorldModel* worldModel) | ||
898 | : WidgetGraphicsItem(item, worldModel) | 897 | : WidgetGraphicsItem(item, worldModel) | ||
899 | { | 898 | { | ||
900 | Q_ASSERT(dynamic_cast<StepCore::Graph*>(_item) != NULL); | 899 | Q_ASSERT(dynamic_cast<StepCore::Graph*>(_item) != NULL); | ||
901 | setFlag(QGraphicsItem::ItemIsSelectable); | 900 | setFlag(QGraphicsItem::ItemIsSelectable); | ||
902 | setFlag(QGraphicsItem::ItemIsMovable); | 901 | setFlag(QGraphicsItem::ItemIsMovable); | ||
903 | setAcceptsHoverEvents(true); | 902 | setAcceptHoverEvents(true); | ||
904 | 903 | | |||
905 | _plotWidget = new KPlotWidget(); | 904 | _plotWidget = new KPlotWidget(); | ||
906 | _plotWidget->setPalette(QPalette(Qt::lightGray)); | 905 | _plotWidget->setPalette(QPalette(Qt::lightGray)); | ||
907 | _plotWidget->setBackgroundColor(Qt::white); | 906 | _plotWidget->setBackgroundColor(Qt::white); | ||
908 | _plotWidget->setForegroundColor(Qt::black); | 907 | _plotWidget->setForegroundColor(Qt::black); | ||
909 | //_plotWidget->setLeftPadding(0); | 908 | //_plotWidget->setLeftPadding(0); | ||
910 | //_plotWidget->setTopPadding(2); | 909 | //_plotWidget->setTopPadding(2); | ||
911 | //_plotWidget->setRightPadding(3); | 910 | //_plotWidget->setRightPadding(3); | ||
▲ Show 20 Lines • Show All 329 Lines • ▼ Show 20 Line(s) | |||||
1241 | 1240 | | |||
1242 | //////////////////////////////////////////////////// | 1241 | //////////////////////////////////////////////////// | ||
1243 | MeterGraphicsItem::MeterGraphicsItem(StepCore::Item* item, WorldModel* worldModel) | 1242 | MeterGraphicsItem::MeterGraphicsItem(StepCore::Item* item, WorldModel* worldModel) | ||
1244 | : WidgetGraphicsItem(item, worldModel) | 1243 | : WidgetGraphicsItem(item, worldModel) | ||
1245 | { | 1244 | { | ||
1246 | Q_ASSERT(dynamic_cast<StepCore::Meter*>(_item) != NULL); | 1245 | Q_ASSERT(dynamic_cast<StepCore::Meter*>(_item) != NULL); | ||
1247 | setFlag(QGraphicsItem::ItemIsSelectable); | 1246 | setFlag(QGraphicsItem::ItemIsSelectable); | ||
1248 | setFlag(QGraphicsItem::ItemIsMovable); | 1247 | setFlag(QGraphicsItem::ItemIsMovable); | ||
1249 | setAcceptsHoverEvents(true); | 1248 | setAcceptHoverEvents(true); | ||
1250 | setBackgroundBrush(QBrush(Qt::white)); | 1249 | setBackgroundBrush(QBrush(Qt::white)); | ||
1251 | 1250 | | |||
1252 | _widget = new QFrame(); | 1251 | _widget = new QFrame(); | ||
1253 | _widget->setFrameShape(QFrame::Box); | 1252 | _widget->setFrameShape(QFrame::Box); | ||
1254 | _widget->setPalette(QPalette(Qt::lightGray)); | 1253 | _widget->setPalette(QPalette(Qt::lightGray)); | ||
1255 | 1254 | | |||
1256 | QGridLayout* layout = new QGridLayout(_widget); | 1255 | QGridLayout* layout = new QGridLayout(_widget); | ||
1257 | layout->setContentsMargins(0,0,2,0); | 1256 | layout->setContentsMargins(0,0,2,0); | ||
▲ Show 20 Lines • Show All 146 Lines • ▼ Show 20 Line(s) | |||||
1404 | 1403 | | |||
1405 | //////////////////////////////////////////////////// | 1404 | //////////////////////////////////////////////////// | ||
1406 | ControllerGraphicsItem::ControllerGraphicsItem(StepCore::Item* item, WorldModel* worldModel) | 1405 | ControllerGraphicsItem::ControllerGraphicsItem(StepCore::Item* item, WorldModel* worldModel) | ||
1407 | : WidgetGraphicsItem(item, worldModel) | 1406 | : WidgetGraphicsItem(item, worldModel) | ||
1408 | { | 1407 | { | ||
1409 | Q_ASSERT(dynamic_cast<StepCore::Controller*>(_item) != NULL); | 1408 | Q_ASSERT(dynamic_cast<StepCore::Controller*>(_item) != NULL); | ||
1410 | setFlag(QGraphicsItem::ItemIsSelectable); | 1409 | setFlag(QGraphicsItem::ItemIsSelectable); | ||
1411 | setFlag(QGraphicsItem::ItemIsMovable); | 1410 | setFlag(QGraphicsItem::ItemIsMovable); | ||
1412 | setAcceptsHoverEvents(true); | 1411 | setAcceptHoverEvents(true); | ||
1413 | setBackgroundBrush(QBrush(Qt::white)); | 1412 | setBackgroundBrush(QBrush(Qt::white)); | ||
1414 | 1413 | | |||
1415 | _widget = new QWidget(); | 1414 | _widget = new QWidget(); | ||
1416 | _widget->setPalette(QPalette(Qt::lightGray)); | 1415 | _widget->setPalette(QPalette(Qt::lightGray)); | ||
1417 | QGridLayout* layout = new QGridLayout(_widget); | 1416 | QGridLayout* layout = new QGridLayout(_widget); | ||
1418 | 1417 | | |||
1419 | _labelMin = new QLabel(_widget); _labelMin->setAlignment(Qt::AlignRight); | 1418 | _labelMin = new QLabel(_widget); _labelMin->setAlignment(Qt::AlignRight); | ||
1420 | _labelMax = new QLabel(_widget); _labelMax->setAlignment(Qt::AlignLeft); | 1419 | _labelMax = new QLabel(_widget); _labelMax->setAlignment(Qt::AlignLeft); | ||
▲ Show 20 Lines • Show All 505 Lines • Show Last 20 Lines |