Note that there are some explanatory texts on larger screens.

plurals
  1. POQt SIGNAL->SLOTS mechanizm
    primarykey
    data
    text
    <p>I have some C++ code with Qt 4 functions:</p> <pre><code>QColorDialog colordialog0(&amp;window0); colordialog0.show(); QPixmap pixmap0(10, 10); QObject::connect(&amp;colordialog0, SIGNAL(colorSelected(const QColor &amp;)), &amp;pixmap0, SLOT(fill(const QColor &amp;))); </code></pre> <p>When I build a project, it compiled with error:</p> <pre><code>error C2665: 'QObject::connect' : none of the 3 overloads could convert all the argument types \qt\include\qtcore\../../src/corelib/kernel/qobject.h(204): could be 'bool QObject::connect(const QObject *,const char *,const QObject *,const char *,Qt::ConnectionType)' \qt\include\qtcore\../../src/corelib/kernel/qobject.h(217): or 'bool QObject::connect(const QObject *,const QMetaMethod &amp;,const QObject *,const QMetaMethod &amp;,Qt::ConnectionType)' \qt\include\qtcore\../../src/corelib/kernel/qobject.h(231): or 'bool QObject::connect(const QObject *,const char *,const char *,Qt::ConnectionType) const' while trying to match the argument list '(QColorDialog *, const char *, QPixmap *, const char *)' </code></pre> <p>I couldn't understand this, because when I compile another code (without Q_OBJECT, moc files and other):</p> <pre><code>QFileDialog filedialog0; filedialog0.show(); QLabel label0(&amp;centralwidget0); QObject::connect(&amp;filedialog0, SIGNAL(fileSelected(const QString &amp;)), &amp;label0, SLOT(setText(const QString &amp;))); </code></pre> <p>it is not errors. I know that reason is in overloaded functions. So, how can I compile (VS2008) with only one func?</p> <p>Thanks.</p> <p>P.S. Sorry for my English.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload