3 // Part of the Architektonas Project
4 // Originally part of QCad Community Edition by Andrew Mustun
5 // Extensively rewritten and refactored by James L. Hammons
6 // (C) 2010 Underground Software
8 // JLH = James L. Hammons <jlhamm@acm.org>
11 // --- ---------- -----------------------------------------------------------
12 // JLH 05/10/2010 Created this file. :-)
15 #include "lineoptions.h"
18 #include "rs_actiondrawline.h"
19 #include "rs_actioninterface.h"
21 LineOptions::LineOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
22 QWidget(parent, flags), action(NULL),
23 bClose(new QToolButton(this)),
24 bUndo(new QToolButton(this))
26 QHBoxLayout * layout = new QHBoxLayout(this);
27 layout->setContentsMargins(0, 0, 0, 0);
29 bClose->setText(tr("Close"));
30 bUndo->setText(tr("Undo"));
32 layout->addWidget(bClose);
33 layout->addWidget(bUndo);
35 connect(bClose, SIGNAL(clicked()), this, SLOT(close()));
36 connect(bUndo, SIGNAL(clicked()), this, SLOT(undo()));
38 // We need to add the widget (this thing) to the toolbar passed in. Otherwise,
39 // nothing will show up on the screen. :-)
41 parent->addWidget(this);
44 LineOptions::~LineOptions()
48 void LineOptions::setAction(RS_ActionInterface * a)
50 if (a != NULL && a->rtti() == RS2::ActionDrawLine)
52 action = (RS_ActionDrawLine *)a;
56 RS_DEBUG->print(RS_Debug::D_ERROR, "QG_LineOptions::setAction: wrong action type");
61 void LineOptions::close()
67 void LineOptions::undo()