Merge pull request #19019 from hyarion/refactor/countObjectsOfType

Refactor countObjectsOfType in selection and document
This commit is contained in:
Chris Hennes
2025-01-14 16:05:12 -06:00
committed by GitHub
31 changed files with 194 additions and 222 deletions

View File

@@ -479,7 +479,7 @@ CmdDrawingOpenBrowserView::CmdDrawingOpenBrowserView()
void CmdDrawingOpenBrowserView::activated(int iMsg)
{
Q_UNUSED(iMsg);
unsigned int n = getSelection().countObjectsOfType(Drawing::FeaturePage::getClassTypeId());
unsigned int n = getSelection().countObjectsOfType<Drawing::FeaturePage>();
if (n != 1) {
QMessageBox::warning(Gui::getMainWindow(),
QObject::tr("Wrong selection"),
@@ -691,7 +691,7 @@ CmdDrawingExportPage::CmdDrawingExportPage()
void CmdDrawingExportPage::activated(int iMsg)
{
Q_UNUSED(iMsg);
unsigned int n = getSelection().countObjectsOfType(Drawing::FeaturePage::getClassTypeId());
unsigned int n = getSelection().countObjectsOfType<Drawing::FeaturePage>();
if (n != 1) {
QMessageBox::warning(Gui::getMainWindow(),
QObject::tr("Wrong selection"),
@@ -757,7 +757,7 @@ void CmdDrawingProjectShape::activated(int iMsg)
bool CmdDrawingProjectShape::isActive(void)
{
int ct = Gui::Selection().countObjectsOfType(Part::Feature::getClassTypeId());
int ct = Gui::Selection().countObjectsOfType<Part::Feature>();
return (ct > 0 && !Gui::Control().activeDialog());
}