Queensland has passed legal changes to prevent Pineapple Hooper from becoming a mayor.

Queensland Parliament has passed amendments to the electoral act that retrospectively apply to Chris “Pineapple” Hooper, the would-be mayor of Rockhampton.

Former Rockhampton mayor Margaret Strelow resigned in November. This was just two weeks after new laws came into effect that made Mr Hooper — as runner-up — the new mayor. Mr Hooper had won 30 per cent of the vote.

Mr Hooper should have been sworn in as Rockhampton’s new mayor, but a council meeting refused to ratify him.

Now, extraordinary amendments passed in State Parliament render invalid any actions Mr Hooper would have made as mayor.

“It's pretty amazing how it all came about,” Mr Hooper said this week.

“I'm like that accidental [Olympic medallist Steven Bradbury] … who won the ice-skating gold medal — sort of like that.”

The Opposition did not oppose the change but slammed the Queensland Government's handling of the matter.

“It is refreshing to see those opposite admitting fault, and rectifying their mistake,” LNP Member for Lockyer Jim McDonald said.

“These runner-up laws opened the way for the elevation of undesirable candidates to high office against the desire of the community.”

Assistant Minister for Local Government Nikki Boyd said the changes were not specifically about Rockhampton, but were made because; “Communities should have faith and trust in the democratic process”.