beautypg.com

Ktam3874/pitx software guide – Kontron KTAM3874-pITX User Manual

Page 214

background image

KTD-S0057-I

Page 210 Linux® Programming Examples (DebianTM)


KTAM3874/pITX Software Guide


namespace Ui {

class MainWindow: public Ui_MainWindow {};

} // namespace Ui

QT_END_NAMESPACE

#endif // UI_MAINWINDOW_H

and now the main Include-file (main.h):

#ifndef MAIN_H
#define MAIN_H

class MainWindow : public QMainWindow
{
Q_OBJECT

public:

explicit MainWindow (QWidget *parent = 0);

~MainWindow

();

private slots:

void showTime ();

void drawDate ();

private:

static const int TIMEOUT = 200;

static const int FONTSIZE = 14;

Ui::MainWindow

*ui;

};

#endif

and finally the changes (orange color) in main.cpp:

#include

#include "ui_mainwindow.h"

#include "moc_main.cpp"

MainWindow::MainWindow (QWidget *parent) : QMainWindow (parent), ui (new Ui::MainWindow)

MainWindow::~MainWindow ()

void MainWindow::drawDate ()

void MainWindow::showTime ()


int main (int argc, char *argv[])
{

QApplication app (argc, argv);

MainWindow *mw = new MainWindow;

mw->show ();

return app.exec ();

}

This manual is related to the following products: