If the court declares a person convicted of a sexual offence against a child under 17 incapable of controlling their sexual instincts, they can be detained at "Her Majesty's pleasure".

The only redress is for two more doctors to find the situation has changed.

The men, who pleaded guilty to multiple child sex offences in 1984, argued the law was unconstitutional because it interfered with the independence of the court.

But in an unanimous decision today, the High Court upheld the law, saying the court does have discretion about whether it applies.

No moves to give Government power to detain offenders indefinitely

Meanwhile, Queensland Premier Campbell Newman said Cabinet had not considered a radical proposal that would allow the Attorney-General to indefinitely detain dangerous sex offenders under similar laws to the Mental Health Act.

In December, the Court of Appeal ruled as invalid the Attorney-General Jarrod Bleijie's law that allowed him to bypass the courts to detain an offender after their sentence had expired.

Just days later, one of Queensland's top barristers, Tony Morris QC, drafted his own legislation and emailed it to Mr Bleijie, advising him on how to ensure his dangerous sex offender laws survived.

Mr Morris' solution would usher in a "new civil regime" and the classification of "recidivous sexual predator" by the Attorney-General.

He said it was based on the process that allowed people with mental illnesses to be detained when they were a danger to themselves or others.

Mr Newman said it was never considered by Cabinet.

"I'm very happy we have worked very hard to protect our kids the gave strong laws to protect families and we have never considered that not even an informal decision in Cabinet," he said.