TimelineWidget::TimelineWidget(QWidget *parent) : QWidget(parent) { this->setWindowTitle("Timeline"); this->setWindowIcon(QIcon(":/resources/icons/resources/timeline.png")); QFormLayout* propertiesLayout = new QFormLayout(this); propertiesLayout->setContentsMargins(2, 2, 2, 2); QHBoxLayout* nameLayout = new QHBoxLayout(); QLabel* nameLabel = new QLabel("Name: ", this); QLineEdit* nameEdit = new QLineEdit("tml_0", this); nameLayout->addWidget(nameLabel); nameLayout->addWidget(nameEdit); propertiesLayout->addItem(nameLayout); editButton = new QPushButton("Edit", this); propertiesLayout->addWidget(editButton); QGridLayout* momButtonsLayout = new QGridLayout(); addButton = new QPushButton("Add", this); momButtonsLayout->addWidget(addButton, 0, 0); changeButton = new QPushButton("Change", this); momButtonsLayout->addWidget(changeButton, 0, 1); deleteButton = new QPushButton("Delete", this); momButtonsLayout->addWidget(deleteButton, 1, 0); duplicateButton = new QPushButton("Duplicate", this); momButtonsLayout->addWidget(duplicateButton, 1, 1); shiftButton = new QPushButton("Shift", this); momButtonsLayout->addWidget(shiftButton, 2, 0); mergeButton = new QPushButton("Merge", this); momButtonsLayout->addWidget(mergeButton, 2, 1); propertiesLayout->addItem(momButtonsLayout); clearButton = new QPushButton("Clear", this); propertiesLayout->addWidget(clearButton); infoButton = new QPushButton("Information", this); infoButton->setIcon(QIcon(":/resources/icons/resources/info.png")); propertiesLayout->addWidget(infoButton); saveButton = new QPushButton("Save", this); saveButton->setIcon(QIcon(":/icons/actions/accept.png")); propertiesLayout->addWidget(saveButton); QTreeWidget* momentsTree = new QTreeWidget(this); momentsTree->setHeaderLabel("Moments"); QSplitter* horizontalSplitter = new QSplitter(); QWidget* propertiesWidget = new QWidget(this, Qt::WindowTitleHint); propertiesWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); propertiesWidget->setLayout(propertiesLayout); horizontalSplitter->addWidget(propertiesWidget); horizontalSplitter->addWidget(momentsTree); QVBoxLayout* timelineLayout = new QVBoxLayout(); timelineLayout->setContentsMargins(2, 2, 2, 2); timelineLayout->addWidget(horizontalSplitter); this->setLayout(timelineLayout); }
BookmarkWidget::BookmarkWidget(const KBookmark &bookmark, QWidget *parent) : QMenu(parent) , m_bookmark(new KBookmark(bookmark)) { setAttribute(Qt::WA_DeleteOnClose); setFixedWidth(350); QFormLayout *layout = new QFormLayout(this); // Bookmark icon QHBoxLayout *hLayout = new QHBoxLayout(this); QLabel *bookmarkIcon = new QLabel(this); bookmarkIcon->setPixmap(KIcon("bookmarks").pixmap(32, 32)); hLayout->setSpacing(10); hLayout->addWidget(bookmarkIcon); // Title QVBoxLayout *vLayout = new QVBoxLayout(this); QLabel *bookmarkInfo = new QLabel(this); bookmarkInfo->setText(i18n("<h4>Edit this Bookmark</h4>")); bookmarkInfo->setAlignment(Qt::AlignCenter); vLayout->addWidget(bookmarkInfo); // Remove button QPushButton *removeButton = new QPushButton(this); removeButton->setText(i18n("Remove this Bookmark")); connect(removeButton, SIGNAL(clicked()), this, SLOT(removeBookmark())); vLayout->addWidget(removeButton); hLayout->addLayout(vLayout); layout->addItem(hLayout); // Bookmark name QLabel *nameLabel = new QLabel(this); nameLabel->setText(i18n("Name:")); m_name = new KLineEdit(this); if (m_bookmark->isNull()) { m_name->setEnabled(false); } else { m_name->setText(m_bookmark->text()); m_name->setFocus(); } layout->addRow(nameLabel, m_name); // Ok & Cancel buttons QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this); connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(close())); layout->addWidget(buttonBox); setLayout(layout); }
QWidget *CMakeSettingsPage::createPage(QWidget *parent) { QWidget *outerWidget = new QWidget(parent); QFormLayout *formLayout = new QFormLayout(outerWidget); formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); m_pathchooser = new Utils::PathChooser; m_pathchooser->setExpectedKind(Utils::PathChooser::ExistingCommand); formLayout->addRow(tr("Executable:"), m_pathchooser); formLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding)); m_pathchooser->setPath(m_cmakeValidatorForUser.cmakeExecutable()); m_preferNinja = new QCheckBox(tr("Prefer Ninja generator (CMake 2.8.9 or higher required)")); m_preferNinja->setChecked(preferNinja()); formLayout->addRow(m_preferNinja); return outerWidget; }
ConfigureGridDialog::ConfigureGridDialog(QWidget* parent, const Map& map, bool grid_visible) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint) , map(map) , grid(map.getGrid()) , grid_visible(grid_visible) , current_color(grid.getColor()) , current_unit(grid.getUnit()) { setWindowTitle(tr("Configure grid")); show_grid_check = new QCheckBox(tr("Show grid")); snap_to_grid_check = new QCheckBox(tr("Snap to grid")); choose_color_button = new QPushButton(tr("Choose...")); display_mode_combo = new QComboBox(); display_mode_combo->addItem(tr("All lines"), (int)MapGrid::AllLines); display_mode_combo->addItem(tr("Horizontal lines"), (int)MapGrid::HorizontalLines); display_mode_combo->addItem(tr("Vertical lines"), (int)MapGrid::VerticalLines); mag_north_radio = new QRadioButton(tr("Align with magnetic north")); grid_north_radio = new QRadioButton(tr("Align with grid north")); true_north_radio = new QRadioButton(tr("Align with true north")); QLabel* rotate_label = new QLabel(tr("Additional rotation (counter-clockwise):")); additional_rotation_edit = Util::SpinBox::create(Georeferencing::declinationPrecision(), -360, +360, trUtf8("°")); additional_rotation_edit->setWrapping(true); unit_combo = new QComboBox(); unit_combo->addItem(tr("meters in terrain"), (int)MapGrid::MetersInTerrain); unit_combo->addItem(tr("millimeters on map"), (int)MapGrid::MillimetersOnMap); QLabel* horz_spacing_label = new QLabel(tr("Horizontal spacing:")); horz_spacing_edit = Util::SpinBox::create(1, 0.1, Util::InputProperties<MapCoordF>::max()); QLabel* vert_spacing_label = new QLabel(tr("Vertical spacing:")); vert_spacing_edit = Util::SpinBox::create(1, 0.1, Util::InputProperties<MapCoordF>::max()); origin_label = new QLabel(); QLabel* horz_offset_label = new QLabel(tr("Horizontal offset:")); horz_offset_edit = Util::SpinBox::create(1, Util::InputProperties<MapCoordF>::min(), Util::InputProperties<MapCoordF>::max()); QLabel* vert_offset_label = new QLabel(tr("Vertical offset:")); vert_offset_edit = Util::SpinBox::create(1, Util::InputProperties<MapCoordF>::min(), Util::InputProperties<MapCoordF>::max()); QDialogButtonBox* button_box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help, Qt::Horizontal); show_grid_check->setChecked(grid_visible); snap_to_grid_check->setChecked(grid.isSnappingEnabled()); display_mode_combo->setCurrentIndex(display_mode_combo->findData((int)grid.getDisplayMode())); if (grid.getAlignment() == MapGrid::MagneticNorth) mag_north_radio->setChecked(true); else if (grid.getAlignment() == MapGrid::GridNorth) grid_north_radio->setChecked(true); else // if (grid.getAlignment() == MapGrid::TrueNorth) true_north_radio->setChecked(true); additional_rotation_edit->setValue(grid.getAdditionalRotation() * 180 / M_PI); unit_combo->setCurrentIndex(unit_combo->findData(current_unit)); horz_spacing_edit->setValue(grid.getHorizontalSpacing()); vert_spacing_edit->setValue(grid.getVerticalSpacing()); horz_offset_edit->setValue(grid.getHorizontalOffset()); vert_offset_edit->setValue(-1 * grid.getVerticalOffset()); QFormLayout* layout = new QFormLayout(); layout->addRow(show_grid_check); layout->addRow(snap_to_grid_check); layout->addRow(tr("Line color:"), choose_color_button); layout->addRow(tr("Display:"), display_mode_combo); layout->addItem(Util::SpacerItem::create(this)); layout->addRow(Util::Headline::create(tr("Alignment"))); layout->addRow(mag_north_radio); layout->addRow(grid_north_radio); layout->addRow(true_north_radio); layout->addRow(rotate_label, additional_rotation_edit); layout->addItem(Util::SpacerItem::create(this)); layout->addRow(Util::Headline::create(tr("Positioning"))); layout->addRow(tr("Unit:", "measurement unit"), unit_combo); layout->addRow(horz_spacing_label, horz_spacing_edit); layout->addRow(vert_spacing_label, vert_spacing_edit); layout->addItem(Util::SpacerItem::create(this)); layout->addRow(origin_label); layout->addRow(horz_offset_label, horz_offset_edit); layout->addRow(vert_offset_label, vert_offset_edit); layout->addItem(Util::SpacerItem::create(this)); layout->addRow(button_box); setLayout(layout); updateStates(); updateColorDisplay(); using TakingIntArgument = void (QComboBox::*)(int); connect(show_grid_check, &QAbstractButton::clicked, this, &ConfigureGridDialog::updateStates); connect(choose_color_button, &QAbstractButton::clicked, this, &ConfigureGridDialog::chooseColor); connect(display_mode_combo, (TakingIntArgument)&QComboBox::currentIndexChanged, this, &ConfigureGridDialog::updateStates); connect(mag_north_radio, &QAbstractButton::clicked, this, &ConfigureGridDialog::updateStates); connect(grid_north_radio, &QAbstractButton::clicked, this, &ConfigureGridDialog::updateStates); connect(true_north_radio, &QAbstractButton::clicked, this, &ConfigureGridDialog::updateStates); connect(unit_combo, (TakingIntArgument)&QComboBox::currentIndexChanged, this, &ConfigureGridDialog::unitChanged); connect(button_box, &QDialogButtonBox::helpRequested, this, &ConfigureGridDialog::showHelp); connect(button_box, &QDialogButtonBox::accepted, this, &ConfigureGridDialog::okClicked); connect(button_box, &QDialogButtonBox::rejected, this, &QDialog::reject); }
void ChatAppearance::makeSettings() { m_current_variables.clear(); if (settingsWidget) delete settingsWidget; settingsWidget = new QWidget(this); QFormLayout *layout = new QFormLayout(settingsWidget); layout->setLabelAlignment(Qt::AlignLeft|Qt::AlignVCenter); QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); settingsWidget->setLayout(layout); QString category = "webkitstyle"; StyleVariants variants = ChatStyleGenerator::listVariants(ThemeManager::path(category, m_current_style_name) .append("/Contents/Resources/Variants")); if (!variants.isEmpty()) { QLabel *label = new QLabel(tr("Style variant:"), settingsWidget); label->setSizePolicy(sizePolicy); QComboBox *variantBox = new QComboBox(settingsWidget); layout->addRow(label, variantBox); StyleVariants::const_iterator it; for (it=variants.begin(); it!=variants.end(); it++) variantBox->addItem(it.key()); connect(variantBox, SIGNAL(currentIndexChanged(QString)), SLOT(onVariantChanged(QString))); int index = isLoad ? variantBox->findText(m_current_variant) : 0; m_current_variant = variantBox->itemText(index); variantBox->setCurrentIndex(index); onVariantChanged(m_current_variant); } Config achat(QStringList() << "appearance/adiumChat" << ThemeManager::path(category,m_current_style_name) .append("/Contents/Resources/custom.json")); ConfigGroup variables = achat; int count = variables.beginArray(m_current_style_name); for (int num = 0; num < count; num++) { ConfigGroup parameter = variables.arrayElement(num); QString type = parameter.value("type", QString()); QString text = parameter.value("label", QString()); text = parameter.value(QString("label-").append(QLocale().name()), text); CustomChatStyle style; style.parameter = parameter.value("parameter", QString()); style.selector = parameter.value("selector", QString()); style.value = parameter.value("value", QString()); if (type == "font") { QLabel *label = new QLabel(text % ":", settingsWidget); label->setSizePolicy(sizePolicy); ChatFont *fontField = new ChatFont(style, settingsWidget); layout->addRow(label, fontField); connect(fontField, SIGNAL(changeValue()), SLOT(onVariableChanged())); if (ChatVariable *widget = qobject_cast<ChatVariable*>(fontField)) m_current_variables.append(widget); } else if (type == "color") { QLabel *label = new QLabel(text % ":", settingsWidget); label->setSizePolicy(sizePolicy); ChatColor *colorField = new ChatColor(style, settingsWidget); layout->addRow(label, colorField); connect(colorField, SIGNAL(changeValue()), SLOT(onVariableChanged())); if (ChatVariable *widget = qobject_cast<ChatVariable*>(colorField)) m_current_variables.append(widget); } else if (type == "numeric") { QLabel *label = new QLabel(text % ":", settingsWidget); label->setSizePolicy(sizePolicy); double min = parameter.value<double>("min", 0); double max = parameter.value<double>("max", 0); double step = parameter.value<double>("step", 1); ChatNumeric *numField = new ChatNumeric(style, min, max, step, settingsWidget); layout->addRow(label, numField); connect(numField, SIGNAL(changeValue()), SLOT(onVariableChanged())); if (ChatVariable *widget = qobject_cast<ChatVariable*>(numField)) m_current_variables.append(widget); } else if (type == "boolean") { QString trueValue = parameter.value("true", QString()); QString falseValue = parameter.value("false", QString()); ChatBoolean *boolField = new ChatBoolean(style, trueValue, falseValue, settingsWidget); boolField->setText(text); layout->addRow(boolField); connect(boolField, SIGNAL(changeValue()), SLOT(onVariableChanged())); if (ChatVariable *widget = qobject_cast<ChatVariable*>(boolField)) m_current_variables.append(widget); } } onVariableChanged(); QSpacerItem *space = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding); layout->addItem(space); ui->scrollAreaLayout->addWidget(settingsWidget); }
TextSymbolSettings::TextSymbolSettings(TextSymbol* symbol, SymbolSettingDialog* dialog) : SymbolPropertiesWidget(symbol, dialog), symbol(symbol), dialog(dialog) { Map* map = dialog->getPreviewMap(); react_to_changes = true; QWidget* text_tab = new QWidget(); addPropertiesGroup(tr("Text settings"), text_tab); QFormLayout* layout = new QFormLayout(); text_tab->setLayout(layout); font_edit = new QFontComboBox(); layout->addRow(tr("Font family:"), font_edit); QHBoxLayout* size_layout = new QHBoxLayout(); size_layout->setMargin(0); size_layout->setSpacing(0); size_edit = Util::SpinBox::create(1, 0.0, 999999.9); size_layout->addWidget(size_edit); size_unit_combo = new QComboBox(); size_unit_combo->addItem(tr("mm"), QVariant((int)SizeInMM)); size_unit_combo->addItem(tr("pt"), QVariant((int)SizeInPT)); size_unit_combo->setCurrentIndex(0); size_layout->addWidget(size_unit_combo); size_determine_button = new QPushButton(tr("Determine size...")); size_layout->addSpacing(8); size_layout->addWidget(size_determine_button); layout->addRow(tr("Font size:"), size_layout); color_edit = new ColorDropDown(map, symbol->getColor()); layout->addRow(tr("Text color:"), color_edit); QVBoxLayout* text_style_layout = new QVBoxLayout(); bold_check = new QCheckBox(tr("bold")); text_style_layout->addWidget(bold_check); italic_check = new QCheckBox(tr("italic")); text_style_layout->addWidget(italic_check); underline_check = new QCheckBox(tr("underlined")); text_style_layout->addWidget(underline_check); layout->addRow(tr("Text style:"), text_style_layout); layout->addItem(Util::SpacerItem::create(this)); line_spacing_edit = Util::SpinBox::create(1, 0.0, 999999.9, tr("%")); layout->addRow(tr("Line spacing:"), line_spacing_edit); paragraph_spacing_edit = Util::SpinBox::create(2, -999999.9, 999999.9, tr("mm")); layout->addRow(tr("Paragraph spacing:"), paragraph_spacing_edit); character_spacing_edit = Util::SpinBox::create(1, -999999.9, 999999.9, tr("%")); layout->addRow(tr("Character spacing:"), character_spacing_edit); kerning_check = new QCheckBox(tr("Kerning")); layout->addRow("", kerning_check); layout->addItem(Util::SpacerItem::create(this)); icon_text_edit = new QLineEdit(); icon_text_edit->setMaxLength(3); layout->addRow(tr("Symbol icon text:"), icon_text_edit); layout->addItem(Util::SpacerItem::create(this)); framing_check = new QCheckBox(tr("Framing")); layout->addRow(framing_check); ocad_compat_check = new QCheckBox(tr("OCAD compatibility settings")); layout->addRow(ocad_compat_check); framing_widget = new QWidget(); addPropertiesGroup(tr("Framing"), framing_widget); QFormLayout* framing_layout = new QFormLayout(); framing_widget->setLayout(framing_layout); framing_color_edit = new ColorDropDown(map, symbol->getFramingColor()); framing_layout->addRow(tr("Framing color:"), framing_color_edit); framing_line_radio = new QRadioButton(tr("Line framing")); framing_layout->addRow(framing_line_radio); framing_line_half_width_edit = Util::SpinBox::create(1, 0.0, 999999.9); framing_layout->addRow(tr("Width:"), framing_line_half_width_edit); framing_shadow_radio = new QRadioButton(tr("Shadow framing")); framing_layout->addRow(framing_shadow_radio); framing_shadow_x_offset_edit = Util::SpinBox::create(1, -999999.9, 999999.9); framing_layout->addRow(tr("Left/Right Offset:"), framing_shadow_x_offset_edit); framing_shadow_y_offset_edit = Util::SpinBox::create(1, -999999.9, 999999.9); framing_layout->addRow(tr("Top/Down Offset:"), framing_shadow_y_offset_edit); ocad_compat_widget = new QWidget(); addPropertiesGroup(tr("OCAD compatibility"), ocad_compat_widget); QFormLayout* ocad_compat_layout = new QFormLayout(); ocad_compat_widget->setLayout(ocad_compat_layout); ocad_compat_layout->addRow(Util::Headline::create(tr("Line below paragraphs"))); line_below_check = new QCheckBox(tr("enabled")); ocad_compat_layout->addRow(line_below_check); line_below_width_edit = Util::SpinBox::create(2, 0.0, 999999.9, tr("mm")); ocad_compat_layout->addRow(tr("Line width:"), line_below_width_edit); line_below_color_edit = new ColorDropDown(map); ocad_compat_layout->addRow(tr("Line color:"), line_below_color_edit); line_below_distance_edit = Util::SpinBox::create(2, 0.0, 999999.9, tr("mm")); ocad_compat_layout->addRow(tr("Distance from baseline:"), line_below_distance_edit); ocad_compat_layout->addItem(Util::SpacerItem::create(this)); ocad_compat_layout->addRow(Util::Headline::create(tr("Custom tabulator positions"))); custom_tab_list = new QListWidget(); ocad_compat_layout->addRow(custom_tab_list); QHBoxLayout* custom_tabs_button_layout = new QHBoxLayout(); custom_tab_add = new QPushButton(QIcon(":/images/plus.png"), ""); custom_tabs_button_layout->addWidget(custom_tab_add); custom_tab_remove = new QPushButton(QIcon(":/images/minus.png"), ""); custom_tabs_button_layout->addWidget(custom_tab_remove); custom_tabs_button_layout->addStretch(1); ocad_compat_layout->addRow(custom_tabs_button_layout); updateGeneralContents(); updateFramingContents(); updateCompatibilityContents(); connect(font_edit, SIGNAL(currentFontChanged(QFont)), this, SLOT(fontChanged(QFont))); connect(size_edit, SIGNAL(valueChanged(double)), this, SLOT(sizeChanged(double))); connect(size_unit_combo, SIGNAL(currentIndexChanged(int)), this, SLOT(sizeUnitChanged(int))); connect(size_determine_button, SIGNAL(clicked(bool)), this, SLOT(determineSizeClicked())); connect(color_edit, SIGNAL(currentIndexChanged(int)), this, SLOT(colorChanged())); connect(bold_check, SIGNAL(clicked(bool)), this, SLOT(checkToggled(bool))); connect(italic_check, SIGNAL(clicked(bool)), this, SLOT(checkToggled(bool))); connect(underline_check, SIGNAL(clicked(bool)), this, SLOT(checkToggled(bool))); connect(line_spacing_edit, SIGNAL(valueChanged(double)), this, SLOT(spacingChanged(double))); connect(paragraph_spacing_edit, SIGNAL(valueChanged(double)), this, SLOT(spacingChanged(double))); connect(character_spacing_edit, SIGNAL(valueChanged(double)), this, SLOT(spacingChanged(double))); connect(kerning_check, SIGNAL(clicked(bool)), this, SLOT(checkToggled(bool))); connect(icon_text_edit, SIGNAL(textEdited(QString)), this, SLOT(iconTextEdited(QString))); connect(framing_check, SIGNAL(clicked(bool)), this, SLOT(framingCheckClicked(bool))); connect(ocad_compat_check, SIGNAL(clicked(bool)), this, SLOT(ocadCompatibilityButtonClicked(bool))); connect(framing_color_edit, SIGNAL(currentIndexChanged(int)), this, SLOT(framingColorChanged())); connect(framing_line_radio, SIGNAL(clicked(bool)), this, SLOT(framingModeChanged())); connect(framing_line_half_width_edit, SIGNAL(valueChanged(double)), this, SLOT(framingSettingChanged())); connect(framing_shadow_radio, SIGNAL(clicked(bool)), this, SLOT(framingModeChanged())); connect(framing_shadow_x_offset_edit, SIGNAL(valueChanged(double)), this, SLOT(framingSettingChanged())); connect(framing_shadow_y_offset_edit, SIGNAL(valueChanged(double)), this, SLOT(framingSettingChanged())); connect(line_below_check, SIGNAL(clicked(bool)), this, SLOT(lineBelowCheckClicked(bool))); connect(line_below_color_edit, SIGNAL(currentIndexChanged(int)), this, SLOT(lineBelowSettingChanged())); connect(line_below_width_edit, SIGNAL(valueChanged(double)), this, SLOT(lineBelowSettingChanged())); connect(line_below_distance_edit, SIGNAL(valueChanged(double)), this, SLOT(lineBelowSettingChanged())); connect(custom_tab_list, SIGNAL(currentRowChanged(int)), this, SLOT(customTabRowChanged(int))); connect(custom_tab_add, SIGNAL(clicked(bool)), this, SLOT(addCustomTabClicked())); connect(custom_tab_remove, SIGNAL(clicked(bool)), this, SLOT(removeCustomTabClicked())); }
void StatusWindow::createLayout() { QVBoxLayout *mainLayout = new QVBoxLayout(this); QFormLayout *formLayout = new QFormLayout(); mainLayout->addLayout(formLayout); formLayout->setMargin(0); formLayout->setVerticalSpacing(0); // status combo box StatusSelect = new QComboBox(this); formLayout->addRow(new QLabel(tr("Status") + ':'), StatusSelect); // spacing formLayout->addItem(new QSpacerItem(0, 4)); // description combo box QHBoxLayout *descriptionSelectLayout = new QHBoxLayout(); descriptionSelectLayout->setMargin(0); descriptionSelectLayout->setSpacing(0); DescriptionSelect = new QComboBox(this); DescriptionSelect->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); DescriptionSelect->setToolTip(tr("Select Previously Used Description")); descriptionSelectLayout->addWidget(DescriptionSelect); ClearDescriptionsHistoryButton = new QPushButton(m_iconsManager->iconByPath(KaduIcon("edit-clear")), "", this); ClearDescriptionsHistoryButton->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); ClearDescriptionsHistoryButton->setToolTip(tr("Clear Descriptions History")); descriptionSelectLayout->addWidget(ClearDescriptionsHistoryButton); formLayout->addRow(new QLabel(tr("Description") + ':'), descriptionSelectLayout); // description edit field QWidget *descriptionCounterLayoutWidget = new QWidget(this); QVBoxLayout *descriptionCounterLayout = new QVBoxLayout(descriptionCounterLayoutWidget); descriptionCounterLayout->setMargin(0); descriptionCounterLayout->setSpacing(5); descriptionCounterLayout->addStretch(); DescriptionCounter = new QLabel(this); DescriptionCounter->setAlignment(formLayout->labelAlignment()); descriptionCounterLayout->addWidget(DescriptionCounter); descriptionCounterLayout->addSpacing(2); // 2 px bottom margin QWidget *descriptionEditLayoutWidget = new QWidget(this); QHBoxLayout *descriptionEditLayout = new QHBoxLayout(descriptionEditLayoutWidget); descriptionEditLayout->setMargin(0); descriptionEditLayout->setSpacing(0); DescriptionEdit = new KaduTextEdit(this); DescriptionEdit->installEventFilter(this); DescriptionEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); DescriptionEdit->setTabChangesFocus(true); descriptionEditLayout->addWidget(DescriptionEdit); QVBoxLayout *descriptionEraseLayout = new QVBoxLayout(); descriptionEraseLayout->setMargin(0); descriptionEraseLayout->setSpacing(0); descriptionEraseLayout->addStretch(); EraseButton = new QPushButton(m_iconsManager->iconByPath(KaduIcon("edit-clear-locationbar-rtl")), "", this); EraseButton->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); EraseButton->setToolTip(tr("Erase Description")); descriptionEraseLayout->addWidget(EraseButton); descriptionEditLayout->addLayout(descriptionEraseLayout); formLayout->addRow(descriptionCounterLayoutWidget, descriptionEditLayoutWidget); mainLayout->addSpacing(16); // dialog buttons QDialogButtonBox *buttonsBox = new QDialogButtonBox(Qt::Horizontal, this); SetStatusButton = new QPushButton(qApp->style()->standardIcon(QStyle::SP_DialogOkButton), tr("&Set status"), this); SetStatusButton->setDefault(true); buttonsBox->addButton(SetStatusButton, QDialogButtonBox::AcceptRole); CancelButton = new QPushButton(tr("&Cancel"), this); CancelButton->setIcon(qApp->style()->standardIcon(QStyle::SP_DialogCancelButton)); buttonsBox->addButton(CancelButton, QDialogButtonBox::RejectRole); mainLayout->addWidget(buttonsBox); }