Today we shall see how to change the text of it.
The left key is “Positive Soft key” & the right key is “Negative soft key”. We need to create an action with the positive and negative soft key role and insert to the window, so the keys will get changed.
Ex: For positive soft key:(Left side key)
QAction* Newkey = new QAction("New", this);
Newkey->setSoftKeyRole(QAction::PositiveSoftKey);
this->addAction(Newkey);
Negative soft key: (Right side key)
QAction* close = new QAction("close", this);
close->setSoftKeyRole(QAction::NegativeSoftKey);
this->addAction(close);
Here is the sample code, just put these files in a sample application and run for the results
.cpp file
#include "QT_Softkeys.h"
#include <qmessagebox.h>
QT_Softkeys::QT_Softkeys(QWidget *parent)
: QMainWindow(parent)
{
//ui.setupUi(this);
QAction* Newkey = new QAction("New", this);
Newkey->setSoftKeyRole(QAction::PositiveSoftKey);
this->addAction(Newkey);
QAction* close = new QAction("close", this);
close->setSoftKeyRole(QAction::NegativeSoftKey);
connect(close,SIGNAL(triggered()),this,SLOT(closeClickked()));
this->addAction(close);
}
QT_Softkeys::~QT_Softkeys()
{
}
void QT_Softkeys::closeClickked()
{
QMessageBox::information(this,"Hi","Hi we r closing");
QApplication::quit();
}
Header file
#ifndef QT_SOFTKEYS_H
#define QT_SOFTKEYS_H
#include <QtGui/QMainWindow>
#include "ui_QT_Softkeys.h"
class QT_Softkeys : public QMainWindow
{
Q_OBJECT
public:
QT_Softkeys(QWidget *parent = 0);
~QT_Softkeys();
public slots:
void closeClickked();
private:
Ui::QT_Softkeys ui;
};
#endif // QT_SOFTKEYS_H
Sets of dumbbells can be made use of to tone and educate lots of parts within your entire body.
ReplyDeletemy homepage :: Website URL
Together with the tone you are searching for, you might find that you are inside of a marvelous put for convenience with the Bowflex.
ReplyDeleteAlso visit my webpage bowflex selecttech 552 adjustable dumbbells
On the other hand, in case you have your individual house health club,
ReplyDeleteyou will be the sole consumer of the conditioning equipments and devices.
my blog; getfitnstrong.com
So locate the just one you get pleasure from and possess some enjoyable entering into shape.
ReplyDeleteAlso visit my web blog select dumbbells
Apart from offering your pal an extreme exercise, several of which she can
ReplyDeletedefine although other folks are preset, this equipment is likewise pretty straightforward to retail outlet and is not going to choose
up a great deal space.
Review my weblog :: dumbbell set adjustable
The Powerblock versions possess a pin system to improve the weight of every dumbbell.
ReplyDeleteFeel free to surf to my site ... adjustable dumbbells
DIFFERENCE BETWEEN WEATHER AND CLIMATE This was perfectly made. I am hoping you could post updates
ReplyDelete