bool ConfigToolboxDialog::qt_invoke( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: addTool(); break; case 1: removeTool(); break; case 2: moveToolUp(); break; case 3: moveToolDown(); break; case 4: currentToolChanged((QListViewItem*)static_QUType_ptr.get(_o+1)); break; case 5: currentCommonToolChanged((QListViewItem*)static_QUType_ptr.get(_o+1)); break; case 6: ok(); break; case 7: languageChange(); break; default: return QDialog::qt_invoke( _id, _o ); } return TRUE; }
void PrefsDialog::init() { setupUi(this); connect(buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(buttonClicked(QAbstractButton*))); connect(binPathList, SIGNAL(itemSelectionChanged()), this, SLOT(updatePathButtons())); connect(pathUp, SIGNAL(clicked()), this, SLOT(movePathUp())); connect(pathDown, SIGNAL(clicked()), this, SLOT(movePathDown())); connect(pathAdd, SIGNAL(clicked()), this, SLOT(addPath())); connect(pathRemove, SIGNAL(clicked()), this, SLOT(removePath())); connect(toolList, SIGNAL(itemSelectionChanged()), this, SLOT(updateToolButtons())); connect(toolList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(editTool(QListWidgetItem*))); connect(toolUp, SIGNAL(clicked()), this, SLOT(moveToolUp())); connect(toolDown, SIGNAL(clicked()), this, SLOT(moveToolDown())); connect(toolAdd, SIGNAL(clicked()), this, SLOT(addTool())); connect(toolRemove, SIGNAL(clicked()), this, SLOT(removeTool())); connect(toolEdit, SIGNAL(clicked()), this, SLOT(editTool())); connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(changedTabPanel(int))); pathsChanged = toolsChanged = false; }
/* * Constructs a ConfigToolboxDialog as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ ConfigToolboxDialog::ConfigToolboxDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "ConfigToolboxDialog" ); ConfigToolboxDialogLayout = new QGridLayout( this, 1, 1, 11, 6, "ConfigToolboxDialogLayout"); Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2"); Spacer2 = new QSpacerItem( 342, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); Layout2->addItem( Spacer2 ); PushButton3 = new QPushButton( this, "PushButton3" ); PushButton3->setDefault( TRUE ); Layout2->addWidget( PushButton3 ); PushButton4 = new QPushButton( this, "PushButton4" ); Layout2->addWidget( PushButton4 ); ConfigToolboxDialogLayout->addMultiCellLayout( Layout2, 1, 1, 0, 1 ); Layout4 = new QGridLayout( 0, 1, 1, 0, 6, "Layout4"); buttonAdd = new QPushButton( this, "buttonAdd" ); buttonAdd->setEnabled( FALSE ); Layout4->addWidget( buttonAdd, 1, 1 ); Spacer3 = new QSpacerItem( 111, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); Layout4->addItem( Spacer3, 1, 0 ); listViewTools = new QListView( this, "listViewTools" ); listViewTools->addColumn( tr( "Available Tools" ) ); listViewTools->setSelectionMode( QListView::Extended ); listViewTools->setResizeMode( QListView::LastColumn ); Layout4->addMultiCellWidget( listViewTools, 0, 0, 0, 1 ); ConfigToolboxDialogLayout->addLayout( Layout4, 0, 0 ); Layout5 = new QGridLayout( 0, 1, 1, 0, 6, "Layout5"); buttonRemove = new QPushButton( this, "buttonRemove" ); buttonRemove->setEnabled( FALSE ); Layout5->addWidget( buttonRemove, 1, 0 ); listViewCommon = new QListView( this, "listViewCommon" ); listViewCommon->addColumn( tr( "Common Widgets Page" ) ); listViewCommon->setSelectionMode( QListView::Extended ); listViewCommon->setResizeMode( QListView::LastColumn ); Layout5->addMultiCellWidget( listViewCommon, 0, 0, 0, 3 ); buttonDown = new QToolButton( this, "buttonDown" ); buttonDown->setEnabled( FALSE ); buttonDown->setPixmap( QPixmap::fromMimeSource( "designer_s_down.png" ) ); Layout5->addWidget( buttonDown, 1, 3 ); Spacer4 = new QSpacerItem( 41, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); Layout5->addItem( Spacer4, 1, 1 ); buttonUp = new QToolButton( this, "buttonUp" ); buttonUp->setEnabled( FALSE ); buttonUp->setPixmap( QPixmap::fromMimeSource( "designer_s_up.png" ) ); Layout5->addWidget( buttonUp, 1, 2 ); ConfigToolboxDialogLayout->addLayout( Layout5, 0, 1 ); languageChange(); resize( QSize(403, 467).expandedTo(minimumSizeHint()) ); clearWState( WState_Polished ); // signals and slots connections connect( buttonAdd, SIGNAL( clicked() ), this, SLOT( addTool() ) ); connect( buttonRemove, SIGNAL( clicked() ), this, SLOT( removeTool() ) ); connect( buttonUp, SIGNAL( clicked() ), this, SLOT( moveToolUp() ) ); connect( buttonDown, SIGNAL( clicked() ), this, SLOT( moveToolDown() ) ); connect( listViewTools, SIGNAL( clicked(QListViewItem*) ), this, SLOT( currentToolChanged(QListViewItem*) ) ); connect( listViewCommon, SIGNAL( clicked(QListViewItem*) ), this, SLOT( currentCommonToolChanged(QListViewItem*) ) ); connect( PushButton3, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( PushButton4, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( PushButton3, SIGNAL( clicked() ), this, SLOT( ok() ) ); connect( listViewTools, SIGNAL( doubleClicked(QListViewItem*) ), this, SLOT( addTool() ) ); init(); }