void TextEditor::addAlignmentActions(QMenu * menu) { if(document()->isEmpty()) return; QMenu * align_menu = menu->addMenu(tr("Alignment")); QAction * align_left = align_menu->addAction(iconFromTheme("format-justify-left"), tr("Left"), this, SLOT(alignLeft())); QAction * align_right = align_menu->addAction(iconFromTheme("format-justify-right"), tr("Right"), this, SLOT(alignRight())); QAction * align_center = align_menu->addAction(iconFromTheme("format-justify-center"), tr("Center"), this, SLOT(alignCenter())); QAction * align_justify = align_menu->addAction(iconFromTheme("format-justify-fill"), tr("Justify"), this, SLOT(alignJustify())); switch(textCursor().blockFormat().alignment()) { case Qt::AlignLeft: align_left->setCheckable(true); align_left->setChecked(true); break; case Qt::AlignRight: align_right->setCheckable(true); align_right->setChecked(true); break; case Qt::AlignHCenter: align_center->setCheckable(true); align_center->setChecked(true); break; case Qt::AlignJustify: align_justify->setCheckable(true); align_justify->setChecked(true); break; default: break; } }
QImage IconProvider::emptyWebImage() { if (instance()->m_emptyWebImage.isNull()) { instance()->m_emptyWebImage = iconFromTheme("text-plain").pixmap(16, 16).toImage(); } return instance()->m_emptyWebImage; }
DebugPreferences::DebugPreferences(QWidget * parent) : PreferencesWidget(parent), layout_(NULL) { setTitle(tr("Debug")); setIcon(iconFromTheme("tools-report-bug")); setupLayout(); setupUI(); }
void LogViewerDialog::addLogItem(const QString& path, const QString& title, const QString& iconName) { QFileInfo info(path); if(!info.exists()) return; if(info.size() == 0) return; QListWidgetItem * item = new QListWidgetItem; item->setText(title); item->setIcon(iconFromTheme(iconName)); item->setToolTip(path); item->setData(Qt::UserRole, path); ui_->logList->addItem(item); }