beautypg.com

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

Page 204

background image

KTD-S0057-I

Page 200 Linux® Programming Examples (DebianTM)


KTAM3874/pITX Software Guide


void MainWindow::createActions ()
{

renderIntoPixmapAct = new QAction (tr ("&Render into Pixmap..."), this);

renderIntoPixmapAct->setShortcut (tr ("Ctrl+R"));

connect (renderIntoPixmapAct, SIGNAL (triggered ()), this, SLOT (renderIntoPixmap ()));

grabFrameBufferAct = new QAction (tr ("&Grab Frame Buffer"), this);

grabFrameBufferAct->setShortcut (tr ("Ctrl+G"));

connect (grabFrameBufferAct, SIGNAL (triggered ()), this, SLOT (grabFrameBuffer ()));

clearPixmapAct = new QAction (tr ("&Clear Pixmap"), this);

clearPixmapAct->setShortcut (tr ("Ctrl+L"));

connect (clearPixmapAct, SIGNAL (triggered ()), this, SLOT (clearPixmap ()));

exitAct = new QAction (tr ("E&xit"), this);

exitAct->setShortcuts

(QKeySequence::Quit);

connect (exitAct, SIGNAL (triggered ()), this, SLOT (close ()));

aboutAct = new QAction (tr ("&About"), this);

connect (aboutAct, SIGNAL (triggered ()), this, SLOT (about ()));

aboutQtAct = new QAction (tr ("About &Qt"), this);

connect (aboutQtAct, SIGNAL (triggered ()), qApp, SLOT (aboutQt ()));

}


void MainWindow::createMenus ()
{

fileMenu = menuBar ()->addMenu (tr ("&File"));

fileMenu->addAction

(renderIntoPixmapAct);

fileMenu->addAction

(grabFrameBufferAct);

fileMenu->addAction

(clearPixmapAct);

fileMenu->addSeparator

();

fileMenu->addAction

(exitAct);

helpMenu = menuBar ()->addMenu (tr ("&Help"));

helpMenu->addAction

(aboutAct);

helpMenu->addAction

(aboutQtAct);

}


QSlider *MainWindow::createSlider (const char *changedSignal, const char *setterSlot)
{

QSlider *slider = new QSlider (Qt::Horizontal);

slider->setRange (0, 360 * 16);

slider->setSingleStep

(16);

slider->setPageStep (15 * 16);

slider->setTickInterval (15 * 16);

slider->setTickPosition

(QSlider::TicksRight);

connect (slider, SIGNAL (valueChanged (int)), glWidget, setterSlot);

connect (glWidget, changedSignal, slider, SLOT (setValue (int)));

return

slider;

}

This manual is related to the following products: