本文整理汇总了C++中Global::getGuiFont方法的典型用法代码示例。如果您正苦于以下问题:C++ Global::getGuiFont方法的具体用法?C++ Global::getGuiFont怎么用?C++ Global::getGuiFont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Global
的用法示例。
在下文中一共展示了Global::getGuiFont方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QDialog
// Constructor. Thys happens when the class is declared.
NotebookProperties::NotebookProperties(QWidget *parent) :
QDialog(parent)
{
okPressed = false;
setWindowTitle(tr("Notebook"));
setWindowIcon(global.getIconResource(":notebookSmallIcon"));
setLayout(&grid);
syncBox.setText(tr("Synchronized"));
syncBox.setChecked(true);
syncBox.setEnabled(false);
defaultNotebook.setText(tr("Default"));
defaultNotebook.setChecked(false);
defaultNotebook.setEnabled(true);
connect(&name, SIGNAL(textChanged(const QString&)), this, SLOT(validateInput()));
nameLabel.setText(tr("Name"));
queryGrid.addWidget(&nameLabel, 1,1);
queryGrid.addWidget(&name, 1, 2);
queryGrid.addWidget(&syncBox, 2,2);
queryGrid.addWidget(&defaultNotebook, 3,2);
// queryGrid.setContentsMargins(10, 10, -10, -10);
grid.addLayout(&queryGrid,1,1);
ok.setText(tr("OK"));
connect(&ok, SIGNAL(clicked()), this, SLOT(okButtonPressed()));
cancel.setText(tr("Cancel"));
connect(&cancel, SIGNAL(clicked()), this, SLOT(cancelButtonPressed()));
buttonGrid.addWidget(&ok, 1, 1);
buttonGrid.addWidget(&cancel, 1,2);
grid.addLayout(&buttonGrid,2,1);
this->setFont(global.getGuiFont(font()));
}
示例2: createThemeMenu
void NMainMenuBar::createThemeMenu(QMenu *parentMenu) {
QMenu *menu = parentMenu->addMenu(tr("Theme"));
QStringList list = global.getThemeNames();
QFont f = global.getGuiFont(QFont());
global.settings->beginGroup(INI_GROUP_APPEARANCE);
QString userTheme = global.settings->value("themeName", DEFAULT_THEME_NAME).toString();
global.settings->endGroup();
// Setup themes (we expect to find the DEFAULT_THEME_NAME theme as first one)
for (int i = 0; i < list.size(); i++) {
QString themeName(list[i]);
if ((i == 0) && (QString::compare(themeName, DEFAULT_THEME_NAME, Qt::CaseInsensitive) != 0)) {
QLOG_ERROR() << "First theme is expected to be " << DEFAULT_THEME_NAME;
}
QAction *themeAction = new QAction(themeName, this);
themeAction->setData(themeName);
themeAction->setCheckable(true);
themeAction->setFont(f);
connect(themeAction, SIGNAL(triggered()), parent, SLOT(reloadIcons()));
if (themeName == userTheme) {
themeAction->setChecked(true);
}
themeActions.append(themeAction);
}
menu->addActions(themeActions);
menu->setFont(f);
}
示例3: createSortMenu
void NMainMenuBar::createSortMenu(QMenu *parentMenu) {
sortMenu = parentMenu->addMenu(tr("Sort notes by"));
QFont f = global.getGuiFont(QFont());
QActionGroup *menuActionGroup = new QActionGroup(this);
menuActionGroup->setExclusive(true);
addSortAction(sortMenu, menuActionGroup, f, tr("Relevance, Date updated [desc]"), INI_VALUE_SORTORDER_DEFAULT);
addSortAction(sortMenu, menuActionGroup, f, tr("Relevance, Date updated [asc]"), "relevance desc, dateUpdated asc");
addSortAction(sortMenu, menuActionGroup, f, tr("Relevance, Date created [desc]"), "relevance desc, dateCreated desc");
addSortAction(sortMenu, menuActionGroup, f, tr("Relevance, Date created [asc]"), "relevance desc, dateCreated asc");
addSortAction(sortMenu, menuActionGroup, f, tr("Relevance, Title [desc]"), "relevance desc, title desc");
addSortAction(sortMenu, menuActionGroup, f, tr("Relevance, Title [asc]"), "relevance desc, title asc");
sortMenu->addSeparator();
addSortAction(sortMenu, menuActionGroup, f, tr("Date updated [desc]"), "dateUpdated desc");
addSortAction(sortMenu, menuActionGroup, f, tr("Date updated [asc]"), "dateUpdated asc");
addSortAction(sortMenu, menuActionGroup, f, tr("Date created [desc]"), "dateCreated desc");
addSortAction(sortMenu, menuActionGroup, f, tr("Date created [asc]"), "dateCreated asc");
addSortAction(sortMenu, menuActionGroup, f, tr("Title [desc]"), "title desc");
addSortAction(sortMenu, menuActionGroup, f, tr("Title [asc]"), "title asc");
addSortAction(sortMenu, menuActionGroup, f, tr("Size [desc]"), "size desc, dateUpdated desc");
addSortAction(sortMenu, menuActionGroup, f, tr("Has todo [desc]"), "hasTodo desc, dateUpdated desc");
addSortAction(sortMenu, menuActionGroup, f, tr("Unsynced first"), "isDirty desc, dateUpdated desc");
sortMenu->setFont(f);
}
示例4: QToolButton
LocationEditor::LocationEditor(QWidget *parent) :
QToolButton(parent)
{
QPalette pal;
pal.setColor(backgroundRole(), QPalette::Base);
setPalette(pal);
this->setFont(global.getGuiFont(font()));
inactiveColor = "QToolButton {background-color: transparent; border-radius: 0px; border:none; margin 0px; padding: 4px} ";
this->setCursor(Qt::PointingHandCursor);
this->setStyleSheet(inactiveColor);
defaultText = QString(tr("Click to set location..."));
this->setText(defaultText);
actionMenu = new QMenu();
editAction = actionMenu->addAction(tr("Edit..."));
clearAction = actionMenu->addAction(tr("Clear"));
viewAction = actionMenu->addAction(tr("View on map"));
connect(editAction, SIGNAL(triggered()), this, SLOT(buttonClicked()));
connect(viewAction, SIGNAL(triggered()), this, SLOT(viewClicked()));
connect(clearAction, SIGNAL(triggered()), this, SLOT(clearClicked()));
setAutoRaise(false);
setMenu(actionMenu);
this->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
this->reloadIcons();
connect(this, SIGNAL(clicked()), this, SLOT(buttonClicked()));
hide();
}
示例5: loadFontNames
// Load the list of font names
void EditorButtonBar::loadFontNames() {
if (global.forceWebFonts){
QStringList fontFamilies;
fontFamilies.append("Gotham");
fontFamilies.append("Georgia");
fontFamilies.append("Helvetica");
fontFamilies.append("Courier New");
fontFamilies.append("Times New Roman");
fontFamilies.append("Times");
fontFamilies.append("Trebuchet");
fontFamilies.append("Verdana");
fontFamilies.sort();
bool first = true;
for (int i = 0; i < fontFamilies.size(); i++) {
fontNames->addItem(fontFamilies[i], fontFamilies[i].toLower());
QFont f;
global.getGuiFont(f);
f.setFamily(fontFamilies[i]);
fontNames->setItemData(i, QVariant(f), Qt::FontRole);
if (first) {
loadFontSizeComboBox(fontFamilies[i]);
first=false;
}
}
return;
}
// Load up the list of font names
QFontDatabase fonts;
QStringList fontFamilies = fonts.families();
fontFamilies.append(tr("Times"));
fontFamilies.sort();
bool first = true;
for (int i = 0; i < fontFamilies.size(); i++) {
fontNames->addItem(fontFamilies[i], fontFamilies[i].toLower());
QFont f;
global.getGuiFont(f);
f.setFamily(fontFamilies[i]);
fontNames->setItemData(i, QVariant(f), Qt::FontRole);
if (first) {
loadFontSizeComboBox(fontFamilies[i]);
first=false;
}
}
}
示例6: QWidget
LocalePreferences::LocalePreferences(QWidget *parent) :
QWidget(parent)
{
mainLayout = new QGridLayout(this);
mainLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
setLayout(mainLayout);
QDate date = QDate::currentDate();
QTime time = QTime::currentTime();
dateFormatLabel = new QLabel(tr("Date Format"), this);
dateFormatLabel->setAlignment(Qt::AlignRight | Qt::AlignCenter);
dateFormat = new QComboBox(this);
dateFormat->addItem(tr("MM/dd/yy - ") + date.toString("MM/dd/yy"), MMddyy);
dateFormat->addItem(tr("MM/dd/yyyy - ")+ date.toString("MM/dd/yyyy"), MMddyyyy);
dateFormat->addItem(tr("M/dd/yyyy - ")+ date.toString("M/dd/yyyy"), Mddyyyy);
dateFormat->addItem(tr("M/d/yyyy - ")+ date.toString("M/d/yyyy"), Mdyyyy);
dateFormat->addItem(tr("dd/MM/yy - ")+ date.toString("dd/MM/yy"), ddMMyy);
dateFormat->addItem(tr("d/M/yy - ")+ date.toString("d/M/yy"), dMyy);
dateFormat->addItem(tr("dd/MM/yyyy - ")+ date.toString("dd/MM/yyyy"), ddMMyyyy);
dateFormat->addItem(tr("d/M/yyyy - ")+ date.toString("d/M/yyyy"), dMyyyy);
dateFormat->addItem(tr("yyyy-MM-dd - ")+ date.toString("yyyy-MM-dd"), yyyyMMdd);
dateFormat->addItem(tr("yy-MM-dd - ")+ date.toString("yy-MM-dd"), yyyyMMdd);
timeFormatLabel = new QLabel(tr("Time Format"), this);
timeFormatLabel->setAlignment(Qt::AlignRight | Qt::AlignCenter);
timeFormat = new QComboBox(this);
timeFormat->addItem(tr("HH:mm:ss - ")+time.toString("HH:mm:ss"), HHmmss);
timeFormat->addItem(tr("HH:mm:ss a - ")+time.toString("HH:mm:ss a"), HHmmssa);
timeFormat->addItem(tr("HH:mm - ")+time.toString("HH:mm"), HHmm);
timeFormat->addItem(tr("HH:mm a - ")+time.toString("HH:mm a"), HHmma);
timeFormat->addItem(tr("hh:mm:ss - ")+time.toString("hh:mm:ss"), hhmmss);
timeFormat->addItem(tr("hh:mm:ss a- ")+time.toString("hh:mm:ss a"), hhmmssa);
timeFormat->addItem(tr("h:mm:ss a - ")+time.toString("h:mm:ss a"), hmmssa);
timeFormat->addItem(tr("hh:mm - ")+time.toString("HH:mm"), hhmm);
timeFormat->addItem(tr("hh:mm a - ")+time.toString("hh:mm a"), hhmma);
timeFormat->addItem(tr("h:mm a - ")+time.toString("h:mm a"), hmma);
mainLayout->addWidget(dateFormatLabel,0,0);
mainLayout->addWidget(dateFormat,0,1);
mainLayout->addWidget(timeFormatLabel,1,0);
mainLayout->addWidget(timeFormat, 1,1);
global.settings->beginGroup("Locale");
int datei = global.settings->value("dateFormat", MMddyy).toInt();
int timei = global.settings->value("timeFormat", HHmmss).toInt();
global.settings->endGroup();
int index = dateFormat->findData(datei);
dateFormat->setCurrentIndex(index);
index = timeFormat->findData(timei);
timeFormat->setCurrentIndex(index);
this->setFont(global.getGuiFont(font()));
}
示例7: QMenuBar
NMainMenuBar::NMainMenuBar(QWidget *parent) :
QMenuBar(parent) {
this->parent = (NixNote *) parent;
QFont f = global.getGuiFont(QFont());
this->setFont(f);
setupFileMenu();
setupEditMenu();
setupViewMenu();
setupNoteMenu();
setupToolsMenu();
setupHelpMenu();
}
示例8: QDialog
EnCryptDialog::EnCryptDialog(QWidget *parent) :
QDialog(parent)
{
wasOkPressed = false;
setWindowTitle(tr("Encrypt Text"));
//setWindowIcon(new QIcon(iconPath+"password.png"));
QGridLayout *grid = new QGridLayout(this);
QGridLayout *input = new QGridLayout(this);
QGridLayout *msgGrid = new QGridLayout(this);
QGridLayout *button = new QGridLayout(this);
setLayout(grid);
hint.setText("");
password.setText("");
password.setEchoMode(QLineEdit::Password);
password2.setText("");
password2.setEchoMode(QLineEdit::Password);
input->addWidget(new QLabel(tr("Password"), this), 1,1);
input->addWidget(&password, 1, 2);
input->addWidget(new QLabel(tr("Verify"), this), 2,1);
input->addWidget(&password2, 2, 2);
input->addWidget(new QLabel(tr("Hint"), this), 3,1);
input->addWidget(&hint, 3, 2);
input->addWidget(new QLabel(tr("Remember Password")), 4,1);
input->addWidget(&rememberPassword, 4,2);
input->setContentsMargins(10, 10, -10, -10);
grid->addLayout(input, 1,1);
msgGrid->addWidget(&error, 1, 1);
grid->addLayout(msgGrid, 2, 1);
ok.setText(tr("OK"));
connect(&ok, SIGNAL(clicked()), this, SLOT(okButtonPressed()));
ok.setEnabled(false);
QPushButton *cancel = new QPushButton(tr("Cancel"), this);
connect(cancel, SIGNAL(clicked()), this, SLOT(cancelButtonPressed()));
button->addWidget(&ok, 1, 1);
button->addWidget(cancel, 1,2);
grid->addLayout(button, 3, 1);
connect(&password, SIGNAL(textChanged(QString)), this, SLOT(validateInput()));
connect(&password2, SIGNAL(textChanged(QString)), this, SLOT(validateInput()));
connect(&hint, SIGNAL(textChanged(QString)), this, SLOT(validateInput()));
this->setFont(global.getGuiFont(font()));
}
示例9: QLineEdit
TreeWidgetEditor::TreeWidgetEditor(QTreeWidget *parent) :
QLineEdit(parent)
{
this->parent = parent;
this->setFont(global.getGuiFont(font()));
lid = 0;
stackName = "";
connect(this, SIGNAL(returnPressed()), SLOT(textChanged()));
QString css = global.getThemeCss("treeWidgetEditorCss");
if (css!="")
this->setStyleSheet(css);
}
示例10: setupNoteMenu
void NMainMenuBar::setupNoteMenu() {
noteMenu = this->addMenu(tr("&Note"));
QFont f = global.getGuiFont(QFont());
noteMenu->setFont(f);
newNoteAction = new QAction(tr("New &Note"), noteMenu);
setupShortcut(newNoteAction, QString("File_Note_Add"));
noteMenu->addAction(newNoteAction);
connect(newNoteAction, SIGNAL(triggered()), parent, SLOT(newNote()));
duplicateNoteAction = new QAction(tr("Dupl&icate Note"), noteMenu);
setupShortcut(duplicateNoteAction, QString("File_Note_Duplicate"));
noteMenu->addAction(duplicateNoteAction);
connect(duplicateNoteAction, SIGNAL(triggered()), parent, SLOT(duplicateCurrentNote()));
deleteNoteAction = new QAction(tr("&Delete"), noteMenu);
setupShortcut(deleteNoteAction, QString("File_Note_Delete"));
noteMenu->addAction(deleteNoteAction);
connect(deleteNoteAction, SIGNAL(triggered()), parent, SLOT(deleteCurrentNote()));
reindexNoteAction = new QAction(tr("Reindex Note"), noteMenu);
setupShortcut(reindexNoteAction, QString("File_Note_Reindex"));
noteMenu->addAction(reindexNoteAction);
connect(reindexNoteAction, SIGNAL(triggered()), parent, SLOT(reindexCurrentNote()));
if (parent->hunspellPluginAvailable) {
noteMenu->addSeparator();
spellCheckAction = new QAction(tr("&Spell Check"), noteMenu);
// setupShortcut(spellCheckAction, QString("Tools_Spell_Check")); This shortcut is done by the editor button bar
noteMenu->addAction(spellCheckAction);
connect(spellCheckAction, SIGNAL(triggered()), parent, SLOT(spellCheckCurrentNote()));
}
noteMenu->addSeparator();
pinNoteAction = new QAction(tr("&Pin Note"), noteMenu);
setupShortcut(pinNoteAction, QString("NOTE_PIN"));
noteMenu->addAction(pinNoteAction);
connect(pinNoteAction, SIGNAL(triggered()), parent, SLOT(pinCurrentNote()));
unpinNoteAction = new QAction(tr("&UnPin Note"), noteMenu);
setupShortcut(unpinNoteAction, QString("NOTE_UNPIN"));
noteMenu->addAction(unpinNoteAction);
connect(unpinNoteAction, SIGNAL(triggered()), parent, SLOT(unpinCurrentNote()));
}
示例11: QLineEdit
NTitleEditor::NTitleEditor(QWidget *parent) :
QLineEdit(parent)
{
// Setup the note title editor
QPalette pal;
//pal.setColor(QPalette::Text, QColor(102,153,255));
pal.setColor(QPalette::Text, QColor(14,28,209));
pal.setColor(backgroundRole(), QPalette::Base);
setPalette(pal);
inactiveColor = "QLineEdit {background-color: transparent; border-radius: 0px;} QLineEdit:hover {border: 1px solid #808080; background-color: white; border-radius: 4px;} ";
activeColor = "QLineEdit {border: 1px solid #808080; background-color: white; border-radius: 4px;} ";
this->setStyleSheet(inactiveColor);
connect(this, SIGNAL(textChanged(QString)), this, SLOT(titleChanged(QString)));
this->setFont(global.getGuiFont(font()));
}
示例12: icon
NTrashTree::NTrashTree(QWidget *parent) :
QTreeWidget(parent)
{
this->count = 0;
this->setFont(global.getGuiFont(font()));
filterPosition = -1;
// setup options
this->setEditTriggers(QAbstractItemView::NoEditTriggers);
this->setSelectionBehavior(QAbstractItemView::SelectRows);
this->setSelectionMode(QAbstractItemView::ExtendedSelection);
this->setRootIsDecorated(true);
this->setSortingEnabled(false);
this->header()->setVisible(false);
this->setContentsMargins(10,10,10,10);
//this->setStyleSheet("QTreeWidget { border: none; background-color:transparent; }");
// Build the root item
QIcon icon(":trashIcon");
root = new QTreeWidgetItem(this);
root->setIcon(0,icon);
root->setData(0, Qt::UserRole, "root");
root->setData(0, Qt::DisplayRole, tr("Trash"));
QFont font = root->font(0);
font.setBold(true);
root->setFont(0,font);
this->setMinimumHeight(1);
this->addTopLevelItem(root);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
connect(this, SIGNAL(itemExpanded(QTreeWidgetItem*)), this, SLOT(calculateHeight()));
connect(this, SIGNAL(itemCollapsed(QTreeWidgetItem*)), this, SLOT(calculateHeight()));
connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(buildSelection()));
restoreAction = contextMenu.addAction(tr("Restore Deleted Notes"));
connect(restoreAction, SIGNAL(triggered()), SLOT(restoreAll()));
contextMenu.addSeparator();
expungeAction = contextMenu.addAction(tr("Empty Trash"));
connect(expungeAction, SIGNAL(triggered()), this, SLOT(expungeAll()));
setItemDelegate(new NTrashViewDelegate());
this->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
this->setFrameShape(QFrame::NoFrame);
}
示例13: QWidget
SearchPreferences::SearchPreferences(QWidget *parent) :
QWidget(parent)
{
QGridLayout *mainLayout = new QGridLayout(this);
setLayout(mainLayout);
syncAttachments = new QCheckBox(tr("Index Attachments"));
mainLayout->addWidget(syncAttachments,0,0);
syncAttachments->setChecked(global.synchronizeAttachments());
weight = new QSpinBox(this);
mainLayout->addWidget(new QLabel(tr("Minimum Image Recognition Weight")), 1,0);
mainLayout->addWidget(weight,1,1);
weight->setMinimum(1);
weight->setMaximum(100);
weight->setValue(global.getMinimumRecognitionWeight());
this->setFont(global.getGuiFont(font()));
}
示例14: loadFontNames
// Load the list of font names
void EditorButtonBar::loadFontNames() {
QFontDatabase fonts;
QStringList fontFamilies = fonts.families();
fontFamilies.append(tr("Times"));
fontFamilies.sort();
bool first = true;
//QFontDatabase fdb;
for (int i = 0; i < fontFamilies.size(); i++) {
fontNames->addItem(fontFamilies[i], fontFamilies[i].toLower());
QFont f;
global.getGuiFont(f);
f.setFamily(fontFamilies[i]);
fontNames->setItemData(i, QVariant(f), Qt::FontRole);
if (first) {
loadFontSizeComboBox(fontFamilies[i]);
first=false;
}
}
}
示例15: f
AboutDialog::AboutDialog(QDialog *parent) :
QDialog(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout();
this->setLayout(mainLayout);
QWebView *page = new QWebView();
QPushButton *okButton = new QPushButton();
okButton->setText(tr("OK"));
mainLayout->addWidget(page);
QHBoxLayout *buttonLayout = new QHBoxLayout();
QSpacerItem *spacer1 = new QSpacerItem(100000,1, QSizePolicy::Maximum);
QSpacerItem *spacer2 = new QSpacerItem(100000,1, QSizePolicy::Maximum);
buttonLayout->addSpacerItem(spacer1);
buttonLayout->addWidget(okButton);
buttonLayout->addSpacerItem(spacer2);
mainLayout->addLayout(buttonLayout);
this->setLayout(mainLayout);
QString file = global.fileManager.getProgramDirPath("") + "/help/about.html";
QFile f(file);
if(!f.open(QFile::ReadOnly))
return;
QTextStream is(&f);
QString data = is.readAll();
QString translationInformation =
tr("Note to translators: For translation credit, change this message to your name & contact information and it will appear in the About dialog box. HTML Formatting is available.");
QString translationStaticInformation =
"Note to translators: For translation credit, change this message to your name & contact information and it will appear in the About dialog box. HTML Formatting is available.";
if (translationInformation == translationStaticInformation) {
data.replace("__TRANSLATION__", "");
} else {
data = data.replace("__TRANSLATION__", translationInformation);
}
#ifndef _WIN32
data = data.replace("__LOGO__", "file://"+global.fileManager.getImageDirPath("")+"splash_logo.png");
#else
data = data.replace("__LOGO__", "file:///"+global.fileManager.getImageDirPath("").replace("\\","/")+"splash_logo.png");
#endif
page->setHtml(data);
connect(okButton, SIGNAL(clicked()), this, SLOT(close()));
this->resize(600,500);
this->setFont(global.getGuiFont(font()));
}