/* * Qt demo for CS2141 - Software Development Using C/C++ - Spring 2010 * Developed by Paul Bonamy * Based in part on sample code provided by Nokia and Trolltech * * Header file for the the MainWindow class * * Works by extending the QMainWindow class to provide extra functionality */ #ifndef MAINWINDOW_H #define MAINWINDOW_H #include // these classes actually get included from the .cpp, but the compiler // needs to know that they'll be defined elsewhere class QAction; class QLabel; class QMenu; class QTableWidget; class MainWindow : public QMainWindow { // this needs to be right at the top as a private member of the class // it takes care of setting up signals/slots and some other Qt stuff Q_OBJECT public: MainWindow(); // default constructor // slots are triggered by signals, and perform useful actions // they can be private, public, or protected private slots: void newFile(); void open(); void save(); private: // these two functions exist to make the constuctor a bit cleaner // you don't really need them void createActions(); void createMenus(); // we'll need to be able to interact with these later, so // we'll define them here, in the class header. QMenu *fileMenu; // the 'File' menu QAction *newAct; // QAction objects are entries in menus QAction *openAct; QAction *saveAct; QAction *exitAct; QLabel *infoLabel; QTableWidget *table; }; #endif