PDA

View Full Version : Warnings concerning private slots with Qt Jambi



kiker99
1st February 2007, 22:28
Hello,

I get a warning from the java compiler if there is a private function, whose only invocations go the signal-slot way, like this:


public Mainwindow() {
...
m_ui.actionHinzuf_gen_2.triggered.connect(this, "addCategory()");
...
}

private void addCategory() {
AddCategoryWidget acw=new AddCategoryWidget(this);
m_layoutManager.showWidget(acw);
}



The method addCategory() from the type Mainwindow is never used locally


Is there another possibility to getting rid of this warning than to disable all warnings of this type or to making the function protected?

best regards,
kiker99

alansmithee
9th February 2007, 15:21
You can throw a

@SuppressWarnings("unused")

annotation on the unused private function. That should kill your warning.