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 // Portions copyright (C) 2001-2003 RibbonSoft
7 // Copyright (C) 2010 Underground Software
8 // See the README and GPLv2 files for licensing and warranty information
10 // JLH = James L. Hammons <jlhamm@acm.org>
13 // --- ---------- -----------------------------------------------------------
14 // JLH 05/10/2010 Created this file. :-)
17 #include "lineoptions.h"
20 #include "actiondrawline.h"
21 #include "actioninterface.h"
24 LineOptions::LineOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
25 QWidget(parent, flags), action(NULL),
26 bClose(new QToolButton(this)),
27 bUndo(new QToolButton(this))
29 QHBoxLayout * layout = new QHBoxLayout(this);
30 layout->setContentsMargins(0, 0, 0, 0);
32 bClose->setText(tr("Close"));
33 bUndo->setText(tr("Undo"));
35 layout->addWidget(bClose);
36 layout->addWidget(bUndo);
38 connect(bClose, SIGNAL(clicked()), this, SLOT(close()));
39 connect(bUndo, SIGNAL(clicked()), this, SLOT(undo()));
41 // We need to add the widget (this thing) to the toolbar passed in. Otherwise,
42 // nothing will show up on the screen. :-)
44 parent->addWidget(this);
47 LineOptions::~LineOptions()
51 //void LineOptions::setAction(ActionInterface * a)
52 void LineOptions::setAction(ActionInterface * a)
54 if (a != NULL && a->rtti() == RS2::ActionDrawLine)
56 action = (ActionDrawLine *)a;
60 DEBUG->print(Debug::D_ERROR, "QG_LineOptions::setAction: wrong action type");
65 void LineOptions::close()
71 void LineOptions::undo()