Generic QT-based GUI Application. More...

#include <qrguiapplication.h>

Inheritance diagram for QRGUIApplication:
[legend]
Collaboration diagram for QRGUIApplication:
[legend]

Public Member Functions

 QRGUIApplication (const RString &name, int argc, char **argv)
 
virtual void CreateConfig (void)
 
void addWidgetClass (const R::RString &classname)
 
void retrieveSize (const R::RString &classname, QWidget *widget)
 
void storeSize (const R::RString &classname, QWidget *widget)
 
virtual ~QRGUIApplication (void)
 
- Public Member Functions inherited from RApplication
 RApplication (const RString &name, int argc, char **argv, const RString &localconfig=RString::Null, const RString &globalconfig=RString::Null)
 
 RApplication (const RString &name, const RString &localconfig=RString::Null, const RString &globalconfig=RString::Null)
 
void ParseArguments (int argc, char **argv)
 
RString GetName (void) const
 
RString GetApplicationFile (void) const
 
bool IsInit (void) const
 
RString GetLocalConfigDir (void) const
 
RConfigGetConfig (void)
 
RCursor< RStringGetArgs (void) const
 
bool GetParamValue (const RString &name, RString &value) const
 
RCursor< RParamValueGetParams (void) const
 
void Execute (void)
 
virtual ~RApplication (void)
 

Private Attributes

R::RContainer< R::RString,
true, false > 
WidgetClasses
 

Additional Inherited Members

- Protected Member Functions inherited from RApplication
virtual void Init (void)
 
- Protected Attributes inherited from RApplication
RString Name
 
RString File
 
RContainer< RString, true, false > Args
 
RContainer< RParamValue, true,
false > 
Params
 
RString LocalConfigDir
 
RConfig Config
 

Detailed Description

Generic QT-based GUI Application.

The QRGUIApplication provides a class to represent a GUI application based on Qt. It provides a mechanism to store and retrieve the size of a window.

Here is an example:

class MainWidget : public QWidget
{
public:
MainWidget(void) : QWidget()
{
mRretrieveSize(MainWidget);
}
~MainWidget(void)
{
mStoreSize(MainWidget);
}
};
class MyApplication : public QRGUIApplication
{
public:
MyApplication(int argc, char** argv)
: QRGUIApplication("Test",argc,argv)
{
addWidgetClass("MainWidget");
}
virtual void Run(void)
{
Main=new MainWidget();
Main->show();
QApplication::instance()->exec();
}
};
//------------------------------------------------------------------------------
int main(int argc, char *argv[])
{
QApplication Super(argc,argv);
MyApplication App(argc,argv);
return(EXIT_SUCCESS);
}

Constructor & Destructor Documentation

QRGUIApplication ( const RString name,
int  argc,
char **  argv 
)

Construct a generic Qt-based GUI application.

Parameters
nameName of the application.
argcNumber of arguments of the program (received from main).
argvArguments of the program (received from main).
virtual ~QRGUIApplication ( void  )
virtual

Destructor.

Member Function Documentation

virtual void CreateConfig ( void  )
virtual

Create the configuration parameters. It practice, for each widget classes registered, it creates the two parameters (Class::Width and Class::Height).

Reimplemented from RApplication.

void addWidgetClass ( const R::RString classname)

Add a widget class for which the size must be managed.

Parameters
classnameName of the class.
void retrieveSize ( const R::RString classname,
QWidget *  widget 
)

Retrieve the size for a given class name and assign it to a widget.

This method can be called in the constructor of a widget.

Parameters
classnameName of the class.
widgetWidget.
void storeSize ( const R::RString classname,
QWidget *  widget 
)

Store the size for a given class name from a given widget.

This method is typically called from the destructor of a widget.

Parameters
classnameName of the class.
widgetWidget.

Field Documentation

R::RContainer<R::RString,true,false> WidgetClasses
private

All the widget classes for which the size must be managed.