本文整理汇总了C++中Font::Clone方法的典型用法代码示例。如果您正苦于以下问题:C++ Font::Clone方法的具体用法?C++ Font::Clone怎么用?C++ Font::Clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Font
的用法示例。
在下文中一共展示了Font::Clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QDialog
EditFontDialog::EditFontDialog(const String & editFontPresetName, QDialog *parent) :
QDialog(parent),
ui(new Ui::EditFontDialog)
{
ui->setupUi(this);
ui->buttonBox->button( QDialogButtonBox::Ok )->setEnabled(false);
dialogResult.fontPresetOriginalName = editFontPresetName;
dialogResult.fontPresetName = editFontPresetName;
Font* font = EditorFontManager::Instance()->GetLocalizedFont(editFontPresetName, "default");
dialogResult.font = font ? font->Clone() : EditorFontManager::Instance()->GetDefaultFont()->Clone();
const Vector<String> &locales = EditorFontManager::Instance()->GetLocales();
int32 localesCount = locales.size();
for(int32 i = 0; i < localesCount; ++i)
{
Font* localizedFont = EditorFontManager::Instance()->GetLocalizedFont(editFontPresetName, locales[i]);
dialogResult.localizedFonts[locales[i]] = localizedFont ? localizedFont->Clone() : dialogResult.font->Clone();
Logger::FrameworkDebug("EditFontDialog::EditFontDialog dialogResult.localizedFonts[%s] = %p", locales[i].c_str(), dialogResult.localizedFonts[locales[i]]);
ui->selectLocaleComboBox->addItem(QString::fromStdString(locales[i]));
}
if(0 < localesCount)
{
currentLocale = locales[0];
}
// Initialize dialog
ConnectToSignals();
}
示例2: OkButtonClicked
void FontManagerDialog::OkButtonClicked()
{
Font *returnFont = NULL;
QItemSelectionModel *selectionModel = ui->fontsTableView->selectionModel();
if (selectionModel->hasSelection())
{
returnFont = GetSelectedFont(selectionModel);
if (returnFont)
{
//Set dialog resulting font - it corresponds to selected font by user
dialogResultFont = returnFont->Clone();
SafeRelease(returnFont);
//Set dialog result as QDialog::Accepted and close it
accept();
}
}
}