Home · All Classes · Grouped Classes · Annotated · Functions

example.cpp Example File
application/example.cpp

    /****************************************************************************
    **
    ** This file is part of the Qtopia Phone Edition Package.
    **
    ** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
    **
    ** $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 © 2008 Nokia Trademarks
Qtopia 4.3.3