Описание тега qpushbutton
QPushButton is a Qt library class that represents ordinary push buttons, and gives the API to manipulate them.
QPushButton
offers a set of functions to manipulate the button's appearance and behavior.
A minimalistic QPushButton
example will look like this:
#include <QtGui>
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a( argc, argv );
QPushButton * myButton = new QPushButton("Hello, World!");
myButton->show();
return a.exec();
}
One of QPushButton
's most notable properties is Checkable
, which can be accessed via setCheckable( bool )
function. If this option is set to true
, the QPushButton
becomes a toggle button which can be toggles on and off, and will stay in the corresponding state until toggled again.
The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.