本文整理汇总了C++中Global::getThemeCss方法的典型用法代码示例。如果您正苦于以下问题:C++ Global::getThemeCss方法的具体用法?C++ Global::getThemeCss怎么用?C++ Global::getThemeCss使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Global
的用法示例。
在下文中一共展示了Global::getThemeCss方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: QComboBox
FontSizeComboBox::FontSizeComboBox(QWidget *parent) :
QComboBox(parent)
{
expanded = false;
setEditable(true);
QLineEdit *e;
e = lineEdit();
e->setReadOnly(false);
QString css = global.getThemeCss("fontSizeComboCss");
if (css!="")
this->setStyleSheet(css);
}
示例3: setupFileMenu
//.........这里部分代码省略.........
connect(printPreviewAction, SIGNAL(triggered()), parent, SLOT(printPreviewNote()));
setupShortcut(printPreviewAction, QString("File_Print_Preview"));
fileMenu->addAction(printPreviewAction);
//printPreviewAction->setVisible(false); // for some reason images don't show up in print preview, so this is useless. Check again in Qt5
printAction = new QAction(tr("&Print Note"), this);
printAction->setToolTip(tr("Print this note"));
connect(printAction, SIGNAL(triggered()), parent, SLOT(printNote()));
setupShortcut(printAction, QString("File_Print"));
fileMenu->addAction(printAction);
fileMenu->addSeparator();
backupDatabaseAction = new QAction(tr("&Backup Database"), this);
backupDatabaseAction->setToolTip(tr("Backup database to a file"));
connect(backupDatabaseAction, SIGNAL(triggered()), parent, SLOT(databaseBackup()));
setupShortcut(backupDatabaseAction, QString("File_Backup_Database"));
fileMenu->addAction(backupDatabaseAction);
restoreDatabaseAction = new QAction(tr("&Restore Database"), this);
restoreDatabaseAction->setToolTip(tr("Restore from a backup"));
connect(restoreDatabaseAction, SIGNAL(triggered()), parent, SLOT(databaseRestore()));
setupShortcut(restoreDatabaseAction, QString("File_Restore_Database"));
fileMenu->addAction(restoreDatabaseAction);
fileMenu->addSeparator();
exportNoteAction = new QAction(tr("&Export to NixNote Export"), this);
exportNoteAction->setToolTip(tr("Export selected notes to a NNEX file"));
connect(exportNoteAction, SIGNAL(triggered()), parent, SLOT(noteExport()));
setupShortcut(exportNoteAction, QString("File_Note_Export"));
fileMenu->addAction(exportNoteAction);
exportAsPdfAction = new QAction(tr("&Export notes as PDF"), this);
exportAsPdfAction->setToolTip(tr("Export selected notes to a PDF file"));
connect(exportAsPdfAction, SIGNAL(triggered()), parent, SLOT(onExportAsPdf()));
setupShortcut(exportAsPdfAction, QString("File_Note_Export_Pdf"));
fileMenu->addAction(exportAsPdfAction);
importNoteAction = new QAction(tr("&Import notes"), this);
importNoteAction->setToolTip(tr("Import notes from an export file"));
connect(importNoteAction, SIGNAL(triggered()), parent, SLOT(noteImport()));
setupShortcut(importNoteAction, QString("File_Note_Import"));
fileMenu->addAction(importNoteAction);
fileMenu->addSeparator();
QList<QString> names = global.accountsManager->nameList();
QList<int> ids = global.accountsManager->idList();
QList<QPair<int, QString>> pairList;
for (int i = 0; i < ids.size(); i++) {
pairList.append(QPair<int, QString>(ids[i], names[i]));
}
qSort(pairList.begin(), pairList.end(), QPairFirstComparer());
for (int i = 0; i < ids.size(); i++) {
QAction *accountAction = new QAction(pairList[i].second + " - (" + QString::number(pairList[i].first) + ")",
this);
accountAction->setData(pairList[i].first);
accountAction->setCheckable(true);
if (global.accountsManager->currentId == pairList[i].first)
accountAction->setChecked(true);
else {
accountAction->setText(
tr("Switch to ") + pairList[i].second + " - (" + QString::number(pairList[i].first) + ")");
}
fileMenu->addAction(accountAction);
connect(accountAction, SIGNAL(triggered()), parent, SLOT(switchUser()));
userAccountActions.append(accountAction);
}
addUserAction = new QAction(tr("&Add Another User..."), this);
fileMenu->addAction(addUserAction);
connect(addUserAction, SIGNAL(triggered()), parent, SLOT(addAnotherUser()));
userMaintenanceAction = new QAction(tr("&User Account Maintenance"), this);
fileMenu->addAction(userMaintenanceAction);
connect(userMaintenanceAction, SIGNAL(triggered()), parent, SLOT(userMaintenance()));
fileMenu->addSeparator();
openCloseAction = new QAction(tr("&Open/Close Notebooks"), this);
openCloseAction->setToolTip(tr("Open/Close Notebooks"));
connect(openCloseAction, SIGNAL(triggered()), parent, SLOT(openCloseNotebooks()));
setupShortcut(quitAction, QString("File_Notebook_OpenClose"));
fileMenu->addAction(openCloseAction);
fileMenu->addSeparator();
quitAction = new QAction(tr("Quit"), this);
quitAction->setToolTip(tr("Quit the program"));
connect(quitAction, SIGNAL(triggered()), parent, SLOT(quitNixNote()));
quitAction->setShortcut(QKeySequence::Close);
quitAction->setIcon(QIcon::fromTheme("exit"));
setupShortcut(quitAction, QString("File_Exit"));
fileMenu->addAction(quitAction);
QString menuCss = global.getThemeCss("menuCss");
if (menuCss != "")
this->setStyleSheet(menuCss);
}