autoform.cpp
Go to the documentation of this file.00001 /* 00002 For general Scribus (>=1.3.2) copyright and licensing information please refer 00003 to the COPYING file provided with the program. Following this notice may exist 00004 a copyright and/or license notice that predates the release of Scribus 1.3.2 00005 for which a new license (GPL+exception) is in place. 00006 */ 00007 00008 #include "autoform.h" 00009 #include "autoformbuttongroup.h" 00010 00011 Autoforms::Autoforms( QWidget* parent ) : QToolButton( parent ) 00012 { 00013 Men = new QMenu(); 00014 buttonGroup1 = new AutoformButtonGroup( NULL ); 00015 MenAct = new QWidgetAction(this); 00016 MenAct->setDefaultWidget(buttonGroup1); 00017 Men->addAction(MenAct); 00018 setMenu(Men); 00019 setPopupMode(QToolButton::InstantPopup); 00020 setIcon(QIcon(buttonGroup1->getIconPixmap(0))); 00021 connect(buttonGroup1, SIGNAL(buttonClicked(int)), this, SLOT(selForm(int))); 00022 } 00023 00024 void Autoforms::selForm(int a) 00025 { 00026 // Men->activateItemAt(0); 00027 setIcon(QIcon(buttonGroup1->getIconPixmap(a))); 00028 int n; 00029 double *AutoShapes = buttonGroup1->getShapeData(a, &n); 00030 emit FormSel(a, n, AutoShapes); 00031 } 00032 00033 QPixmap Autoforms::getIconPixmap(int nr) 00034 { 00035 return buttonGroup1->getIconPixmap(nr); 00036 } 00037
