本文整理汇总了C++中QMenu::setWindowTitle方法的典型用法代码示例。如果您正苦于以下问题:C++ QMenu::setWindowTitle方法的具体用法?C++ QMenu::setWindowTitle怎么用?C++ QMenu::setWindowTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMenu
的用法示例。
在下文中一共展示了QMenu::setWindowTitle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: file
//.........这里部分代码省略.........
QActionGroup* alignmentGroup = new QActionGroup(
this );
alignmentGroup->addAction(leftAlignAct);
alignmentGroup->addAction(rightAlignAct);
alignmentGroup->addAction(justifyAct);
alignmentGroup->addAction(centerAct);
leftAlignAct->setChecked(true);
// Nochmals zwei weitere Aktionen
QAction *InZoom = new QAction(
tr("&Zoom in ..."), this );
InZoom->setStatusTip(tr("Zoom in the text"));
connect( InZoom, SIGNAL(triggered()),
editor, SLOT(zoomIn() ) );
QAction *OutZoom = new QAction(
tr("&Zoom out ..."), this );
OutZoom->setStatusTip(tr("Zoom out the text"));
connect( OutZoom, SIGNAL(triggered() ),
editor, SLOT(zoomOut() ) );
// Ein Sub-Menü "Format" bei "Bearbeiten" einfügen
QMenu *formatMenu = workMenu->addMenu(
tr("&Format") );
formatMenu->addAction(underLineAct);
formatMenu->addSeparator();
formatMenu->addAction(leftAlignAct);
formatMenu->addAction(rightAlignAct);
formatMenu->addAction(justifyAct);
formatMenu->addAction(centerAct);
formatMenu->addSeparator();
formatMenu->addAction(InZoom);
formatMenu->addAction(OutZoom);
workMenu->setTearOffEnabled(true);
workMenu->setWindowTitle("Bearbeiten");
// Zur Demonstration eine Aktion mit QVariant
Start = new QAction(tr("&Programmstart ..."), this);
Start->setStatusTip(tr("Zeit des Programmstarts"));
Start->setData(QVariant(QTime::currentTime()));
QFont font; font.setBold(true);
Start->setFont(font);
Start->setShortcut(tr("Ctrl+T"));
Start->setShortcutContext(Qt::ApplicationShortcut);
connect( Start, SIGNAL( triggered() ),
this, SLOT( printStart() ) );
workMenu->addAction(Start);
// Eine neue Statusleiste erzeugen und zum
// Hauptfenster hinzufügen
(void*) statusBar ();
// Permanente Meldung in der Statusleiste
// Zeichen, Wörter, Zeilen
sLabel = new QLabel;
sLabel->setFrameStyle(
QFrame::Panel | QFrame::Sunken );
sLabel->setLineWidth(2);
statusBar()->addPermanentWidget(sLabel);
connect( editor, SIGNAL( textChanged() ),
this, SLOT( updateStatusBar() ) );
updateStatusBar();
// Laufend aktuelle Uhrzeit in der Statusleiste
time = new QLCDNumber;
time->setFrameStyle(QFrame::Panel | QFrame::Sunken);
time->setLineWidth(2);
time->setSegmentStyle(QLCDNumber::Flat);