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"
23 LineOptions::LineOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
24 QWidget(parent, flags), action(NULL),
25 bClose(new QToolButton(this)),
26 bUndo(new QToolButton(this))
28 QHBoxLayout * layout = new QHBoxLayout(this);
29 layout->setContentsMargins(0, 0, 0, 0);
31 bClose->setText(tr("Close"));
32 bUndo->setText(tr("Undo"));
34 layout->addWidget(bClose);
35 layout->addWidget(bUndo);
37 connect(bClose, SIGNAL(clicked()), this, SLOT(close()));
38 connect(bUndo, SIGNAL(clicked()), this, SLOT(undo()));
40 // We need to add the widget (this thing) to the toolbar passed in. Otherwise,
41 // nothing will show up on the screen. :-)
43 parent->addWidget(this);
46 LineOptions::~LineOptions()
50 //void LineOptions::setAction(ActionInterface * a)
51 void LineOptions::setAction(ActionInterface * a)
53 if (a != NULL && a->rtti() == RS2::ActionDrawLine)
55 action = (ActionDrawLine *)a;
59 RS_DEBUG->print(RS_Debug::D_ERROR, "QG_LineOptions::setAction: wrong action type");
64 void LineOptions::close()
70 void LineOptions::undo()