]> Shamusworld >> Repos - architektonas/blobdiff - src/forms/cadtoolbarpoints.cpp
Phase two of adding polyline functionality...
[architektonas] / src / forms / cadtoolbarpoints.cpp
index 6c06233737937734d9d0a429ae456cdc03dcdbb6..b1a6880289c0be784e6c82c344a399baf5d06e86 100644 (file)
@@ -3,7 +3,9 @@
 // Part of the Architektonas Project
 // Originally part of QCad Community Edition by Andrew Mustun
 // Extensively rewritten and refactored by James L. Hammons
-// (C) 2010 Underground Software
+// Portions copyright (C) 2001-2003 RibbonSoft
+// Copyright (C) 2010 Underground Software
+// See the README and GPLv2 files for licensing and warranty information
 //
 // JLH = James L. Hammons <jlhamm@acm.org>
 //
 #include "createqtactions.h"
 
 CadToolBarPoints::CadToolBarPoints(CadToolBar * parent, Qt::WindowFlags flags/*= 0*/):
-       QWidget((QWidget *)parent, flags), cadToolBar(parent)
+       QWidget((QWidget *)parent, flags)
 {
        QGridLayout * gridLayout = new QGridLayout(this);
        gridLayout->setSpacing(0);
        gridLayout->setContentsMargins(0, 0, 0, 0);
 
-       QAction * actionBack = new QAction(QIcon(":/res/qg_back"), tr("Back"), this);
-       QToolButton * button = new QToolButton(this);
-       button->setDefaultAction(actionBack);
-       QSizePolicy policy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
-       button->setSizePolicy(policy);
-       gridLayout->addWidget(button, 0, 0, 1, 2);
-       connect(button, SIGNAL(triggered(QAction *)), this, SLOT(back()));
+       gridLayout->addWidget(parent->CreateBackButton(this), 0, 0, 1, 2);
 
-       gridLayout->addWidget(CreateToolButton(actionDrawPoint), 1, 0, 1, 1);
+       gridLayout->addWidget(parent->CreateToolButton(actionDrawPoint), 1, 0, 1, 1);
 }
 
 CadToolBarPoints::~CadToolBarPoints()
 {
 }
-
-void CadToolBarPoints::back()
-{
-       cadToolBar->back();
-}
-
-QToolButton * CadToolBarPoints::CreateToolButton(QAction * action)
-{
-       QToolButton * button = new QToolButton(this);
-       button->setDefaultAction(action);
-       button->setIconSize(QSize(18, 18));
-
-       return button;
-}