本文整理汇总了C++中Note::GetIconID方法的典型用法代码示例。如果您正苦于以下问题:C++ Note::GetIconID方法的具体用法?C++ Note::GetIconID怎么用?C++ Note::GetIconID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Note
的用法示例。
在下文中一共展示了Note::GetIconID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sl_ChooseIconButton_Clicked
void FolderItemPropertiesWidget::sl_ChooseIconButton_Clicked() {
if (!itemToEdit) {
WARNING("Null pointer recieved");
reject();
}
if (!customIconsWidget) {
customIconsWidget = new CustomIconsListWidget(this);
}
if (itemToEdit->GetItemType() == AbstractFolderItem::Type_Folder) {
Folder* f = dynamic_cast<Folder*>(itemToEdit);
customIconsWidget->SelectIcon(f->GetIconID());
} else if (itemToEdit->GetItemType() == AbstractFolderItem::Type_Note) {
Note* n = dynamic_cast<Note*>(itemToEdit);
customIconsWidget->SelectIcon(n->GetIconID());
}
if (customIconsWidget->exec() != QDialog::Accepted) {return;}
Document* doc = Application::I()->CurrentDocument();
if (doc == 0) {
WARNING("Current document is 0");
return;
}
selectedIconKey = customIconsWidget->SelectedIconKey;
iconLabel->setPixmap(doc->GetItemIcon(selectedIconKey));
}
示例2: SetFolderItem
void FolderItemPropertiesWidget::SetFolderItem(AbstractFolderItem* item) {
if (!item) {
WARNING("Null pointer recieved");
return;
}
itemToEdit = item;
if (item->GetItemType() == AbstractFolderItem::Type_Folder) {
Folder* f = dynamic_cast<Folder*>(item);
creationDateLabelD->setText(f->GetCreationDate().toString(Qt::SystemLocaleShortDate));
modificationDateLabelD->setText(f->GetModificationDate().toString(Qt::SystemLocaleShortDate));
nameLineEdit->setText(f->GetName());
iconLabel->setPixmap(f->GetIcon());
selectedIconKey = f->GetIconID();
setWindowTitle(QString("Edit properties for \"%1\"").arg(f->GetName()));
nameLineEdit->setEnabled(!f->IsLocked());
chooseIconButton->setEnabled(!f->IsLocked());
resetIconToDefaultButton->setEnabled(!f->IsLocked());
} else if (item->GetItemType() == AbstractFolderItem::Type_Note) {
Note* n = dynamic_cast<Note*>(item);
creationDateLabelD->setText(n->GetCreationDate().toString(Qt::SystemLocaleShortDate));
modificationDateLabelD->setText(n->GetModificationDate().toString(Qt::SystemLocaleShortDate));
nameLineEdit->setText(n->GetName());
iconLabel->setPixmap(n->GetIcon());
selectedIconKey = n->GetIconID();
setWindowTitle(QString("Edit properties for \"%1\"").arg(n->GetName()));
nameLineEdit->setEnabled(!n->IsLocked());
chooseIconButton->setEnabled(!n->IsLocked());
resetIconToDefaultButton->setEnabled(!n->IsLocked());
}
nameLineEdit->setFocus();
nameLineEdit->selectAll();
}