/* Setup for starting new GUIs */ void QEGenericButton::guiSetup() { // Set default properties creationOption = QEActionRequests::OptionOpen; // Use standard context menu setupContextMenu(); // If a profile is define by whatever contains the button, use it if( isProfileDefined() ) { // Setup a signal to launch a new gui // The signal will be used by whatever the button is in QObject* launcher = getGuiLaunchConsumer(); if( launcher ) { QObject::connect( getButtonQObject(), SIGNAL( newGui( const QEActionRequests& ) ), launcher, SLOT( requestAction( const QEActionRequests& ) ) ); } } // A profile is not already defined, create one. This is the case if this class is used by an application that does not set up a profile, such as 'designer'. else { // Set up the button's own gui form launcher QObject::connect( getButtonQObject(), SIGNAL( newGui( const QEActionRequests& ) ), getButtonQObject(), SLOT( requestAction( const QEActionRequests& ) ) ); } }
/* Update published signal consumer objects. This is used if the signal consumer objects were not available when the profile was first set up, or if the objects are changing */ void ContainerProfile::updateConsumers( QObject* guiLaunchConsumerIn ) { // If no profile has been defined, then can't update it if( !isProfileDefined() ) { qDebug() << "Can't update consumers as a published profile has not yet been defined"; } // Update the published profile getPublishedProfile()->guiLaunchConsumer = guiLaunchConsumerIn; // Keep the local copy matching what has been published takeLocalCopy(); }