Thursday, July 7, 2011

Documentation to slamBook

some Qt stuff:

Signals and slots are used for communication between objects.I have implemented it using 

QObject::connect( sourceObj , SIGNAL(typeOfSignalGenerated()) , destinationObj, SLOT(actionToBeInitiatedForSignal()) );

Suppose in Image tab, I paste a URI and click attach button(or press Alt+t) a signal 'click()' is generated by this->ui->pushButton_7, ui being the present object, then it requires this to be acted upon by a SLOT [or a function, written specifically for acting to a SIGNAL] called imageView(). 
[lines 78,79 in mainwindow.cpp].

About the code: xml file is automatically generated WYSIWYG feature of Qtcreater coming handy saving a lot of time in User Interface design.

slots:

void Accept() : this SLOT (or function) reads the values from UI and push to an HTML file. Those values are of QString [using *.toStdString()] type, and needs to be converted to std::string, as no operator<< is defined in order to complete file insertions.

void imageView() : it fetches the image from imageURI provided ans shows it in QGraphicsView.

To compile and view the application, you need to:

pull the code from git@github.com:saurabhsar/slamBook.git
or URI


$ qmake slamBook.pro
$ make

and Run the output file:

$./slamBook

Happy cute(Qt)-ing. 

2 comments: