Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

example.cpp Example File
application/example.cpp

    /****************************************************************************
    **
    ** This file is part of the Qt Extended Opensource Package.
    **
    ** Copyright (C) 2009 Trolltech ASA.
    **
    ** $QT_EXTENDED_DUAL_LICENSE$
    **
    ****************************************************************************/

    #include "example.h"
    #include <qpushbutton.h>
    #include <qsoftmenubar.h>

    /*
     *  Constructs a Example which is a child of 'parent', with the
     *  name 'name' and widget flags set to 'f'
     */
    Example::Example(QWidget *parent, Qt::WFlags f)
        : QWidget(parent, f)
    {
        setupUi(this); // reads the .ui file to determine widgets and layout
        // Construct context menu, available to the user via Qtopia's soft menu bar.
        QMenu *menu = QSoftMenuBar::menuFor(this);
        Q_UNUSED(menu); // Normally, we would use "menu" to add more actions.
        // The context menu will not be active unless it has at least one action.
        // Tell Qtopia to provide the "Help" option, which will enable the user to
        // read the Help documentation for this application.
        QSoftMenuBar::setHelpEnabled(this,true);
    }

    /*
     *  Destroys the object and frees any allocated resources
     */
    Example::~Example()
    {
        // no need to delete child widgets, Qt does it all for us
    }

    /*
     *  Every time the quit button is clicked, this slot will be invoked
     *  (see QMetaObject::connectSlotsByName()).
     */
    void Example::on_QuitButton_clicked()
    {
        close();
    }


Copyright © 2009 Trolltech Trademarks
Qt Extended 4.4.3