Qt Centre Forum FAQ

Here you can find answers to questions about how the board works. Use the links or search box below to find your way around.

My signal/slot connection doesn't work. How do I check what is the reason?

Build your application in debug mode (add CONFIG+=debug into your project file) and make sure you have console support turned on (in Windows you need to add CONFIG+=console to your project file). Then rerun your application. You might get a warning message then like the following one, stating what the problem is:

Object::connect: No such signal QApplication::nonexistantsignal()

My signal/slot connection doesn't work when I use values as signal or slot arguments. Why?

You can't use values in signal-slot connections, so any of these won't work:

QTimer::singleShot( 10000, this, SLOT(doSomething(10))); 
connect(checkbox, SIGNAL(stateChanged(Qt::Checked)), this, SLOT(buttonChecked()));

Instead you have to connect to a custom slot and check the value there:

connect(checkbox, SIGNAL(stateChanged(int)), this, SLOT(buttonStateChanged(int)));
//...
void someClass::buttonStateChanged(int state){
  if(state==Qt::Checked) 
    buttonChecked();
}

My signal/slot connection doesn't work when I use parameter names in SIGNAL() and SLOT() macros. Why?

You can't put parameter names (nor values) inside SIGNAL() and SLOT() macros. This won't work:

connect(tableView, SIGNAL(doubleClicked(const QModelIndex &index)),
        this, SLOT(myTableView_doubleClicked(const QModelIndex &index)));
Instead you should write:
connect(tableView, SIGNAL(doubleClicked(const QModelIndex &)),
        this, SLOT(myTableView_doubleClicked(const QModelIndex &)));

Search FAQ

Select this option if you would like your search to look in the text of FAQ items as well as their titles.

Select an option here to specify how you would like your search query to be treated. 'Any words' will return the most numerous but possibly least relevant results, while 'Complete phrase' will return only results that contain exactly what you are searching for.

Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.