本文整理汇总了C++中Global::getIconResource方法的典型用法代码示例。如果您正苦于以下问题:C++ Global::getIconResource方法的具体用法?C++ Global::getIconResource怎么用?C++ Global::getIconResource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Global
的用法示例。
在下文中一共展示了Global::getIconResource方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QWidget
PopplerViewer::PopplerViewer(const QString &mimeType, const QString &reslid, QWidget *parent) :
QWidget(parent)
{
this->mimeType = mimeType;
this->lid = reslid.toInt();
printImageFile = global.fileManager.getTmpDirPath() + QString::number(lid) +QString("-print.png");
QString file = global.fileManager.getDbaDirPath() + reslid +".pdf";
doc = Poppler::Document::load(file);
if (doc == NULL || doc->isLocked())
return;
currentPage = 0;
totalPages = doc->numPages();
image = new QImage(doc->page(currentPage)->renderToImage());
scene = new QGraphicsScene();
view = new PopplerGraphicsView(scene);
view->filename = file;
item = new QGraphicsPixmapItem(QPixmap::fromImage(*image));
image->save(printImageFile); // This is in case we want to print a note. Otherwise it isn't used.
scene->addItem(item);
view->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
QHBoxLayout *buttonLayout = new QHBoxLayout();
pageLabel = new QLabel(tr("Page ") +QString::number(currentPage+1) + QString(tr(" of ") +QString::number(totalPages)), this);
pageLeft = new QPushButton();
pageRight = new QPushButton();
pageRight->setMaximumWidth(30);
pageLeft->setMaximumWidth(30);
pageLeft->setIcon(global.getIconResource(":leftArrowIcon"));
pageRight->setIcon(global.getIconResource(":rightArrowIcon"));
buttonLayout->addStretch(100);
buttonLayout->addWidget(pageLeft);
buttonLayout->addWidget(pageLabel);
buttonLayout->addWidget(pageRight);
buttonLayout->addStretch(100);
QVBoxLayout *layout = new QVBoxLayout(this);
layout->addLayout(buttonLayout);
layout->addWidget(view);
this->setLayout(layout);
connect(pageRight, SIGNAL(clicked()), this, SLOT(pageRightPressed()));
connect(pageLeft, SIGNAL(clicked()), this, SLOT(pageLeftPressed()));
if (totalPages == 1) {
pageRight->setEnabled(false);
}
pageLeft->setEnabled(false);
}
示例2: QDialog
LoginDialog::LoginDialog(QWidget *parent) :
QDialog(parent)
{
okPressed = false;
setWindowTitle(tr("NixNote Login"));
setWindowIcon(global.getIconResource(":passwordIcon"));
setLayout(&grid);
password.setEchoMode(QLineEdit::Password);
connect(&userid, SIGNAL(textChanged(const QString&)), this, SLOT(validateInput()));
connect(&password, SIGNAL(textChanged(const QString&)), this, SLOT(validateInput()));
useridLabel.setText(tr("Userid"));
passwordLabel.setText(tr("Password"));
passwordGrid.addWidget(&useridLabel, 1,1);
passwordGrid.addWidget(&userid, 1, 2);
passwordGrid.addWidget(&passwordLabel, 2,1);
passwordGrid.addWidget(&password, 2, 2);
passwordGrid.setContentsMargins(10, 10, -10, -10);
grid.addLayout(&passwordGrid,1,1);
ok.setText(tr("OK"));
if (global.password == "" and global.username == "")
ok.setEnabled(false);
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);
grid.setSizeConstraint( QLayout::SetFixedSize );
this->setFont(global.getGuiFont(font()));
}
示例3: 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()));
}
示例4: buildTreeEntry
void FavoritesView::buildTreeEntry(FavoritesViewItem *parent, const FavoritesRecord *record) {
FavoritesViewItem *item = new FavoritesViewItem();
item->setFlags(item->flags() & ~Qt::ItemIsDropEnabled);
item->record.lid = record->lid;
item->setData(NAME_POSITION, Qt::UserRole, record->lid);
item->record.type = record->type;
item->record.target = record->target;
item->record.order = record->order;
item->setText(NAME_POSITION, record->displayName);
switch (record->type) {
case FavoritesRecord::Tag :
item->setIcon(NAME_POSITION, global.getIconResource(":tagIcon"));
break;
case FavoritesRecord::Note :
item->setIcon(NAME_POSITION, global.getIconResource(":newNoteIcon"));
break;
case FavoritesRecord::ConflictNotebook :
item->setIcon(NAME_POSITION, global.getIconResource(":notebookConflictIcon"));
break;
case FavoritesRecord::LinkedNotebook :
item->setIcon(NAME_POSITION, global.getIconResource(":notebookLinkedIcon"));
break;
case FavoritesRecord::LinkedStack :
item->setIcon(NAME_POSITION, global.getIconResource(":silhouetteIcon"));
break;
case FavoritesRecord::LocalNotebook :
item->setIcon(NAME_POSITION, global.getIconResource(":locaNotebookIcon"));
break;
case FavoritesRecord::Search :
item->setIcon(NAME_POSITION, global.getIconResource(":searchIcon"));
break;
case FavoritesRecord::SharedNotebook :
item->setIcon(NAME_POSITION, global.getIconResource(":notebookSharedIcon"));
break;
case FavoritesRecord::SynchronizedNotebook :
item->setIcon(NAME_POSITION, global.getIconResource(":notebookSmallIcon"));
break;
case FavoritesRecord::NotebookStack :
item->setIcon(NAME_POSITION, global.getIconResource(":stackIcon"));
break;
}
dataStore.insert(record->lid, item);
if (record->target.toInt() > 0)
targetStore.insert(record->target.toInt(), item);
parent->addChild(item);
}
示例5: QMdiSubWindow
ExternalBrowse::ExternalBrowse(qint32 lid, QWidget *parent) :
QMdiSubWindow(parent)
{
setAttribute(Qt::WA_QuitOnClose, false);
this->setWindowTitle(tr("NixNote"));
setWindowIcon(global.getIconResource(":windowIcon"));
browser = new NBrowserWindow(this);
setWidget(browser);
// Setup shortcuts
focusTitleShortcut = new QShortcut(this);
focusTitleShortcut->setContext(Qt::WidgetShortcut);
this->setupShortcut(focusTitleShortcut, "Focus_Title");
connect(focusTitleShortcut, SIGNAL(activated()), &browser->noteTitle, SLOT(setFocus()));
focusNoteShortcut = new QShortcut(this);
focusNoteShortcut->setContext(Qt::WidgetShortcut);
this->setupShortcut(focusNoteShortcut, "Focus_Note");
connect(focusNoteShortcut, SIGNAL(activated()), browser->editor, SLOT(setFocus()));
focusTagShortcut = new QShortcut(this);
focusTagShortcut->setContext(Qt::WidgetWithChildrenShortcut);
this->setupShortcut(focusTagShortcut, "Focus_Tag");
connect(focusTagShortcut, SIGNAL(activated()), browser, SLOT(newTagFocusShortcut()));
focusUrlShortcut = new QShortcut(this);
focusUrlShortcut->setContext(Qt::WidgetWithChildrenShortcut);
this->setupShortcut(focusUrlShortcut, "Focus_Url");
connect(focusUrlShortcut, SIGNAL(activated()), browser, SLOT(urlFocusShortcut()));
focusAuthorShortcut = new QShortcut(this);
focusAuthorShortcut->setContext(Qt::WidgetWithChildrenShortcut);
this->setupShortcut(focusAuthorShortcut, "Focus_Author");
connect(focusAuthorShortcut, SIGNAL(activated()), browser, SLOT(authorFocusShortcut()));
// Load actual note
browser->setContent(lid);
}
示例6: reloadIcons
void NTrashTree::reloadIcons() {
root->setIcon(0,global.getIconResource(":trashIcon"));
}
示例7: reloadIcons
void EditorButtonBar::reloadIcons() {
undoButtonAction->setIcon(global.getIconResource(":undoIcon"));
redoButtonAction->setIcon(global.getIconResource(":redoIcon"));
cutButtonAction->setIcon(global.getIconResource(":cutIcon"));
copyButtonAction->setIcon(global.getIconResource(":copyIcon"));
pasteButtonAction->setIcon(global.getIconResource(":pasteIcon"));
removeFormatButtonAction->setIcon(global.getIconResource(":eraserIcon"));
boldButtonWidget->setIcon(global.getIconResource(":boldIcon"));
italicButtonWidget->setIcon(global.getIconResource(":italicsIcon"));
underlineButtonWidget->setIcon(global.getIconResource(":underlineIcon"));
strikethroughButtonAction->setIcon(global.getIconResource(":strikethroughIcon"));
leftJustifyButtonAction->setIcon(global.getIconResource(":leftAlignIcon"));
rightJustifyButtonAction->setIcon(global.getIconResource(":rightAlignIcon"));
centerJustifyButtonAction->setIcon(global.getIconResource(":centerAlignIcon"));
hlineButtonAction->setIcon(global.getIconResource(":hlineIcon"));
shiftRightButtonAction->setIcon(global.getIconResource(":shiftRightIcon"));
shiftLeftButtonAction->setIcon(global.getIconResource(":shiftLeftIcon"));
bulletListButtonAction->setIcon(global.getIconResource(":bulletListIcon"));
numberListButtonAction->setIcon(global.getIconResource(":numberListIcon"));
fontColorButtonWidget->setIcon(global.getIconResource(":fontColorIcon"));
highlightColorButtonWidget->setIcon(global.getIconResource(":fontHighlightIcon"));
todoButtonAction->setIcon(global.getIconResource(":todoIcon"));
spellCheckButtonAction->setIcon(global.getIconResource(":spellCheckIcon"));
insertTableButtonAction->setIcon(global.getIconResource(":gridIcon"));
htmlEntitiesButtonAction->setIcon(global.getIconResource(":htmlentitiesIcon"));
}
示例8: QToolBar
EditorButtonBar::EditorButtonBar(QWidget *parent) :
QToolBar(parent)
{
contextMenu = new QMenu();
undoVisible = contextMenu->addAction(tr("Undo"));
redoVisible = contextMenu->addAction(tr("Redo"));
cutVisible = contextMenu->addAction(tr("Cut"));
copyVisible = contextMenu->addAction(tr("Copy"));
pasteVisible = contextMenu->addAction(tr("Paste"));
removeFormatVisible = contextMenu->addAction(tr("Remove Formatting"));
boldVisible = contextMenu->addAction(tr("Bold"));
italicVisible = contextMenu->addAction(tr("Italics"));
superscriptVisible = contextMenu->addAction(tr("Superscript"));
subscriptVisible = contextMenu->addAction(tr("Subscript"));
underlineVisible = contextMenu->addAction(tr("Underline"));
strikethroughVisible = contextMenu->addAction(tr("Strikethrough"));
leftJustifyVisible = contextMenu->addAction(tr("Align Left"));
centerJustifyVisible = contextMenu->addAction(tr("Align Center"));
rightJustifyVisible = contextMenu->addAction(tr("Align Right"));
hlineVisible = contextMenu->addAction(tr("Horizontal Line"));
insertDatetimeVisible = contextMenu->addAction(tr("Insert Date && Time"));
shiftRightVisible = contextMenu->addAction(tr("Shift Right"));
shiftLeftVisible = contextMenu->addAction(tr("Shift Left"));
bulletListVisible = contextMenu->addAction(tr("Bullet List"));
numberListVisible = contextMenu->addAction(tr("Number List"));
fontVisible = contextMenu->addAction(tr("Font"));
fontSizeVisible = contextMenu->addAction(tr("Font Size"));
fontColorVisible = contextMenu->addAction(tr("Font Color"));
highlightVisible = contextMenu->addAction(tr("Highlight"));
todoVisible = contextMenu->addAction(tr("To-do"));
spellCheckButtonVisible = contextMenu->addAction(tr("Spell Check"));
insertTableButtonVisible = contextMenu->addAction(tr("Insert Table"));
htmlEntitiesButtonVisible = contextMenu->addAction(tr("HTML Entities"));
undoVisible->setCheckable(true);
redoVisible->setCheckable(true);
cutVisible->setCheckable(true);
copyVisible->setCheckable(true);
pasteVisible->setCheckable(true);
removeFormatVisible->setCheckable(true);
boldVisible->setCheckable(true);
italicVisible->setCheckable(true);
underlineVisible->setCheckable(true);
strikethroughVisible->setCheckable(true);
superscriptVisible->setCheckable(true);
subscriptVisible->setCheckable(true);
leftJustifyVisible->setCheckable(true);
centerJustifyVisible->setCheckable(true);
rightJustifyVisible->setCheckable(true);
hlineVisible->setCheckable(true);
shiftRightVisible->setCheckable(true);
shiftLeftVisible->setCheckable(true);
bulletListVisible->setCheckable(true);
numberListVisible->setCheckable(true);
todoVisible->setCheckable(true);
fontColorVisible->setCheckable(true);
highlightVisible->setCheckable(true);
fontColorVisible->setCheckable(true);
fontSizeVisible->setCheckable(true);
fontVisible->setCheckable(true);
spellCheckButtonVisible->setCheckable(true);
spellCheckButtonVisible->setChecked(true);
insertTableButtonVisible->setCheckable(true);
htmlEntitiesButtonVisible->setCheckable(true);
insertDatetimeVisible->setCheckable(true);
connect(undoVisible, SIGNAL(triggered()), this, SLOT(toggleUndoButtonVisible()));
connect(redoVisible, SIGNAL(triggered()), this, SLOT(toggleRedoButtonVisible()));
connect(cutVisible, SIGNAL(triggered()), this, SLOT(toggleCutButtonVisible()));
connect(copyVisible, SIGNAL(triggered()), this, SLOT(toggleCopyButtonVisible()));
connect(pasteVisible, SIGNAL(triggered()), this, SLOT(togglePasteButtonVisible()));
connect(removeFormatVisible, SIGNAL(triggered()), this, SLOT(toggleRemoveFormatVisible()));
connect(boldVisible, SIGNAL(triggered()), this, SLOT(toggleBoldButtonVisible()));
connect(italicVisible, SIGNAL(triggered()), this, SLOT(toggleItalicButtonVisible()));
connect(underlineVisible, SIGNAL(triggered()), this, SLOT(toggleUnderlineButtonVisible()));
connect(strikethroughVisible, SIGNAL(triggered()), this, SLOT(toggleStrikethroughButtonVisible()));
connect(superscriptVisible, SIGNAL(triggered()), this, SLOT(toggleSuperscriptButtonVisible()));
connect(subscriptVisible, SIGNAL(triggered()), this, SLOT(toggleSubscriptButtonVisible()));
connect(insertDatetimeVisible, SIGNAL(triggered()), this, SLOT(toggleInsertDatetimeVisible()));
connect(leftJustifyVisible, SIGNAL(triggered()), this, SLOT(toggleLeftJustifyButtonVisible()));
connect(centerJustifyVisible, SIGNAL(triggered()), this, SLOT(toggleCenterJustifyButtonVisible()));
connect(rightJustifyVisible, SIGNAL(triggered()), this, SLOT(toggleRightJustifyButtonVisible()));
connect(hlineVisible, SIGNAL(triggered()), this, SLOT(toggleHlineButtonVisible()));
connect(shiftRightVisible, SIGNAL(triggered()), this, SLOT(toggleShiftRightButtonVisible()));
connect(shiftLeftVisible, SIGNAL(triggered()), this, SLOT(toggleShiftLeftButtonVisible()));
connect(bulletListVisible, SIGNAL(triggered()), this, SLOT(toggleBulletListButtonVisible()));
connect(numberListVisible, SIGNAL(triggered()), this, SLOT(toggleNumberListButtonVisible()));
connect(fontVisible, SIGNAL(triggered()), this, SLOT(toggleFontButtonVisible()));
connect(fontSizeVisible, SIGNAL(triggered()), this, SLOT(toggleFontSizeButtonVisible()));
connect(todoVisible, SIGNAL(triggered()), this, SLOT(toggleTodoButtonVisible()));
connect(highlightVisible, SIGNAL(triggered()), this, SLOT(toggleHighlightColorVisible()));
connect(fontColorVisible, SIGNAL(triggered()), this, SLOT(toggleFontColorVisible()));
connect(insertTableButtonVisible, SIGNAL(triggered()), this, SLOT(toggleInsertTableButtonVisible()));
connect(spellCheckButtonVisible, SIGNAL(triggered()), this, SLOT(toggleSpellCheckButtonVisible()));
connect(htmlEntitiesButtonVisible, SIGNAL(triggered()), this, SLOT(toggleHtmlEntitiesButtonVisible()));
undoButtonAction = this->addAction(global.getIconResource(":undoIcon"), tr("Undo"));
undoButtonShortcut = new QShortcut(this);
setupShortcut(undoButtonShortcut, "Edit_Undo");
//.........这里部分代码省略.........
示例9: reloadIcons
void FavoritesView::reloadIcons() {
root->setIcon(NAME_POSITION, global.getIconResource(":favoritesIcon"));
QHash<qint32, FavoritesViewItem*>::iterator i;
for (i=dataStore.begin(); i!=dataStore.end(); ++i) {
FavoritesViewItem *record = i.value();
if (record != NULL) {
FavoritesRecord *r = &record->record;
if (r != NULL) {
switch (r->type) {
case FavoritesRecord::Tag :
record->setIcon(NAME_POSITION, global.getIconResource(":tagIcon"));
break;
case FavoritesRecord::Note :
record->setIcon(NAME_POSITION, global.getIconResource(":newNoteIcon"));
break;
case FavoritesRecord::ConflictNotebook :
record->setIcon(NAME_POSITION, global.getIconResource(":notebookConflictIcon"));
break;
case FavoritesRecord::LinkedNotebook :
record->setIcon(NAME_POSITION, global.getIconResource(":notebookLinkedIcon"));
break;
case FavoritesRecord::LinkedStack :
record->setIcon(NAME_POSITION, global.getIconResource(":silhouetteIcon"));
break;
case FavoritesRecord::LocalNotebook :
record->setIcon(NAME_POSITION, global.getIconResource(":notebookLocalIcon"));
break;
case FavoritesRecord::Search :
record->setIcon(NAME_POSITION, global.getIconResource(":searchIcon"));
break;
case FavoritesRecord::SharedNotebook :
record->setIcon(NAME_POSITION, global.getIconResource(":notebookSharedIcon"));
break;
case FavoritesRecord::SynchronizedNotebook :
record->setIcon(NAME_POSITION, global.getIconResource(":notebookSmallIcon"));
break;
case FavoritesRecord::NotebookStack :
record->setIcon(NAME_POSITION, global.getIconResource(":stackIcon"));
break;
}
}
}
}
}
示例10: QTreeWidget
FavoritesView::FavoritesView(QWidget *parent) :
QTreeWidget(parent)
{
setAcceptDrops(true);
setDragEnabled(true);
setDropIndicatorShown(true);
setSelectionMode(QAbstractItemView::SingleSelection);
dataStore.clear();
targetStore.clear();
this->setFont(global.getGuiFont(font()));
filterPosition = -1;
maxCount = 0; // Highest count of any notebook. Used in calculating column width
// setup options
this->setEditTriggers(QAbstractItemView::NoEditTriggers);
this->setSelectionBehavior(QAbstractItemView::SelectRows);
this->setSelectionMode(QAbstractItemView::SingleSelection);
this->setDragDropMode(QAbstractItemView::InternalMove);
this->setRootIsDecorated(true);
this->setSortingEnabled(true);
this->header()->setVisible(false);
this->setStyleSheet("QTreeView {border-image:none; image:none;} ");
root = new FavoritesViewItem(0);
root->setData(NAME_POSITION, Qt::UserRole, "root");
root->setData(NAME_POSITION, Qt::DisplayRole, tr("Shortcuts"));
QFont rootFont = root->font(NAME_POSITION);
rootFont.setBold(true);
root->setFont(NAME_POSITION, rootFont);
root->setIcon(NAME_POSITION, global.getIconResource(":favoritesIcon"));
root->setRootColor(false);
expandedImage = new QImage(":expandedIcon");
collapsedImage = new QImage(":collapsedIcon");
this->setAcceptDrops(true);
this->setItemDelegate(new FavoritesViewDelegate());
this->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
this->setFrameShape(QFrame::NoFrame);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
this->setMinimumHeight(1);
this->addTopLevelItem(root);
this->rebuildFavoritesTreeNeeded = true;
this->loadData();
context.addSeparator();
deleteAction = context.addAction(tr("Remove from shortcuts"));
deleteAction->setShortcut(QKeySequence(Qt::Key_Delete));
deleteShortcut = new QShortcut(this);
deleteShortcut->setKey(QKeySequence(Qt::Key_Delete));
deleteShortcut->setContext(Qt::WidgetShortcut);
connect(deleteAction, SIGNAL(triggered()), this, SLOT(deleteRequested()));
connect(this, SIGNAL(itemExpanded(QTreeWidgetItem*)), this, SLOT(calculateHeight()));
connect(this, SIGNAL(itemCollapsed(QTreeWidgetItem*)), this, SLOT(calculateHeight()));
connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(buildSelection()));
connect(deleteShortcut, SIGNAL(activated()), this, SLOT(deleteRequested()));
root->setExpanded(true);
this->setProperty("animated", false);
resetSize();
}
示例11: QMdiSubWindow
ExternalBrowse::ExternalBrowse(qint32 lid, QWidget *parent) :
QMdiSubWindow(parent)
{
setAttribute(Qt::WA_QuitOnClose, false);
this->setWindowTitle(tr("NixNote"));
setWindowIcon(global.getIconResource(":windowIcon"));
browser = new NBrowserWindow(this);
setWidget(browser);
// Setup shortcuts
focusTitleShortcut = new QShortcut(this);
focusTitleShortcut->setContext(Qt::WidgetShortcut);
this->setupShortcut(focusTitleShortcut, "Focus_Title");
connect(focusTitleShortcut, SIGNAL(activated()), &browser->noteTitle, SLOT(setFocus()));
focusNoteShortcut = new QShortcut(this);
focusNoteShortcut->setContext(Qt::WidgetShortcut);
this->setupShortcut(focusNoteShortcut, "Focus_Note");
connect(focusNoteShortcut, SIGNAL(activated()), browser->editor, SLOT(setFocus()));
fileSaveShortcut = new QShortcut(this);
fileSaveShortcut->setContext(Qt::WidgetWithChildrenShortcut);
this->setupShortcut(focusNoteShortcut, "File_Save_Content");
connect(fileSaveShortcut, SIGNAL(activated()), browser, SLOT(saveNoteContent()));
focusTagShortcut = new QShortcut(this);
focusTagShortcut->setContext(Qt::WidgetWithChildrenShortcut);
this->setupShortcut(focusTagShortcut, "Focus_Tag");
connect(focusTagShortcut, SIGNAL(activated()), browser, SLOT(newTagFocusShortcut()));
focusUrlShortcut = new QShortcut(this);
focusUrlShortcut->setContext(Qt::WidgetWithChildrenShortcut);
this->setupShortcut(focusUrlShortcut, "Focus_Url");
connect(focusUrlShortcut, SIGNAL(activated()), browser, SLOT(urlFocusShortcut()));
focusAuthorShortcut = new QShortcut(this);
focusAuthorShortcut->setContext(Qt::WidgetWithChildrenShortcut);
this->setupShortcut(focusAuthorShortcut, "Focus_Author");
connect(focusAuthorShortcut, SIGNAL(activated()), browser, SLOT(authorFocusShortcut()));
focusNotebookShortcut = new QShortcut(this);
focusNotebookShortcut->setContext(Qt::WidgetWithChildrenShortcut);
this->setupShortcut(focusNotebookShortcut, "Focus_Notebook");
connect(focusNotebookShortcut, SIGNAL(activated()), browser, SLOT(notebookFocusShortcut()));
focusFontShortcut = new QShortcut(this);
focusFontShortcut->setContext(Qt::WidgetWithChildrenShortcut);
this->setupShortcut(focusFontShortcut, "Focus_Font");
connect(focusFontShortcut, SIGNAL(activated()), browser, SLOT(fontFocusShortcut()));
focusFontSizeShortcut = new QShortcut(this);
focusFontSizeShortcut->setContext(Qt::WidgetWithChildrenShortcut);
this->setupShortcut(focusFontSizeShortcut, "Focus_Font_Size");
connect(focusFontSizeShortcut, SIGNAL(activated()), browser, SLOT(fontSizeFocusShortcut()));
findShortcut = new QShortcut(this);
findShortcut->setContext(Qt::WidgetWithChildrenShortcut);
this->setupShortcut(findShortcut, "Edit_Search_Find");
connect(findShortcut, SIGNAL(activated()), browser, SLOT(findShortcut()));
findReplaceShortcut = new QShortcut(this);
findReplaceShortcut->setContext(Qt::WidgetWithChildrenShortcut);
this->setupShortcut(findReplaceShortcut, "Edit_Search_Find_Replace");
connect(findReplaceShortcut, SIGNAL(activated()), browser, SLOT(findReplaceShortcut()));
findNextShortcut = new QShortcut(this);
findNextShortcut->setContext(Qt::WidgetWithChildrenShortcut);
this->setupShortcut(findNextShortcut, "Edit_Search_Find_Next");
connect(findNextShortcut, SIGNAL(activated()), browser, SLOT(findNextShortcut()));
findPrevShortcut = new QShortcut(this);
findPrevShortcut->setContext(Qt::WidgetWithChildrenShortcut);
this->setupShortcut(findPrevShortcut, "Edit_Search_Find_Prev");
connect(findPrevShortcut, SIGNAL(activated()), browser, SLOT(findPrevShortcut()));
// Load actual note
browser->setContent(lid);
}
示例12: reloadIcons
void LocationEditor::reloadIcons() {
this->setIcon(global.getIconResource(":navigationIcon"));
}
示例13: reloadIcons
void NAttributeTree::reloadIcons() {
root->setIcon(0,global.getIconResource(":attributesIcon"));
}
示例14: reloadIcons
void NTagView::reloadIcons() {
root->setIcon(NAME_POSITION,global.getIconResource(":tagIcon"));
}
示例15: QTreeWidget
// Constructor
NTagView::NTagView(QWidget *parent) :
QTreeWidget(parent)
{
accountFilter = 0;
this->setFont(global.getGuiFont(font()));
filterPosition = 0;
maxCount = 0;
// 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->setStyleSheet("QTreeWidget { background:transparent; border:none; margin:0px; padding: 0px; }");
// Build the root item
root = new NTagViewItem(this);
root->setIcon(NAME_POSITION,global.getIconResource(":tagIcon"));
root->setData(NAME_POSITION, Qt::UserRole, "root");
root->setData(NAME_POSITION, Qt::DisplayRole, tr("Tags from Personal"));
root->setExpanded(true);
QFont rootFont = root->font(NAME_POSITION);
rootFont.setBold(true);
root->setFont(NAME_POSITION, rootFont);
this->setMinimumHeight(1);
this->addTopLevelItem(root);
this->rebuildTagTreeNeeded = true;
this->loadData();
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()));
setAcceptDrops(true);
setDragEnabled(true);
global.settings->beginGroup("SaveState");
hideUnassigned = global.settings->value("hideUnassigned", false).toBool();
global.settings->endGroup();
addAction = context.addAction(tr("Create New Tag"));
addAction->setShortcut(QKeySequence(Qt::Key_Insert));
addAction->setShortcutContext(Qt::WidgetShortcut);
addShortcut = new QShortcut(this);
addShortcut->setKey(QKeySequence(Qt::Key_Insert));
addShortcut->setContext(Qt::WidgetShortcut);
context.addSeparator();
deleteAction = context.addAction(tr("Delete"));
deleteAction->setShortcut(QKeySequence(Qt::Key_Delete));
deleteShortcut = new QShortcut(this);
deleteShortcut->setKey(QKeySequence(Qt::Key_Delete));
deleteShortcut->setContext(Qt::WidgetShortcut);
renameAction = context.addAction(tr("Rename"));
renameAction->setShortcutContext(Qt::WidgetShortcut);
mergeAction = context.addAction(tr("Merge"));
context.addSeparator();
hideUnassignedAction = context.addAction(tr("Hide Unassigned"));
hideUnassignedAction->setCheckable(true);
hideUnassignedAction->setChecked(hideUnassigned);
connect(hideUnassignedAction, SIGNAL(triggered()), this, SLOT(hideUnassignedTags()));
context.addSeparator();
propertiesAction = context.addAction(tr("Properties"));
connect(addAction, SIGNAL(triggered()), this, SLOT(addRequested()));
connect(deleteAction, SIGNAL(triggered()), this, SLOT(deleteRequested()));
connect(renameAction, SIGNAL(triggered()), this, SLOT(renameRequested()));
connect(propertiesAction, SIGNAL(triggered()), this, SLOT(propertiesRequested()));
connect(mergeAction, SIGNAL(triggered()), this, SLOT(mergeRequested()));
connect(addShortcut, SIGNAL(activated()), this, SLOT(addRequested()));
connect(deleteShortcut, SIGNAL(activated()), this, SLOT(deleteRequested()));
this->setItemDelegate(new NTagViewDelegate());
this->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
this->setFrameShape(QFrame::NoFrame);
expandedImage = new QImage(":expandedIcon");
collapsedImage = new QImage(":collapsedIcon");
}