本文整理汇总了C++中qtTrId函数的典型用法代码示例。如果您正苦于以下问题:C++ qtTrId函数的具体用法?C++ qtTrId怎么用?C++ qtTrId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qtTrId函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: qtTrId
void LevelScene::initPauseMenu3()
{
m_pauseMenu_opened=false;
m_pauseMenuID=3;
m_pauseMenu.setParentScene(this);
m_pauseMenu.construct(
//% "Pause"
qtTrId("LVL_MENU_PAUSE_TTL"),
PGE_MenuBox::msg_info, PGE_Point(-1,-1),
ConfigManager::setup_menu_box.box_padding,
ConfigManager::setup_menu_box.sprite);
m_pauseMenu.clearMenu();
std::vector<std::string> items;
//% "Continue"
items.push_back(qtTrId("LVL_MENU_PAUSE_CONTINUE"));
//% "Replay level"
items.push_back(qtTrId("LVL_MENU_PAUSE_REPLAY"));
//% "Quit"
items.push_back(qtTrId("LVL_MENU_PAUSE_EXIT"));
m_pauseMenu.addMenuItems(items);
m_pauseMenu.setRejectSnd(obj_sound_role::MenuPause);
m_pauseMenu.setMaxMenuItems(3);
m_isPauseMenu=false;
m_isTimeStopped=false;
}
示例2: MWidgetView
CallItemView::CallItemView(CallItem *controller)
: MWidgetView(controller),
//% "00:00:00"
m_duration(new MLabel(qtTrId("xx_default_duration"), controller)),
//% "..."
m_status(new MLabel(qtTrId("xx_default_status"), controller)),
m_updateTimer(this)
{
TRACE
m_controller = controller;
m_layout = new QGraphicsGridLayout;
m_layout->setContentsMargins(0,0,0,0);
m_layout->setSpacing(0);
m_controller->setLayout(m_layout);
m_status->setAlignment(Qt::AlignCenter);
if (peopleItem())
peopleItem()->setObjectName("callItemPeopleItem");
m_status->setObjectName("callItemStatusName");
initLayout();
connect(m_controller, SIGNAL(stateChanged()), SLOT(updateStatusLabel()));
}
示例3: realize
void ShutdownUI::showWindow(const QString &text1, const QString &text2, int timeout)
{
// If the widgets are not created create them now
realize();
if (!(text1.isEmpty() && text2.isEmpty())) {
// Set the labels to show the text strings that we got only if they exist
if (label1 != NULL) {
if (text1.startsWith("qtn")) {
label1->setText(qtTrId(text1.toLatin1().constData()));
} else {
label1->setText(text1);
}
}
if (label2 != NULL) {
if (text2.startsWith("qtn")) {
label2->setText(qtTrId(text2.toLatin1().constData()));
} else {
label2->setText(text2);
}
}
}
timer->stop();
show();
raise();
disableCompositorSwipeRect(this, rect());
feedback->play();
// Set the interval and start the timer to the next phase: hiding the labels and showing the logo
timer->start(timeout);
}
示例4: showMassStorageWarning
void
ResetWidget::clearActivated ()
{
MDialog *dialog;
MLocale locale;
QString question;
if (m_ResetBusinessLogic->isUsbConnected ()) {
showMassStorageWarning ();
return;
}
//% "Clear all user data and restore original settings?"
question = qtTrId("qtn_rset_clear_query").arg(locale.formatNumber(15));
question.replace ("\\n", "<br>");
question.replace ("\n", "<br>");
//% "Clear all data?"
dialog = new MMessageBox (qtTrId ("qtn_rset_clear_query_title"),
question, M::YesButton | M::NoButton);
connect (dialog, SIGNAL (accepted ()), SLOT (clearConfirmed ()));
connect (dialog, SIGNAL (rejected ()), SLOT (operationCancelled ()));
dialog->appear (MApplication::instance ()->activeWindow (),
MSceneWindow::DestroyWhenDone);
}
示例5: switch
void PlaylistModel::addHeader()
{
QString title;
PlaylistHeaderItem *header;
switch (m_playlist->type())
{
case QSpotifyPlaylist::Inbox:
//% "QTN_LIST_INBOX"
title = qtTrId("QTN_LIST_INBOX");
break;
case QSpotifyPlaylist::Starred:
//% "QTN_LIST_STARRED"
title = qtTrId("QTN_LIST_STARRED");
break;
case QSpotifyPlaylist::Playlist:
title = m_playlist->name();
break;
}
header = new PlaylistHeaderItem(title);
m_list.append(header);
}
示例6: if
void SwAcctEditPage::onFlickrClicked()
{
//We're logging out...
if (mService->isConfigured() && (mService->credsState() == SwClientService::CredsValid)) {
mServiceConfig->flickrDeleteLogin();
mFlickrClicked = false;
} else if (!mFlickrClicked) {
//We're pressing Login...
if (mServiceConfig->flickrOpenLogin())
//% "Continue"
mFlickrButton->setText(qtTrId("button_continue"));
else
qWarning("Couldn't open Flickr login!");
mFlickrClicked = true;
} else {
//We're pressing Continue
mServiceConfig->flickrContinueLogin();
mFlickrClicked = false;
//If we get success, it will switch to log out at soon as
//libsocialweb updates the DynCaps.
//If we get failure, we want it to say "Log in" to try again...
//% "Log in"
mFlickrButton->setText(qtTrId("button_login"));
}
}
示例7: spy
void
Ut_BatteryBusinessLogic::testPSMStateChanged ()
{
#ifdef HAVE_QMSYSTEM
QList<QVariant> arguments;
QSignalSpy spy (m_logic, SIGNAL (notificationSent (QString, QString, QString)));
/* Entering to power-save mode */
m_logic->devicePSMStateChanged (MeeGo::QmDeviceMode::PSMStateOn);
QTest::qWait (10);
QCOMPARE (spy.count (), 1);
arguments = spy.takeFirst ();
QVERIFY (arguments.at (0).toString () == "x-nokia.battery.enterpsm");
QVERIFY (arguments.at (1).toString () == qtTrId ("qtn_ener_ent_psnote"));
QVERIFY (arguments.at (2).toString () == "");
spy.clear ();
/* Exiting from power-save mode */
m_logic->devicePSMStateChanged (MeeGo::QmDeviceMode::PSMStateOff);
QTest::qWait (10);
QCOMPARE (spy.count (), 1);
arguments = spy.takeFirst ();
QVERIFY (arguments.at (0).toString () == "x-nokia.battery.exitpsm");
QVERIFY (arguments.at (1).toString () == qtTrId ("qtn_ener_exit_psnote"));
QVERIFY (arguments.at (2).toString () == "");
#endif
}
示例8: setTitle
void ApplicationMenuPage::retranslateUi()
{
//% "Application Menu"
setTitle(qtTrId("xx_applicationmenu_page_title"));
if (!isContentCreated())
return;
//% "Application Menu is a menu element available to any view. "
//% "<ul><li>It can be opened by tapping on the menu title area."
//% "</li><li>It contains commands and view settings for the view "
//% "in question and an optional area for style commands.</li>"
//% "<li>Each view of the application can have different menu "
//% "contents.</li></ul><b>Guidelines</b> for mandatory menu items: "
//% "<ul><li>Settings should be on the main View of the application, "
//% "unless the settings are specific to a sub-View</li>"
//% "<li>Help should be available in each View </li>"
//% "<li>Exit task should be present in all Views except for the "
//% "main View of the application.</li></ul>"
infoLabel->setText("<a></a>" + qtTrId("xx_applicationmenu_page_info"));
showText(m_textIndex);
//% "Italic"
actionItalic->setText(qtTrId("xx_appmenu_italic"));
//% "Normal"
actionNormal->setText(qtTrId("xx_appmenu_normal"));
}
示例9: MPopupList
void ConversationPage::openAttachmentOpenDialog()
{
MPopupList *popuplist = new MPopupList();
QStringListModel *model = new QStringListModel(this);
QDir homeDir = QDir::home();
// Hack: hardcoded the list of applications for the 1.1 release
QStringList apps = QStringList()
//% "Music player"
<< qtTrId("xx_music_player")
//% "Photo viewer"
<< qtTrId("xx_photo_viewer")
//% "Video player"
<< qtTrId("xx_video player");
model->setStringList(apps);
popuplist->setItemModel(model);
//% "Select an application"
popuplist->setTitle(qtTrId("xx_select_an_application"));
popuplist->appear();
connect(popuplist, SIGNAL(clicked(const QModelIndex&)), SLOT(applicationSelected(const QModelIndex &)));
}
示例10: QString
QString FilterableFacebookRelatedDataFilterInterface::dataSection(const QVariantMap &data)
{
if (sectionField().isEmpty()) {
return QString();
}
QString section = data.value(sectionField()).toString();
if (sectionField() == "rsvp_status") {
QString trueSection;
if (section == "attending") {
//: A section header for people attending an event
//% "Attending"
trueSection = qtTrId("facebook_event_attending");
} else if (section == "unsure") {
//: A section header for people that are unsure about attending to an event
//% "Unsure"
trueSection = qtTrId("facebook_event_unsure");
} else if (section == "declined") {
//: A section header for people who declined an event
//% "Declined"
trueSection = qtTrId("facebook_event_declined");
} else if (section == "not_replied") {
//: A section header for people who did not replied yet
//% "Not replied"
trueSection = qtTrId("facebook_event_not_replied");
}
return trueSection;
}
return section.left(1);
}
示例11: switch
void ShutdownScreen::applySystemState(MeeGo::QmSystemState::StateIndication what)
{
switch (what) {
case MeeGo::QmSystemState::Shutdown:
// To avoid early quitting on shutdown
HomeApplication::instance()->restoreSignalHandlers();
setWindowVisible(true);
break;
case MeeGo::QmSystemState::ThermalStateFatal:
//% "Temperature too high. Device shutting down."
createAndPublishNotification("x-nemo.battery.temperature", qtTrId("qtn_shut_high_temp"));
break;
case MeeGo::QmSystemState::ShutdownDeniedUSB:
//% "USB cable plugged in. Unplug the USB cable to shutdown."
createAndPublishNotification("device.added", qtTrId("qtn_shut_unplug_usb"));
break;
case MeeGo::QmSystemState::BatteryStateEmpty:
//% "Battery empty. Device shutting down."
createAndPublishNotification("x-nemo.battery.shutdown", qtTrId("qtn_shut_batt_empty"));
break;
default:
break;
}
}
示例12: qtTrId
/*
* gconftool-2 -t string -s /meegotouch/i18n/language hu_HU
*/
void
WarrantyWidget::retranslateUi ()
{
if (m_labelExpiration)
{
int expirationDays = m_WarrantyBusinessLogic->getExpirationDays ();
if (expirationDays > 0) {
//% "Product warranty will expire in <b>%Ln</b> day."
m_labelExpiration->setText (
qtTrId ("qtn_warr_expiration", expirationDays)
.arg (expirationDays));
} else if (expirationDays == 0) {
//% "Product warranty is expired."
m_labelExpiration->setText (qtTrId ("qtn_warr_expired"));
} else {
//% "Warranty timer error."
m_labelExpiration->setText (qtTrId ("qtn_warr_error_timer"));
}
}
/* This stuff is for eng.english generation */
#if 0
//% "(insert terms of warranty here)"
qtTrId ("qtn_warr_terms")
#endif
m_labelTerms->setText (m_warrantyText);
}
示例13: QString
void MRichTextEditDialogsManager::initTextStylingDialog()
{
selectedFontSize = -1;
selectedFontFamily = QString();
selectedFontColor = QColor();
if (dialogs.textStyles.first) {
return;
}
//% "Text styles"
dialogs.textStyles.first = new MDialog(qtTrId("qtn_comm_text_styles"),M::DoneButton);
dialogs.textStyles.second = false;
QGraphicsWidget *centralWidget = dialogs.textStyles.first->centralWidget();
MLayout *layout = new MLayout(centralWidget);
MLinearLayoutPolicy *policy = new MLinearLayoutPolicy(layout, Qt::Vertical);
// Initialize Font Family combo box
QFontDatabase fontDatabase;
QStringList fontFamilyValues = fontDatabase.families();
// NOTE: black listing some ill-behaving fonts temporarily
fontFamilyValues.removeAll("Webdings");
fontFamilyValues.removeAll("Wingdings");
fontFamilyCombo = new MComboBox(centralWidget);
//% "Font"
fontFamilyCombo->setTitle(qtTrId("qtn_comm_font"));
QStringListModel *fontModel = new QStringListModel(centralWidget);
fontModel->setStringList(fontFamilyValues);
fontFamilyCombo->setItemModel(fontModel);
policy->addItem(fontFamilyCombo);
connect(fontFamilyCombo, SIGNAL(activated(QString)),
this, SLOT(rememberFontFamily(QString)));
// Initialize Font Size combo box
fontSizeCombo = new MComboBox(centralWidget);
//% "Font size"
fontSizeCombo->setTitle(qtTrId("qtn_comm_font_size"));
QStringListModel *sizeModel = new QStringListModel(centralWidget);
fontSizeCombo->setItemModel(sizeModel);
policy->addItem(fontSizeCombo);
connect(fontSizeCombo, SIGNAL(activated(QString)),
this, SLOT(rememberFontSize()));
// Initialize Font Color item
fontColorCombo = new MColorComboBox(centralWidget);
//% "Font color"
fontColorCombo->setTitle(qtTrId("qtn_comm_font_color_combobox"));
policy->addItem(fontColorCombo);
connect(fontColorCombo, SIGNAL(colorPicked(QColor)),
this, SLOT(rememberFontColor(QColor)));
// Selections are applied at pressing button "Done"
connect(dialogs.textStyles.first, SIGNAL(accepted()),
this, SLOT(applySelection()));
}
示例14: SYS_DEBUG
void
OfflineBrief::setToggle (
bool toggle)
{
SYS_DEBUG ("toggle = %s", SYS_BOOL (toggle));
/*
* Don't do anything if we already in the desired mode
*/
if (toggle && m_LastMode == QmDeviceMode::Flight)
return;
else if ((! toggle) && m_LastMode == QmDeviceMode::Normal)
return;
#ifdef HAVE_QMSYSTEM
if (! toggle)
{
MMessageBox* dialog =
//% "Exit offline mode?"
new MMessageBox (qtTrId ("qtn_offl_exiting_title"),
//% "Connections will be restored."
qtTrId ("qtn_offl_exiting"),
M::YesButton | M::NoButton);
/*
* This will set the 'Normal' mode if dialog accepted
*/
connect (dialog, SIGNAL (accepted ()),
SLOT (processDialogResult ()));
/*
* This will switch back the button for the proper state
*/
connect (dialog, SIGNAL (rejected ()),
this, SIGNAL (valuesChanged ()));
dialog->appear (MApplication::activeWindow (),
MSceneWindow::DestroyWhenDone);
}
else
{
bool success = m_DevMode->setMode (QmDeviceMode::Flight);
SYS_DEBUG ("m_DevMode->setMode (Flight) success: %s", SYS_BOOL (success));
if (success)
{
m_infoBanner = new MBanner;
m_infoBanner->setStyleName ("InformationBanner");
m_infoBanner->setObjectName ("InfoBanner");
//% "Closing all connections. Switching to offline mode."
m_infoBanner->setTitle (qtTrId ("qtn_offl_entering"));
m_infoBanner->appear (
MApplication::activeWindow (),
MSceneWindow::DestroyWhenDone);
// Set to NULL, as will destroy itself
m_infoBanner = 0;
}
}
#endif
}
示例15: QCOMPARE
void Ut_BatteryBusinessLogic::testBatteryStateChanged()
{
#ifdef HAVE_QMSYSTEM
QList<QVariant> arguments;
gQmBatteryStub->stubReset();
gQmLEDStub->stubReset();
/* StateFull */
m_logic->batteryStateChanged(MeeGo::QmBattery::StateFull);
QCOMPARE(mNotificationEventTypes.count(), 1);
QCOMPARE(mNotificationEventTypes.at(0), QString("x-nemo.battery.chargingcomplete"));
QCOMPARE(mNotificationBodies.at(0), qtTrId("qtn_ener_charcomp"));
QCOMPARE(mNotificationSummaries.at(0), QString());
QCOMPARE(mNotificationImages.at(0), QString());
QCOMPARE(gQmLEDStub->stubLastCallTo("activate").parameter<QString>(0), QString("PatternBatteryFull"));
/* StateOK */
m_logic->batteryStateChanged(MeeGo::QmBattery::StateOK);
/* no notifications should be published, just silently no-op */
QCOMPARE(mNotificationEventTypes.count(), 1);
/* StateEmpty */
m_logic->batteryStateChanged(MeeGo::QmBattery::StateEmpty);
QCOMPARE(mNotificationEventTypes.count(), 2);
QCOMPARE(mNotificationEventTypes.at(1), QString("x-nemo.battery.recharge"));
QCOMPARE(mNotificationBodies.at(1), qtTrId("qtn_ener_rebatt"));
QCOMPARE(mNotificationSummaries.at(1), QString());
QCOMPARE(mNotificationImages.at(1), QString());
/* StateError */
m_logic->batteryStateChanged(MeeGo::QmBattery::StateError);
/* no notifications should be published, just silently no-op */
QCOMPARE(mNotificationEventTypes.count(), 2);
/* StateLow and charging */
gQmBatteryStub->stubSetReturnValue<MeeGo::QmBattery::ChargingState>("getChargingState", MeeGo::QmBattery::StateCharging);
m_logic->batteryStateChanged(MeeGo::QmBattery::StateLow);
/* no notifications should be published, because battery is charging... */
QCOMPARE(mNotificationEventTypes.count(), 2);
/* StateLow and not charging */
gQmBatteryStub->stubSetReturnValue<MeeGo::QmBattery::ChargingState>("getChargingState", MeeGo::QmBattery::StateNotCharging);
m_logic->setTouchScreenLockActive(true);
m_logic->batteryStateChanged(MeeGo::QmBattery::StateLow);
QCOMPARE(gLowBatteryNotifierStub->stubCallCount("setTouchScreenLockActive"), 1);
QCOMPARE(gLowBatteryNotifierStub->stubLastCallTo("setTouchScreenLockActive").parameter<bool>(0), true);
QCOMPARE(gLowBatteryNotifierStub->stubCallCount("sendLowBatteryAlert"), 1);
#endif
}