<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.26.1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>203</ContextCount>
  <ElementCount>310</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>76</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>11</UnitCount>
  <MyReports>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>0000001 - Document - Cover Page</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/CoverPage</Role>
      <ShortName>Cover Page</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>9952151 - Statement - Condensed Consolidated Balance Sheets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/CondensedConsolidatedBalanceSheets</Role>
      <ShortName>Condensed Consolidated Balance Sheets</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>9952152 - Statement - Condensed Consolidated Balance Sheets (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/CondensedConsolidatedBalanceSheetsParenthetical</Role>
      <ShortName>Condensed Consolidated Balance Sheets (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>9952153 - Statement - Condensed Consolidated Statements of Operations</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/CondensedConsolidatedStatementsofOperations</Role>
      <ShortName>Condensed Consolidated Statements of Operations</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>9952154 - Statement - Condensed Consolidated Statements of Comprehensive Income (Loss)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/CondensedConsolidatedStatementsofComprehensiveIncomeLoss</Role>
      <ShortName>Condensed Consolidated Statements of Comprehensive Income (Loss)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>9952155 - Statement - Condensed Consolidated Statements of Cash Flows</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/CondensedConsolidatedStatementsofCashFlows</Role>
      <ShortName>Condensed Consolidated Statements of Cash Flows</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>9952156 - Statement - Condensed Consolidated Statements of Equity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/CondensedConsolidatedStatementsofEquity</Role>
      <ShortName>Condensed Consolidated Statements of Equity</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>9952157 - Statement - Condensed Consolidated Statements of Equity (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/CondensedConsolidatedStatementsofEquityParenthetical</Role>
      <ShortName>Condensed Consolidated Statements of Equity (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>9952158 - Disclosure - Business and Organization, Basis of Presentation and Accounting Policies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/BusinessandOrganizationBasisofPresentationandAccountingPolicies</Role>
      <ShortName>Business and Organization, Basis of Presentation and Accounting Policies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>9952159 - Disclosure - Revenue Recognition and Related Balance Sheet Accounts</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/RevenueRecognitionandRelatedBalanceSheetAccounts</Role>
      <ShortName>Revenue Recognition and Related Balance Sheet Accounts</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>9952160 - Disclosure - Segment Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/SegmentInformation</Role>
      <ShortName>Segment Information</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>9952161 - Disclosure - Acquisitions</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/Acquisitions</Role>
      <ShortName>Acquisitions</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>9952162 - Disclosure - Investments in Affiliates and Other Entities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/InvestmentsinAffiliatesandOtherEntities</Role>
      <ShortName>Investments in Affiliates and Other Entities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>9952163 - Disclosure - Per Share Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/PerShareInformation</Role>
      <ShortName>Per Share Information</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>9952164 - Disclosure - Debt Obligations</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/DebtObligations</Role>
      <ShortName>Debt Obligations</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>9952165 - Disclosure - Income Taxes</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/IncomeTaxes</Role>
      <ShortName>Income Taxes</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>9952166 - Disclosure - Equity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/Equity</Role>
      <ShortName>Equity</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>9952167 - Disclosure - Stock-Based Compensation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/StockBasedCompensation</Role>
      <ShortName>Stock-Based Compensation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>9952168 - Disclosure - Employee Benefit Plans</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/EmployeeBenefitPlans</Role>
      <ShortName>Employee Benefit Plans</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>9952169 - Disclosure - Commitments and Contingencies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/CommitmentsandContingencies</Role>
      <ShortName>Commitments and Contingencies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>9952170 - Disclosure - Detail of Certain Accounts</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/DetailofCertainAccounts</Role>
      <ShortName>Detail of Certain Accounts</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>21</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>9952171 - Disclosure - Supplemental Cash Flow Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/SupplementalCashFlowInformation</Role>
      <ShortName>Supplemental Cash Flow Information</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>22</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>995445 - Disclosure - Insider Trading Arrangements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xbrl.sec.gov/ecd/role/InsiderTradingArrangements</Role>
      <ShortName>Insider Trading Arrangements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>23</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>9955511 - Disclosure - Business and Organization, Basis of Presentation and Accounting Policies (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/BusinessandOrganizationBasisofPresentationandAccountingPoliciesPolicies</Role>
      <ShortName>Business and Organization, Basis of Presentation and Accounting Policies (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <ParentRole>http://quantaservices.com/role/BusinessandOrganizationBasisofPresentationandAccountingPolicies</ParentRole>
      <Position>24</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>9955512 - Disclosure - Revenue Recognition and Related Balance Sheet Accounts (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/RevenueRecognitionandRelatedBalanceSheetAccountsTables</Role>
      <ShortName>Revenue Recognition and Related Balance Sheet Accounts (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://quantaservices.com/role/RevenueRecognitionandRelatedBalanceSheetAccounts</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>9955513 - Disclosure - Segment Information (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/SegmentInformationTables</Role>
      <ShortName>Segment Information (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://quantaservices.com/role/SegmentInformation</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>9955514 - Disclosure - Acquisitions (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/AcquisitionsTables</Role>
      <ShortName>Acquisitions (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://quantaservices.com/role/Acquisitions</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>9955515 - Disclosure - Investments in Affiliates and Other Entities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/InvestmentsinAffiliatesandOtherEntitiesTables</Role>
      <ShortName>Investments in Affiliates and Other Entities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://quantaservices.com/role/InvestmentsinAffiliatesandOtherEntities</ParentRole>
      <Position>28</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>9955516 - Disclosure - Per Share Information (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/PerShareInformationTables</Role>
      <ShortName>Per Share Information (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://quantaservices.com/role/PerShareInformation</ParentRole>
      <Position>29</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>9955517 - Disclosure - Debt Obligations (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/DebtObligationsTables</Role>
      <ShortName>Debt Obligations (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://quantaservices.com/role/DebtObligations</ParentRole>
      <Position>30</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>9955518 - Disclosure - Equity (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/EquityTables</Role>
      <ShortName>Equity (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://quantaservices.com/role/Equity</ParentRole>
      <Position>31</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>9955519 - Disclosure - Stock-Based Compensation (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/StockBasedCompensationTables</Role>
      <ShortName>Stock-Based Compensation (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://quantaservices.com/role/StockBasedCompensation</ParentRole>
      <Position>32</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>9955520 - Disclosure - Employee Benefit Plans (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/EmployeeBenefitPlansTables</Role>
      <ShortName>Employee Benefit Plans (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://quantaservices.com/role/EmployeeBenefitPlans</ParentRole>
      <Position>33</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>9955521 - Disclosure - Detail of Certain Accounts (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/DetailofCertainAccountsTables</Role>
      <ShortName>Detail of Certain Accounts (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://quantaservices.com/role/DetailofCertainAccounts</ParentRole>
      <Position>34</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>9955522 - Disclosure - Supplemental Cash Flow Information (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/SupplementalCashFlowInformationTables</Role>
      <ShortName>Supplemental Cash Flow Information (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://quantaservices.com/role/SupplementalCashFlowInformation</ParentRole>
      <Position>35</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>9955523 - Disclosure - Revenue Recognition and Related Balance Sheet Accounts - Revenue Disaggregated by Geographic Location and Contract Type (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/RevenueRecognitionandRelatedBalanceSheetAccountsRevenueDisaggregatedbyGeographicLocationandContractTypeDetails</Role>
      <ShortName>Revenue Recognition and Related Balance Sheet Accounts - Revenue Disaggregated by Geographic Location and Contract Type (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>36</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>9955524 - Disclosure - Revenue Recognition and Related Balance Sheet Accounts - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/RevenueRecognitionandRelatedBalanceSheetAccountsAdditionalInformationDetails</Role>
      <ShortName>Revenue Recognition and Related Balance Sheet Accounts - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>9955525 - Disclosure - Revenue Recognition and Related Balance Sheet Accounts - Contract Assets and Liabilities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/RevenueRecognitionandRelatedBalanceSheetAccountsContractAssetsandLiabilitiesDetails</Role>
      <ShortName>Revenue Recognition and Related Balance Sheet Accounts - Contract Assets and Liabilities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>9955526 - Disclosure - Revenue Recognition and Related Balance Sheet Accounts - Composition of the Allowance for Credit Losses (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/RevenueRecognitionandRelatedBalanceSheetAccountsCompositionoftheAllowanceforCreditLossesDetails</Role>
      <ShortName>Revenue Recognition and Related Balance Sheet Accounts - Composition of the Allowance for Credit Losses (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>39</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>9955527 - Disclosure - Segment Information - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/SegmentInformationNarrativeDetails</Role>
      <ShortName>Segment Information - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>40</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>9955528 - Disclosure - Segment Information - Summarized Financial Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/SegmentInformationSummarizedFinancialInformationDetails</Role>
      <ShortName>Segment Information - Summarized Financial Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>41</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>9955529 - Disclosure - Acquisitions - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/AcquisitionsNarrativeDetails</Role>
      <ShortName>Acquisitions - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>42</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>9955530 - Disclosure - Acquisitions - Aggregate Fair Values of Outstanding Contingent Consideration Liabilities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/AcquisitionsAggregateFairValuesofOutstandingContingentConsiderationLiabilitiesDetails</Role>
      <ShortName>Acquisitions - Aggregate Fair Values of Outstanding Contingent Consideration Liabilities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>9955531 - Disclosure - Acquisitions - Unaudited Supplemental Pro Forma Results of Operations (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/AcquisitionsUnauditedSupplementalProFormaResultsofOperationsDetails</Role>
      <ShortName>Acquisitions - Unaudited Supplemental Pro Forma Results of Operations (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>44</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>9955532 - Disclosure - Acquisitions - Increase From Acquisitions By Year (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/AcquisitionsIncreaseFromAcquisitionsByYearDetails</Role>
      <ShortName>Acquisitions - Increase From Acquisitions By Year (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>45</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>9955533 - Disclosure - Investments in Affiliates and Other Entities - Equity Investments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/InvestmentsinAffiliatesandOtherEntitiesEquityInvestmentsDetails</Role>
      <ShortName>Investments in Affiliates and Other Entities - Equity Investments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>46</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>9955534 - Disclosure - Investments in Affiliates and Other Entities - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/InvestmentsinAffiliatesandOtherEntitiesNarrativeDetails</Role>
      <ShortName>Investments in Affiliates and Other Entities - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>47</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>9955535 - Disclosure - Per Share Information - Basic and Diluted Earnings Per Share Attributable to Common Stock (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/PerShareInformationBasicandDilutedEarningsPerShareAttributabletoCommonStockDetails</Role>
      <ShortName>Per Share Information - Basic and Diluted Earnings Per Share Attributable to Common Stock (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>48</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>9955536 - Disclosure - Debt Obligations - Long-term Debt Obligations (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/DebtObligationsLongtermDebtObligationsDetails</Role>
      <ShortName>Debt Obligations - Long-term Debt Obligations (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>49</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>9955537 - Disclosure - Debt Obligations - Senior Notes Narrative (Details)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://quantaservices.com/role/DebtObligationsSeniorNotesNarrativeDetails</Role>
      <ShortName>Debt Obligations - Senior Notes Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>50</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>9955538 - Disclosure - Debt Obligations - Senior Notes (Details)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://quantaservices.com/role/DebtObligationsSeniorNotesDetails</Role>
      <ShortName>Debt Obligations - Senior Notes (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>51</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>9955539 - Disclosure - Debt Obligations - Senior Credit Facility Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/DebtObligationsSeniorCreditFacilityNarrativeDetails</Role>
      <ShortName>Debt Obligations - Senior Credit Facility Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>52</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>9955540 - Disclosure - Debt Obligations - Senior Credit Facility and Commercial Paper Program Schedule (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/DebtObligationsSeniorCreditFacilityandCommercialPaperProgramScheduleDetails</Role>
      <ShortName>Debt Obligations - Senior Credit Facility and Commercial Paper Program Schedule (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>53</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>9955541 - Disclosure - Debt Obligations - Commercial Paper Program and Additional Letters of Credit Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/DebtObligationsCommercialPaperProgramandAdditionalLettersofCreditNarrativeDetails</Role>
      <ShortName>Debt Obligations - Commercial Paper Program and Additional Letters of Credit Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>54</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>9955542 - Disclosure - Income Taxes (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/IncomeTaxesDetails</Role>
      <ShortName>Income Taxes (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://quantaservices.com/role/IncomeTaxes</ParentRole>
      <Position>55</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R56.htm</HtmlFileName>
      <LongName>9955543 - Disclosure - Equity - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/EquityNarrativeDetails</Role>
      <ShortName>Equity - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>56</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R57.htm</HtmlFileName>
      <LongName>9955544 - Disclosure - Equity - Dividends (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/EquityDividendsDetails</Role>
      <ShortName>Equity - Dividends (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>57</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R58.htm</HtmlFileName>
      <LongName>9955545 - Disclosure - Stock-Based Compensation - Summary of PSUs and RSUs to be Settled in Common Stock Activity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/StockBasedCompensationSummaryofPSUsandRSUstobeSettledinCommonStockActivityDetails</Role>
      <ShortName>Stock-Based Compensation - Summary of PSUs and RSUs to be Settled in Common Stock Activity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>58</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R59.htm</HtmlFileName>
      <LongName>9955546 - Disclosure - Stock-Based Compensation - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/StockBasedCompensationAdditionalInformationDetails</Role>
      <ShortName>Stock-Based Compensation - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>59</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R60.htm</HtmlFileName>
      <LongName>9955547 - Disclosure - Stock-Based Compensation - Grant Date Fair Value for Awards of Performance Units Inputs (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/StockBasedCompensationGrantDateFairValueforAwardsofPerformanceUnitsInputsDetails</Role>
      <ShortName>Stock-Based Compensation - Grant Date Fair Value for Awards of Performance Units Inputs (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>60</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R61.htm</HtmlFileName>
      <LongName>9955548 - Disclosure - Employee Benefit Plans - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/EmployeeBenefitPlansNarrativeDetails</Role>
      <ShortName>Employee Benefit Plans - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>61</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R62.htm</HtmlFileName>
      <LongName>9955549 - Disclosure - Employee Benefit Plans - Schedule of Fair Market Value (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/EmployeeBenefitPlansScheduleofFairMarketValueDetails</Role>
      <ShortName>Employee Benefit Plans - Schedule of Fair Market Value (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>62</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R63.htm</HtmlFileName>
      <LongName>9955550 - Disclosure - Commitments and Contingencies - Silverado Wildfire Matter (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/CommitmentsandContingenciesSilveradoWildfireMatterDetails</Role>
      <ShortName>Commitments and Contingencies - Silverado Wildfire Matter (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>63</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R64.htm</HtmlFileName>
      <LongName>9955551 - Disclosure - Commitments and Contingencies - Insurance (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/CommitmentsandContingenciesInsuranceDetails</Role>
      <ShortName>Commitments and Contingencies - Insurance (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>64</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R65.htm</HtmlFileName>
      <LongName>9955552 - Disclosure - Commitments and Contingencies - Bonds (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/CommitmentsandContingenciesBondsDetails</Role>
      <ShortName>Commitments and Contingencies - Bonds (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>65</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R66.htm</HtmlFileName>
      <LongName>9955553 - Disclosure - Detail of Certain Accounts - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/DetailofCertainAccountsAdditionalInformationDetails</Role>
      <ShortName>Detail of Certain Accounts - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>66</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R67.htm</HtmlFileName>
      <LongName>9955554 - Disclosure - Detail of Certain Accounts - Cash and Cash Equivalents (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/DetailofCertainAccountsCashandCashEquivalentsDetails</Role>
      <ShortName>Detail of Certain Accounts - Cash and Cash Equivalents (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>67</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R68.htm</HtmlFileName>
      <LongName>9955555 - Disclosure - Detail of Certain Accounts - Inventories (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/DetailofCertainAccountsInventoriesDetails</Role>
      <ShortName>Detail of Certain Accounts - Inventories (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>68</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R69.htm</HtmlFileName>
      <LongName>9955556 - Disclosure - Detail of Certain Accounts - Prepaid Expenses (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/DetailofCertainAccountsPrepaidExpensesDetails</Role>
      <ShortName>Detail of Certain Accounts - Prepaid Expenses (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>69</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R70.htm</HtmlFileName>
      <LongName>9955557 - Disclosure - Detail of Certain Accounts - Intangible Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/DetailofCertainAccountsIntangibleAssetsDetails</Role>
      <ShortName>Detail of Certain Accounts - Intangible Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>70</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R71.htm</HtmlFileName>
      <LongName>9955558 - Disclosure - Detail of Certain Accounts - Accounts Payable and Accrued Expenses (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/DetailofCertainAccountsAccountsPayableandAccruedExpensesDetails</Role>
      <ShortName>Detail of Certain Accounts - Accounts Payable and Accrued Expenses (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>71</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R72.htm</HtmlFileName>
      <LongName>9955559 - Disclosure - Supplemental Cash Flow Information - Reconciliation of Cash, Cash Equivalents, and Restricted Cash (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/SupplementalCashFlowInformationReconciliationofCashCashEquivalentsandRestrictedCashDetails</Role>
      <ShortName>Supplemental Cash Flow Information - Reconciliation of Cash, Cash Equivalents, and Restricted Cash (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>72</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R73.htm</HtmlFileName>
      <LongName>9955560 - Disclosure - Supplemental Cash Flow Information - Interest Paid (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/SupplementalCashFlowInformationInterestPaidDetails</Role>
      <ShortName>Supplemental Cash Flow Information - Interest Paid (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>73</Position>
    </Report>
    <Report instance="pwr-20260331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R74.htm</HtmlFileName>
      <LongName>9955561 - Disclosure - Supplemental Cash Flow Information - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://quantaservices.com/role/SupplementalCashFlowInformationNarrativeDetails</Role>
      <ShortName>Supplemental Cash Flow Information - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>74</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <InputFiles>
    <File doctype="10-Q" isDefinitelyFs="true" isUsgaap="true" original="pwr-20260331.htm">pwr-20260331.htm</File>
    <File>pwr-20260331.xsd</File>
    <File>pwr-20260331_cal.xml</File>
    <File>pwr-20260331_def.xml</File>
    <File>pwr-20260331_lab.xml</File>
    <File>pwr-20260331_pre.xml</File>
  </InputFiles>
  <SupplementalFiles>
    <File>pwr-20260331_g1.jpg</File>
  </SupplementalFiles>
  <BaseTaxonomies>
    <BaseTaxonomy items="1">http://fasb.org/srt/2025</BaseTaxonomy>
    <BaseTaxonomy items="666">http://fasb.org/us-gaap/2025</BaseTaxonomy>
    <BaseTaxonomy items="29">http://xbrl.sec.gov/dei/2025</BaseTaxonomy>
    <BaseTaxonomy items="4">http://xbrl.sec.gov/ecd/2025</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
