<br>I'm using pyqt/QT4 for the first time.<br><br>In this menuing example below, there is a call to a function called tr(), but I don't understand what it does or why it's needed.<br>Additionally, I must be looking in the wrong part of the help file for QT. I don't see any documentation for tr()
<br>What is this fnction for, when is it needed?<br>thanks<br><br><span style="font-family: Courier New,courier;"> MainWindow::MainWindow()<br> {<br> QWidget *w = new QWidget;<br> setCentralWidget(w);<br>
<br> QWidget *topFiller = new QWidget;<br> topFiller->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);<br><br> infoLabel = new QLabel(tr("<i>Choose a menu option, or right-click to "
<br> "invoke a context menu</i>"));<br> infoLabel->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);<br> infoLabel->setAlignment(Qt::AlignCenter);<br>
<br> QWidget *bottomFiller = new QWidget;<br> bottomFiller->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);<br><br> QVBoxLayout *vbox = new QVBoxLayout;<br> vbox->setMargin(5);
<br> vbox->addWidget(topFiller);<br> vbox->addWidget(infoLabel);<br> vbox->addWidget(bottomFiller);<br> w->setLayout(vbox);<br><br> createActions();<br> createMenus();
<br><br> statusBar()->showMessage(tr("A context menu is available by right-clicking"));<br><br> setWindowTitle(tr("Menus"));<br> setMinimumSize(160, 160);<br> resize(480, 320);
<br> }<br><br></span><br>