1 /* 2 For general Scribus (>=1.3.2) copyright and licensing information please refer 3 to the COPYING file provided with the program. Following this notice may exist 4 a copyright and/or license notice that predates the release of Scribus 1.3.2 5 for which a new license (GPL+exception) is in place. 6 */ 7 8 #include "autoform.h" 9 #include "autoformbuttongroup.h" 10 Autoforms(QWidget * parent)11Autoforms::Autoforms( QWidget* parent ) : QToolButton( parent ) 12 { 13 buttonGroup1 = new AutoformButtonGroup( nullptr ); 14 setMenu(buttonGroup1); 15 setPopupMode(QToolButton::InstantPopup); 16 setIcon(QIcon(buttonGroup1->getIconPixmap(0))); 17 connect(buttonGroup1, SIGNAL(buttonClicked(int)), this, SLOT(selForm(int))); 18 } 19 selForm(int a)20void Autoforms::selForm(int a) 21 { 22 setIcon(QIcon(buttonGroup1->getIconPixmap(a))); 23 int n; 24 qreal *AutoShapes = buttonGroup1->getShapeData(a, &n); 25 emit FormSel(a, n, AutoShapes); 26 } 27 getIconPixmap(int nr)28QPixmap Autoforms::getIconPixmap(int nr) 29 { 30 return buttonGroup1->getIconPixmap(nr); 31 } 32 33