Index: sheets/ui/CellToolBase.cpp --- sheets/ui/CellToolBase.cpp.orig +++ sheets/ui/CellToolBase.cpp @@ -185,17 +185,17 @@ CellToolBase::CellToolBase(KoCanvasBase* canvas) action->setIconText(i18n("Format")); addAction("cellStyle", action); action->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_F)); - connect(action, SIGNAL(triggered(bool)), this, SLOT(cellStyle())); + connect(action, &QAction::triggered, this, &CellToolBase::cellStyle); action->setToolTip(i18n("Set the cell formatting")); action = new QAction(i18n("Default"), this); addAction("setDefaultStyle", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(setDefaultStyle())); + connect(action, &QAction::triggered, this, &CellToolBase::setDefaultStyle); action->setToolTip(i18n("Resets to the default format")); action = new QAction(i18n("Style Manager..."), this); addAction("styleDialog", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(styleDialog())); + connect(action, &QAction::triggered, this, &CellToolBase::styleDialog); action->setToolTip(i18n("Edit and organize cell styles")); action = new KSelectAction(i18n("Style"), this); @@ -206,7 +206,7 @@ CellToolBase::CellToolBase(KoCanvasBase* canvas) action = new QAction(i18n("Create Style From Cell..."), this); action->setIconText(i18n("Style From Cell")); addAction("createStyleFromCell", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(createStyleFromCell())); + connect(action, &QAction::triggered, this, &CellToolBase::createStyleFromCell); action->setToolTip(i18n("Create a new style based on the currently selected cell")); // -- font actions -- @@ -214,21 +214,21 @@ CellToolBase::CellToolBase(KoCanvasBase* canvas) action = new KToggleAction(koIcon("format-text-bold"), i18n("Bold"), this); addAction("bold", action); action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_B)); - connect(action, SIGNAL(triggered(bool)), this, SLOT(bold(bool))); + connect(action, &QAction::triggered, this, &CellToolBase::bold); action = new KToggleAction(koIcon("format-text-italic"), i18n("Italic"), this); addAction("italic", action); action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_I)); - connect(action, SIGNAL(triggered(bool)), this, SLOT(italic(bool))); + connect(action, &QAction::triggered, this, &CellToolBase::italic); action = new KToggleAction(koIcon("format-text-underline"), i18n("Underline"), this); addAction("underline", action); action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_U)); - connect(action, SIGNAL(triggered(bool)), this, SLOT(underline(bool))); + connect(action, &QAction::triggered, this, &CellToolBase::underline); action = new KToggleAction(koIcon("format-text-strikethrough"), i18n("Strike Out"), this); addAction("strikeOut", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(strikeOut(bool))); + connect(action, &QAction::triggered, this, &CellToolBase::strikeOut); action = new KFontAction(i18n("Select Font..."), this); action->setIconText(i18n("Font")); @@ -242,11 +242,11 @@ CellToolBase::CellToolBase(KoCanvasBase* canvas) action = new QAction(koIcon("format-font-size-more"), i18n("Increase Font Size"), this); addAction("increaseFontSize", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(increaseFontSize())); + connect(action, &QAction::triggered, this, &CellToolBase::increaseFontSize); action = new QAction(koIcon("format-font-size-less"), i18n("Decrease Font Size"), this); addAction("decreaseFontSize", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(decreaseFontSize())); + connect(action, &QAction::triggered, this, &CellToolBase::decreaseFontSize); action = new KoColorPopupAction(this); action->setIcon(koIcon("format-text-color")); @@ -261,21 +261,21 @@ CellToolBase::CellToolBase(KoCanvasBase* canvas) action = new KToggleAction(koIcon("format-justify-left"), i18n("Align Left"), this); action->setIconText(i18n("Left")); addAction("alignLeft", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(alignLeft(bool))); + connect(action, &QAction::triggered, this, &CellToolBase::alignLeft); action->setToolTip(i18n("Left justify the cell contents")); action->setActionGroup(groupAlign); action = new KToggleAction(koIcon("format-justify-center"), i18n("Align Center"), this); action->setIconText(i18n("Center")); addAction("alignCenter", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(alignCenter(bool))); + connect(action, &QAction::triggered, this, &CellToolBase::alignCenter); action->setToolTip(i18n("Center the cell contents")); action->setActionGroup(groupAlign); action = new KToggleAction(koIcon("format-justify-right"), i18n("Align Right"), this); action->setIconText(i18n("Right")); addAction("alignRight", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(alignRight(bool))); + connect(action, &QAction::triggered, this, &CellToolBase::alignRight); action->setToolTip(i18n("Right justify the cell contents")); action->setActionGroup(groupAlign); @@ -285,21 +285,21 @@ CellToolBase::CellToolBase(KoCanvasBase* canvas) action = new KToggleAction(koIcon("format-align-vertical-top"), i18n("Align Top"), this); action->setIconText(i18n("Top")); addAction("alignTop", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(alignTop(bool))); + connect(action, &QAction::triggered, this, &CellToolBase::alignTop); action->setToolTip(i18n("Align cell contents along the top of the cell")); action->setActionGroup(groupPos); action = new KToggleAction(koIcon("format-align-vertical-center"), i18n("Align Middle"), this); action->setIconText(i18n("Middle")); addAction("alignMiddle", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(alignMiddle(bool))); + connect(action, &QAction::triggered, this, &CellToolBase::alignMiddle); action->setToolTip(i18n("Align cell contents centered in the cell")); action->setActionGroup(groupPos); action = new KToggleAction(koIcon("format-align-vertical-bottom"), i18n("Align Bottom"), this); action->setIconText(i18n("Bottom")); addAction("alignBottom", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(alignBottom(bool))); + connect(action, &QAction::triggered, this, &CellToolBase::alignBottom); action->setToolTip(i18n("Align cell contents along the bottom of the cell")); action->setActionGroup(groupPos); @@ -308,43 +308,43 @@ CellToolBase::CellToolBase(KoCanvasBase* canvas) action = new QAction(koIcon("format-border-set-left"), i18n("Border Left"), this); action->setIconText(i18n("Left")); addAction("borderLeft", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(borderLeft())); + connect(action, &QAction::triggered, this, &CellToolBase::borderLeft); action->setToolTip(i18n("Set a left border to the selected area")); action = new QAction(koIcon("format-border-set-right"), i18n("Border Right"), this); action->setIconText(i18n("Right")); addAction("borderRight", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(borderRight())); + connect(action, &QAction::triggered, this, &CellToolBase::borderRight); action->setToolTip(i18n("Set a right border to the selected area")); action = new QAction(koIcon("format-border-set-top"), i18n("Border Top"), this); action->setIconText(i18n("Top")); addAction("borderTop", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(borderTop())); + connect(action, &QAction::triggered, this, &CellToolBase::borderTop); action->setToolTip(i18n("Set a top border to the selected area")); action = new QAction(koIcon("format-border-set-bottom"), i18n("Border Bottom"), this); action->setIconText(i18n("Bottom")); addAction("borderBottom", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(borderBottom())); + connect(action, &QAction::triggered, this, &CellToolBase::borderBottom); action->setToolTip(i18n("Set a bottom border to the selected area")); action = new QAction(koIcon("format-border-set-all"), i18n("All Borders"), this); action->setIconText(i18n("All")); addAction("borderAll", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(borderAll())); + connect(action, &QAction::triggered, this, &CellToolBase::borderAll); action->setToolTip(i18n("Set a border around all cells in the selected area")); action = new QAction(koIcon("format-border-set-none"), i18n("No Borders"), this); action->setIconText(i18n("None")); addAction("borderRemove", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(borderRemove())); + connect(action, &QAction::triggered, this, &CellToolBase::borderRemove); action->setToolTip(i18n("Remove all borders in the selected area")); action = new QAction(koIcon("format-border-set-external"), i18n("Border Outline"), this); action->setIconText(i18n("Outline")); addAction("borderOutline", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(borderOutline())); + connect(action, &QAction::triggered, this, &CellToolBase::borderOutline); action->setToolTip(i18n("Set a border to the outline of the selected area")); action = new KoColorPopupAction(this); @@ -360,29 +360,29 @@ CellToolBase::CellToolBase(KoCanvasBase* canvas) action = new KToggleAction(koIcon("multirow"), i18n("Wrap Text"), this); action->setIconText(i18n("Wrap")); addAction("wrapText", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(wrapText(bool))); + connect(action, &QAction::triggered, this, &CellToolBase::wrapText); action->setToolTip(i18n("Make the cell text wrap onto multiple lines")); action = new KToggleAction(koIcon("format-text-direction-vertical"), i18n("Vertical Text"), this); action->setIconText(i18n("Vertical")); addAction("verticalText", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(verticalText(bool))); + connect(action, &QAction::triggered, this, &CellToolBase::verticalText); action->setToolTip(i18n("Print cell contents vertically")); action = new QAction(QIcon::fromTheme(QApplication::isRightToLeft() ? koIconName("format-indent-less") : koIconName("format-indent-more")), i18n("Increase Indent"), this); addAction("increaseIndentation", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(increaseIndentation())); + connect(action, &QAction::triggered, this, &CellToolBase::increaseIndentation); action->setToolTip(i18n("Increase the indentation")); action = new QAction(QIcon::fromTheme(QApplication::isRightToLeft() ? koIconName("format-indent-more") : koIconName("format-indent-less")), i18n("Decrease Indent"), this); addAction("decreaseIndentation", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(decreaseIndentation())); + connect(action, &QAction::triggered, this, &CellToolBase::decreaseIndentation); action->setToolTip(i18n("Decrease the indentation")); action = new QAction(i18n("Change Angle..."), this); action->setIconText(i18n("Angle")); addAction("changeAngle", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(changeAngle())); + connect(action, &QAction::triggered, this, &CellToolBase::changeAngle); action->setToolTip(i18n("Change the angle that cell contents are printed")); // -- value format actions -- @@ -390,23 +390,23 @@ CellToolBase::CellToolBase(KoCanvasBase* canvas) action = new KToggleAction(koIcon("format-number-percent"), i18n("Percent Format"), this); action->setIconText(i18n("Percent")); addAction("percent", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(percent(bool))); + connect(action, &QAction::triggered, this, &CellToolBase::percent); action->setToolTip(i18n("Set the cell formatting to look like a percentage")); action = new KToggleAction(koIcon("format-currency"), i18n("Money Format"), this); action->setIconText(i18n("Money")); addAction("currency", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(currency(bool))); + connect(action, &QAction::triggered, this, &CellToolBase::currency); action->setToolTip(i18n("Set the cell formatting to look like your local currency")); action = new QAction(koIcon("format-precision-more"), i18n("Increase Precision"), this); addAction("increasePrecision", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(increasePrecision())); + connect(action, &QAction::triggered, this, &CellToolBase::increasePrecision); action->setToolTip(i18n("Increase the decimal precision shown onscreen")); action = new QAction(koIcon("format-precision-less"), i18n("Decrease Precision"), this); addAction("decreasePrecision", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(decreasePrecision())); + connect(action, &QAction::triggered, this, &CellToolBase::decreasePrecision); action->setToolTip(i18n("Decrease the decimal precision shown onscreen")); // -- misc style attribute actions -- @@ -414,19 +414,19 @@ CellToolBase::CellToolBase(KoCanvasBase* canvas) action = new QAction(koIconWanted("no icon in Kate, but LO has one", "format-text-uppercase"), i18n("Upper Case"), this); action->setIconText(i18n("Upper")); addAction("toUpperCase", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(toUpperCase())); + connect(action, &QAction::triggered, this, &CellToolBase::toUpperCase); action->setToolTip(i18n("Convert all letters to upper case")); action = new QAction(koIconWanted("no icon in Kate, but LO has one", "format-text-lowercase"), i18n("Lower Case"), this); action->setIconText(i18n("Lower")); addAction("toLowerCase", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(toLowerCase())); + connect(action, &QAction::triggered, this, &CellToolBase::toLowerCase); action->setToolTip(i18n("Convert all letters to lower case")); action = new QAction(koIcon("format-text-capitalize"), i18n("Convert First Letter to Upper Case"), this); action->setIconText(i18n("First Letter Upper")); addAction("firstLetterToUpperCase", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(firstLetterToUpperCase())); + connect(action, &QAction::triggered, this, &CellToolBase::firstLetterToUpperCase); action->setToolTip(i18n("Capitalize the first letter")); action = new KoColorPopupAction(this); @@ -440,105 +440,105 @@ CellToolBase::CellToolBase(KoCanvasBase* canvas) action = new QAction(koIcon("mergecell"), i18n("Merge Cells"), this); addAction("mergeCells", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(mergeCells())); + connect(action, &QAction::triggered, this, &CellToolBase::mergeCells); action->setToolTip(i18n("Merge the selected region")); action = new QAction(koIcon("mergecell-horizontal"), i18n("Merge Cells Horizontally"), this); action->setToolTip(i18n("Merge the selected region horizontally")); addAction("mergeCellsHorizontal", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(mergeCellsHorizontal())); + connect(action, &QAction::triggered, this, &CellToolBase::mergeCellsHorizontal); action = new QAction(koIcon("mergecell-vertical"), i18n("Merge Cells Vertically"), this); action->setToolTip(i18n("Merge the selected region vertically")); addAction("mergeCellsVertical", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(mergeCellsVertical())); + connect(action, &QAction::triggered, this, &CellToolBase::mergeCellsVertical); action = new QAction(koIcon("dissociatecell"), i18n("Dissociate Cells"), this); action->setToolTip(i18n("Unmerge the selected region")); addAction("dissociateCells", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(dissociateCells())); + connect(action, &QAction::triggered, this, &CellToolBase::dissociateCells); // -- column & row actions -- action = new QAction(koIcon("resizecol"), i18n("Resize Column..."), this); addAction("resizeCol", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(resizeColumn())); + connect(action, &QAction::triggered, this, &CellToolBase::resizeColumn); action->setToolTip(i18n("Change the width of a column")); action = new QAction(koIcon("edit-table-insert-column-left"), i18n("Columns"), this); action->setIconText(i18n("Insert Columns")); action->setToolTip(i18n("Inserts a new column into the spreadsheet")); addAction("insertColumn", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(insertColumn())); + connect(action, &QAction::triggered, this, &CellToolBase::insertColumn); action = new QAction(koIcon("edit-table-delete-column"), i18n("Columns"), this); action->setIconText(i18n("Remove Columns")); action->setToolTip(i18n("Removes the selected columns from the spreadsheet")); addAction("deleteColumn", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(deleteColumn())); + connect(action, &QAction::triggered, this, &CellToolBase::deleteColumn); action = new QAction(koIcon("hide_table_column"), i18n("Hide Columns"), this); addAction("hideColumn", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(hideColumn())); + connect(action, &QAction::triggered, this, &CellToolBase::hideColumn); action->setToolTip(i18n("Hide the column from this")); action = new QAction(koIcon("show_table_column"), i18n("Show Columns..."), this); addAction("showColumn", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(slotShowColumnDialog())); + connect(action, &QAction::triggered, this, &CellToolBase::slotShowColumnDialog); action->setToolTip(i18n("Show hidden columns")); action = new QAction(koIcon("adjustcol"), i18n("Equalize Column"), this); addAction("equalizeCol", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(equalizeColumn())); + connect(action, &QAction::triggered, this, &CellToolBase::equalizeColumn); action->setToolTip(i18n("Resizes selected columns to be the same size")); action = new QAction(koIcon("show_table_column"), i18n("Show Columns"), this); addAction("showSelColumns", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(showColumn())); + connect(action, &QAction::triggered, this, &CellToolBase::showColumn); action->setToolTip(i18n("Show hidden columns in the selection")); action->setEnabled(false); action = new QAction(koIcon("resizerow"), i18n("Resize Row..."), this); addAction("resizeRow", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(resizeRow())); + connect(action, &QAction::triggered, this, &CellToolBase::resizeRow); action->setToolTip(i18n("Change the height of a row")); action = new QAction(koIcon("edit-table-insert-row-above"), i18n("Rows"), this); action->setIconText(i18n("Insert Rows")); action->setToolTip(i18n("Inserts a new row into the spreadsheet")); addAction("insertRow", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(insertRow())); + connect(action, &QAction::triggered, this, &CellToolBase::insertRow); action = new QAction(koIcon("edit-table-delete-row"), i18n("Rows"), this); action->setIconText(i18n("Remove Rows")); action->setToolTip(i18n("Removes a row from the spreadsheet")); addAction("deleteRow", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(deleteRow())); + connect(action, &QAction::triggered, this, &CellToolBase::deleteRow); action = new QAction(koIcon("hide_table_row"), i18n("Hide Rows"), this); addAction("hideRow", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(hideRow())); + connect(action, &QAction::triggered, this, &CellToolBase::hideRow); action->setToolTip(i18n("Hide a row from this")); action = new QAction(koIcon("show_table_row"), i18n("Show Rows..."), this); addAction("showRow", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(slotShowRowDialog())); + connect(action, &QAction::triggered, this, &CellToolBase::slotShowRowDialog); action->setToolTip(i18n("Show hidden rows")); action = new QAction(koIcon("adjustrow"), i18n("Equalize Row"), this); addAction("equalizeRow", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(equalizeRow())); + connect(action, &QAction::triggered, this, &CellToolBase::equalizeRow); action->setToolTip(i18n("Resizes selected rows to be the same size")); action = new QAction(koIcon("show_table_row"), i18n("Show Rows"), this); addAction("showSelRows", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(showRow())); + connect(action, &QAction::triggered, this, &CellToolBase::showRow); action->setEnabled(false); action->setToolTip(i18n("Show hidden rows in the selection")); action = new QAction(i18n("Adjust Row && Column"), this); addAction("adjust", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(adjust())); + connect(action, &QAction::triggered, this, &CellToolBase::adjust); action->setToolTip(i18n("Adjusts row/column size so that the contents will fit")); // -- cell insert/remove actions -- @@ -547,13 +547,13 @@ CellToolBase::CellToolBase(KoCanvasBase* canvas) action->setIconText(i18n("Insert Cells...")); action->setToolTip(i18n("Insert a blank cell into the spreadsheet")); addAction("insertCell", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(insertCells())); + connect(action, &QAction::triggered, this, &CellToolBase::insertCells); action = new QAction(koIcon("removecell"), i18n("Cells..."), this); action->setIconText(i18n("Remove Cells...")); action->setToolTip(i18n("Removes the cells from the spreadsheet")); addAction("deleteCell", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(deleteCells())); + connect(action, &QAction::triggered, this, &CellToolBase::deleteCells); // -- cell content actions -- @@ -561,173 +561,173 @@ CellToolBase::CellToolBase(KoCanvasBase* canvas) action->setIconText(i18n("Clear All")); action->setToolTip(i18n("Clear all contents and formatting of the current cell")); addAction("clearAll", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(clearAll())); + connect(action, &QAction::triggered, this, &CellToolBase::clearAll); action = new QAction(koIcon("edit-clear"), i18n("Contents"), this); action->setIconText(i18n("Clear Contents")); action->setToolTip(i18n("Remove the contents of the current cell")); addAction("clearContents", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(clearContents())); + connect(action, &QAction::triggered, this, &CellToolBase::clearContents); action = new QAction(koIcon("edit-comment"), i18n("Comment..."), this); action->setToolTip(i18n("Edit a comment for this cell")); addAction("comment", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(comment())); + connect(action, &QAction::triggered, this, &CellToolBase::comment); action = new QAction(koIcon("delete-comment"), i18n("Comment"), this); action->setIconText(i18n("Remove Comment")); action->setToolTip(i18n("Remove this cell's comment")); addAction("clearComment", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(clearComment())); + connect(action, &QAction::triggered, this, &CellToolBase::clearComment); action = new QAction(i18n("Conditional Styles..."), this); action->setToolTip(i18n("Set cell style based on certain conditions")); addAction("conditional", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(conditional())); + connect(action, &QAction::triggered, this, &CellToolBase::conditional); action = new QAction(i18n("Conditional Styles"), this); action->setIconText(i18n("Remove Conditional Styles")); action->setToolTip(i18n("Remove the conditional cell styles")); addAction("clearConditional", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(clearConditionalStyles())); + connect(action, &QAction::triggered, this, &CellToolBase::clearConditionalStyles); action = new QAction(koIcon("insert-link"), i18n("&Link..."), this); addAction("insertHyperlink", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(insertHyperlink())); + connect(action, &QAction::triggered, this, &CellToolBase::insertHyperlink); action->setToolTip(i18n("Insert an Internet hyperlink")); action = new QAction(i18n("Link"), this); action->setIconText(i18n("Remove Link")); action->setToolTip(i18n("Remove a link")); addAction("clearHyperlink", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(clearHyperlink())); + connect(action, &QAction::triggered, this, &CellToolBase::clearHyperlink); action = new QAction(i18n("Validity..."), this); action->setToolTip(i18n("Set tests to confirm cell data is valid")); addAction("validity", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(validity())); + connect(action, &QAction::triggered, this, &CellToolBase::validity); action = new QAction(i18n("Validity"), this); action->setIconText(i18n("Remove Validity")); action->setToolTip(i18n("Remove the validity tests on this cell")); addAction("clearValidity", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(clearValidity())); + connect(action, &QAction::triggered, this, &CellToolBase::clearValidity); // -- sorting/filtering action -- action = new QAction(i18n("&Sort..."), this); addAction("sort", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(sort())); + connect(action, &QAction::triggered, this, &CellToolBase::sort); action->setToolTip(i18n("Sort a group of cells")); action = new QAction(koIcon("view-sort-descending"), i18n("Sort &Decreasing"), this); addAction("sortDec", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(sortDec())); + connect(action, &QAction::triggered, this, &CellToolBase::sortDec); action->setToolTip(i18n("Sort a group of cells in decreasing(last to first) order")); action = new QAction(koIcon("view-sort-ascending"), i18n("Sort &Increasing"), this); addAction("sortInc", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(sortInc())); + connect(action, &QAction::triggered, this, &CellToolBase::sortInc); action->setToolTip(i18n("Sort a group of cells in ascending(first to last) order")); action = new QAction(koIcon("view-filter"), i18n("&Auto-Filter"), this); addAction("autoFilter", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(autoFilter())); + connect(action, &QAction::triggered, this, &CellToolBase::autoFilter); action->setToolTip(i18n("Add an automatic filter to a cell range")); // -- fill actions -- action = new QAction(/*koIcon("arrow-left"), */i18n("&Left"), this); addAction("fillLeft", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(fillLeft())); + connect(action, &QAction::triggered, this, &CellToolBase::fillLeft); action = new QAction(/*koIcon("arrow-right"), */i18n("&Right"), this); addAction("fillRight", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(fillRight())); + connect(action, &QAction::triggered, this, &CellToolBase::fillRight); action = new QAction(/*koIcon("arrow-up"), */i18n("&Up"), this); addAction("fillUp", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(fillUp())); + connect(action, &QAction::triggered, this, &CellToolBase::fillUp); action = new QAction(/*koIcon("arrow-down"), */i18n("&Down"), this); addAction("fillDown", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(fillDown())); + connect(action, &QAction::triggered, this, &CellToolBase::fillDown); action = new QAction(koIcon("black_sum"), i18n("Autosum"), this); addAction("autoSum", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(autoSum())); + connect(action, &QAction::triggered, this, &CellToolBase::autoSum); action->setToolTip(i18n("Insert the 'sum' function")); // -- data insert actions -- action = new QAction(koIcon("series"), i18n("&Series..."), this); addAction("insertSeries", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(insertSeries())); + connect(action, &QAction::triggered, this, &CellToolBase::insertSeries); action ->setToolTip(i18n("Insert a series")); action = new QAction(koIcon("insert-math-expression"), i18n("&Function..."), this); addAction("insertFormula", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(insertFormula())); + connect(action, &QAction::triggered, this, &CellToolBase::insertFormula); action->setToolTip(i18n("Insert math expression")); action = new QAction(koIcon("character-set"), i18n("S&pecial Character..."), this); addAction("insertSpecialChar", action); action->setToolTip(i18n("Insert one or more symbols or letters not found on the keyboard")); - connect(action, SIGNAL(triggered(bool)), this, SLOT(insertSpecialChar())); + connect(action, &QAction::triggered, this, &CellToolBase::insertSpecialChar); #ifndef QT_NO_SQL action = new QAction(koIcon("network-server-database"), i18n("From &Database..."), this); action->setIconText(i18n("Database")); addAction("insertFromDatabase", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(insertFromDatabase())); + connect(action, &QAction::triggered, this, &CellToolBase::insertFromDatabase); action->setToolTip(i18n("Insert data from a SQL database")); #endif action = new QAction(koIcon("text-plain"), i18n("From &Text File..."), this); action->setIconText(i18n("Text File")); addAction("insertFromTextfile", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(insertFromTextfile())); + connect(action, &QAction::triggered, this, &CellToolBase::insertFromTextfile); action->setToolTip(i18n("Insert data from a text file to the current cursor position/selection")); action = new QAction(koIcon("edit-paste"), i18n("From &Clipboard..."), this); action->setIconText(i18n("Clipboard")); addAction("insertFromClipboard", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(insertFromClipboard())); + connect(action, &QAction::triggered, this, &CellToolBase::insertFromClipboard); action->setToolTip(i18n("Insert CSV data from the clipboard to the current cursor position/selection")); action = new QAction(i18n("&Text to Columns..."), this); addAction("textToColumns", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(textToColumns())); + connect(action, &QAction::triggered, this, &CellToolBase::textToColumns); action->setToolTip(i18n("Expand the content of cells to multiple columns")); action = new QAction(i18n("Custom Lists..."), this); addAction("sortList", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(sortList())); + connect(action, &QAction::triggered, this, &CellToolBase::sortList); action->setToolTip(i18n("Create custom lists for sorting or autofill")); action = new QAction(i18n("&Consolidate..."), this); addAction("consolidate", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(consolidate())); + connect(action, &QAction::triggered, this, &CellToolBase::consolidate); action->setToolTip(i18n("Create a region of summary data from a group of similar regions")); action = new QAction(i18n("&Goal Seek..."), this); addAction("goalSeek", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(goalSeek())); + connect(action, &QAction::triggered, this, &CellToolBase::goalSeek); action->setToolTip(i18n("Repeating calculation to find a specific value")); action = new QAction(i18n("&Subtotals..."), this); addAction("subtotals", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(subtotals())); + connect(action, &QAction::triggered, this, &CellToolBase::subtotals); action->setToolTip(i18n("Create different kind of subtotals to a list or database")); action = new QAction(i18n("&Pivot Tables..."), this); addAction("Pivot", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(pivot())); + connect(action, &QAction::triggered, this, &CellToolBase::pivot); action->setToolTip(i18n("Create Pivot Tables")); action = new QAction(i18n("Area Name..."), this); addAction("setAreaName", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(setAreaName())); + connect(action, &QAction::triggered, this, &CellToolBase::setAreaName); action->setToolTip(i18n("Set a name for a region of the spreadsheet")); action = new QAction(i18n("Named Areas..."), this); @@ -736,7 +736,7 @@ CellToolBase::CellToolBase(KoCanvasBase* canvas) action->setIcon(koIcon("bookmarks")); action->setToolTip(i18n("Edit or select named areas")); addAction("namedAreaDialog", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(namedAreaDialog())); + connect(action, &QAction::triggered, this, &CellToolBase::namedAreaDialog); action = new KSelectAction(i18n("Formula Selection"), this); addAction("formulaSelection", action); @@ -759,7 +759,7 @@ CellToolBase::CellToolBase(KoCanvasBase* canvas) action = new QAction(koIcon("cell_edit"), i18n("Modify Cell"), this); addAction("editCell", action); action->setShortcuts(QList() << QKeySequence(Qt::CTRL + Qt::Key_M)); - connect(action, SIGNAL(triggered(bool)), this, SLOT(edit())); + connect(action, &QAction::triggered, this, &CellToolBase::edit); action->setToolTip(i18n("Edit the highlighted cell")); action = KStandardAction::cut(this, SLOT(cut()), this); @@ -776,12 +776,12 @@ CellToolBase::CellToolBase(KoCanvasBase* canvas) action = new QAction(koIcon("special_paste"), i18n("Special Paste..."), this); addAction("specialPaste", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(specialPaste())); + connect(action, &QAction::triggered, this, &CellToolBase::specialPaste); action->setToolTip(i18n("Paste the contents of the clipboard with special options")); action = new QAction(koIcon("insertcellcopy"), i18n("Paste with Insertion"), this); addAction("pasteWithInsertion", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(pasteWithInsertion())); + connect(action, &QAction::triggered, this, &CellToolBase::pasteWithInsertion); action->setToolTip(i18n("Inserts a cell from the clipboard into the spreadsheet")); action = KStandardAction::selectAll(this, SLOT(selectAll()), this); @@ -806,7 +806,7 @@ CellToolBase::CellToolBase(KoCanvasBase* canvas) action->setIconText(i18n("Goto")); action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_G)); addAction("gotoCell", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(gotoCell())); + connect(action, &QAction::triggered, this, &CellToolBase::gotoCell); action->setToolTip(i18n("Move to a particular cell")); action = KStandardAction::spelling(this, SLOT(spellCheck()), this); @@ -816,34 +816,34 @@ CellToolBase::CellToolBase(KoCanvasBase* canvas) action = new QAction(koIconWanted("not used in UI, but devs might do, so nice to have", "inspector"), i18n("Run Inspector..."), this); addAction("inspector", action); action->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_I)); - connect(action, SIGNAL(triggered(bool)), this, SLOT(inspector())); + connect(action, &QAction::triggered, this, &CellToolBase::inspector); #ifndef NDEBUG action = new QAction(koIcon("table"), i18n("Show QTableView..."), this); addAction("qTableView", action); action->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_T)); - connect(action, SIGNAL(triggered(bool)), this, SLOT(qTableView())); + connect(action, &QAction::triggered, this, &CellToolBase::qTableView); #endif action = new QAction(i18n("Auto-Format..."), this); addAction("sheetFormat", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(sheetFormat())); + connect(action, &QAction::triggered, this, &CellToolBase::sheetFormat); action->setToolTip(i18n("Set the worksheet formatting")); action = new QAction(koIcon("application-vnd.oasis.opendocument.spreadsheet"), i18n("Document Settings..."), this); addAction("documentSettingsDialog", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(documentSettingsDialog())); + connect(action, &QAction::triggered, this, &CellToolBase::documentSettingsDialog); action->setToolTip(i18n("Show document settings dialog")); action = new KToggleAction(i18n("Break Before Column"), this); addAction("format_break_before_column", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(breakBeforeColumn(bool))); + connect(action, &QAction::triggered, this, &CellToolBase::breakBeforeColumn); action->setIconText(i18n("Column Break")); action->setToolTip(i18n("Set a manual page break before the column")); action = new KToggleAction(i18n("Break Before Row"), this); addAction("format_break_before_row", action); - connect(action, SIGNAL(triggered(bool)), this, SLOT(breakBeforeRow(bool))); + connect(action, &QAction::triggered, this, &CellToolBase::breakBeforeRow); action->setIconText(i18n("Row Break")); action->setToolTip(i18n("Set a manual page break before the row")); @@ -987,7 +987,7 @@ void CellToolBase::mouseDoubleClickEvent(KoPointerEven void CellToolBase::keyPressEvent(QKeyEvent* event) { - register Sheet * const sheet = selection()->activeSheet(); + Sheet * const sheet = selection()->activeSheet(); if (!sheet) { return; } @@ -1116,18 +1116,18 @@ void CellToolBase::activate(ToolActivation toolActivat // Establish connections. connect(selection(), SIGNAL(changed(Region)), this, SLOT(selectionChanged(Region))); - connect(selection(), SIGNAL(closeEditor(bool,bool)), - this, SLOT(deleteEditor(bool,bool))); - connect(selection(), SIGNAL(modified(Region)), - this, SLOT(updateEditor())); - connect(selection(), SIGNAL(activeSheetChanged(Sheet*)), - this, SLOT(activeSheetChanged(Sheet*))); - connect(selection(), SIGNAL(requestFocusEditor()), - this, SLOT(focusEditorRequested())); - connect(selection(), SIGNAL(documentReadWriteToggled(bool)), - this, SLOT(documentReadWriteToggled(bool))); - connect(selection(), SIGNAL(sheetProtectionToggled(bool)), - this, SLOT(sheetProtectionToggled(bool))); + connect(selection(), &Selection::closeEditor, + this, &CellToolBase::deleteEditor); + connect(selection(), &Selection::modified, + this, &CellToolBase::updateEditor); + connect(selection(), &Selection::activeSheetChanged, + this, &CellToolBase::activeSheetChanged); + connect(selection(), &Selection::requestFocusEditor, + this, &CellToolBase::focusEditorRequested); + connect(selection(), &Selection::documentReadWriteToggled, + this, &CellToolBase::documentReadWriteToggled); + connect(selection(), &Selection::sheetProtectionToggled, + this, &CellToolBase::sheetProtectionToggled); } void CellToolBase::deactivate() @@ -1388,8 +1388,8 @@ bool CellToolBase::createEditor(bool clear, bool focus if (!editor()) { d->cellEditor = new CellEditor(this, d->wordCollection,canvas()->canvasWidget()); d->cellEditor->setEditorFont(cell.style().font(), true, canvas()->viewConverter()); - connect(action("permuteFixation"), SIGNAL(triggered(bool)), - d->cellEditor, SLOT(permuteFixation())); + connect(action("permuteFixation"), &QAction::triggered, + d->cellEditor, &CellEditor::permuteFixation); if(d->externalEditor) { connect(d->cellEditor, SIGNAL(textChanged(QString)), @@ -2751,8 +2751,8 @@ void CellToolBase::insertSpecialChar() if (d->specialCharDialog == 0) { d->specialCharDialog = new CharacterSelectDialog(canvas()->canvasWidget(), "SpecialCharDialog", fontFamily, c, false); - connect(d->specialCharDialog, SIGNAL(insertChar(QChar,QString)), - this, SLOT(specialChar(QChar,QString))); + connect(d->specialCharDialog, &CharacterSelectDialog::insertChar, + this, &CellToolBase::specialChar); connect(d->specialCharDialog, SIGNAL(finished()), this, SLOT(specialCharDialogClosed())); } @@ -2762,8 +2762,8 @@ void CellToolBase::insertSpecialChar() void CellToolBase::specialCharDialogClosed() { if (d->specialCharDialog) { - disconnect(d->specialCharDialog, SIGNAL(insertChar(QChar,QString)), - this, SLOT(specialChar(QChar,QString))); + disconnect(d->specialCharDialog, &CharacterSelectDialog::insertChar, + this, &CellToolBase::specialChar); disconnect(d->specialCharDialog, SIGNAL(finished()), this, SLOT(specialCharDialogClosed())); d->specialCharDialog->deleteLater(); @@ -3128,8 +3128,8 @@ void CellToolBase::initFindReplace() Q_ASSERT(findObj); connect(findObj, SIGNAL(highlight(QString,int,int)), this, SLOT(slotHighlight(QString,int,int))); - connect(findObj, SIGNAL(findNext()), - this, SLOT(findNext())); + connect(findObj, &KFind::findNext, + this, &CellToolBase::findNext); bool bck = d->findOptions & KFind::FindBackwards; Sheet* currentSheet = d->searchInSheets.currentSheet; @@ -3505,8 +3505,8 @@ void CellToolBase::listChoosePopupMenu() } d->popupListChoose->popup(p2); - connect(d->popupListChoose, SIGNAL(triggered(QAction*)), - this, SLOT(listChooseItemSelected(QAction*))); + connect(d->popupListChoose, &QMenu::triggered, + this, &CellToolBase::listChooseItemSelected); }