QtCore: Make more signals private.

Change-Id: Ida190e8b9c1ff47a6f54a5bf68673ab50a2f1bfe
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
Stephen Kelly 2012-10-22 10:59:32 +02:00 committed by The Qt Project
parent 5a9de4c676
commit 2e05a15784
15 changed files with 108 additions and 40 deletions

View File

@ -128,7 +128,7 @@ void QFileSystemWatcherPrivate::_q_fileChanged(const QString &path, bool removed
}
if (removed)
files.removeAll(path);
emit q->fileChanged(path);
emit q->fileChanged(path, QFileSystemWatcher::QPrivateSignal());
}
void QFileSystemWatcherPrivate::_q_directoryChanged(const QString &path, bool removed)
@ -140,7 +140,7 @@ void QFileSystemWatcherPrivate::_q_directoryChanged(const QString &path, bool re
}
if (removed)
directories.removeAll(path);
emit q->directoryChanged(path);
emit q->directoryChanged(path, QFileSystemWatcher::QPrivateSignal());
}

View File

@ -72,8 +72,16 @@ public:
QStringList directories() const;
Q_SIGNALS:
void fileChanged(const QString &path);
void directoryChanged(const QString &path);
void fileChanged(const QString &path
#if !defined(qdoc)
, QPrivateSignal
#endif
);
void directoryChanged(const QString &path
#if !defined(qdoc)
, QPrivateSignal
#endif
);
private:
Q_PRIVATE_SLOT(d_func(), void _q_fileChanged(const QString &path, bool removed))

View File

@ -909,7 +909,7 @@ bool QProcessPrivate::_q_canReadStandardOutput()
emittedReadyRead = false;
}
}
emit q->readyReadStandardOutput();
emit q->readyReadStandardOutput(QProcess::QPrivateSignal());
return didRead;
}
@ -954,7 +954,7 @@ bool QProcessPrivate::_q_canReadStandardError()
emittedReadyRead = false;
}
}
emit q->readyReadStandardError();
emit q->readyReadStandardError(QProcess::QPrivateSignal());
return didRead;
}
@ -1087,7 +1087,7 @@ bool QProcessPrivate::_q_startupNotification()
startupSocketNotifier->setEnabled(false);
if (processStarted()) {
q->setProcessState(QProcess::Running);
emit q->started();
emit q->started(QProcess::QPrivateSignal());
return true;
}
@ -1767,7 +1767,7 @@ void QProcess::setProcessState(ProcessState state)
if (d->processState == state)
return;
d->processState = state;
emit stateChanged(state);
emit stateChanged(state, QPrivateSignal());
}
/*!

View File

@ -210,14 +210,30 @@ public Q_SLOTS:
void kill();
Q_SIGNALS:
void started();
void started(
#if !defined(qdoc)
QPrivateSignal
#endif
);
void finished(int exitCode);
void finished(int exitCode, QProcess::ExitStatus exitStatus);
void error(QProcess::ProcessError error);
void stateChanged(QProcess::ProcessState state);
void stateChanged(QProcess::ProcessState state
#if !defined(qdoc)
, QPrivateSignal
#endif
);
void readyReadStandardOutput();
void readyReadStandardError();
void readyReadStandardOutput(
#if !defined(qdoc)
QPrivateSignal
#endif
);
void readyReadStandardError(
#if !defined(qdoc)
QPrivateSignal
#endif
);
protected:
void setProcessState(ProcessState state);

View File

@ -139,7 +139,7 @@ void QAbstractProxyModel::setSourceModel(QAbstractItemModel *sourceModel)
d->model = QAbstractItemModelPrivate::staticEmptyModel();
}
d->roleNames = d->model->roleNames();
emit sourceModelChanged();
emit sourceModelChanged(QPrivateSignal());
}
}

View File

@ -97,7 +97,11 @@ public:
Qt::DropActions supportedDropActions() const;
Q_SIGNALS:
void sourceModelChanged();
void sourceModelChanged(
#if !defined(qdoc)
QPrivateSignal
#endif
);
protected:
QAbstractProxyModel(QAbstractProxyModelPrivate &, QObject *parent);

View File

@ -164,13 +164,13 @@ QStatePrivate::~QStatePrivate()
void QStatePrivate::emitFinished()
{
Q_Q(QState);
emit q->finished();
emit q->finished(QState::QPrivateSignal());
}
void QStatePrivate::emitPropertiesAssigned()
{
Q_Q(QState);
emit q->propertiesAssigned();
emit q->propertiesAssigned(QState::QPrivateSignal());
}
/*!

View File

@ -100,8 +100,16 @@ public:
#endif
Q_SIGNALS:
void finished();
void propertiesAssigned();
void finished(
#if !defined(qdoc)
QPrivateSignal
#endif
);
void propertiesAssigned(
#if !defined(qdoc)
QPrivateSignal
#endif
);
protected:
void onEntry(QEvent *event);

View File

@ -1408,14 +1408,14 @@ void QStateMachinePrivate::_q_start()
qDebug() << q << ": initial configuration:" << configuration;
#endif
emit q->started();
emit q->started(QStateMachine::QPrivateSignal());
if (stopProcessingReason == Finished) {
// The state machine immediately reached a final state.
processingScheduled = false;
state = NotRunning;
unregisterAllTransitions();
emit q->finished();
emitFinished();
} else {
_q_process();
}
@ -1497,13 +1497,13 @@ void QStateMachinePrivate::_q_process()
state = NotRunning;
cancelAllDelayedEvents();
unregisterAllTransitions();
emit q->finished();
emitFinished();
break;
case Stopped:
state = NotRunning;
cancelAllDelayedEvents();
unregisterAllTransitions();
emit q->stopped();
emit q->stopped(QStateMachine::QPrivateSignal());
break;
}
}

View File

@ -153,8 +153,16 @@ public Q_SLOTS:
void stop();
Q_SIGNALS:
void started();
void stopped();
void started(
#if !defined(qdoc)
QPrivateSignal
#endif
);
void stopped(
#if !defined(qdoc)
QPrivateSignal
#endif
);
protected:
void onEntry(QEvent *event);

View File

@ -58,6 +58,7 @@ class QAbstractEventDispatcher;
#ifndef QT_NO_THREAD
class Q_CORE_EXPORT QThread : public QObject
{
Q_OBJECT
public:
static Qt::HANDLE currentThreadId() Q_DECL_NOTHROW;
static QThread *currentThread();
@ -111,8 +112,16 @@ public:
static void usleep(unsigned long);
Q_SIGNALS:
void started();
void finished();
void started(
#if !defined(qdoc)
QPrivateSignal
#endif
);
void finished(
#if !defined(qdoc)
QPrivateSignal
#endif
);
protected:
virtual void run();
@ -124,7 +133,6 @@ protected:
QThread(QThreadPrivate &dd, QObject *parent = 0);
private:
Q_OBJECT
Q_DECLARE_PRIVATE(QThread)
friend class QCoreApplication;

View File

@ -325,7 +325,7 @@ void *QThreadPrivate::start(void *arg)
#endif
emit thr->started();
emit thr->started(QThread::QPrivateSignal());
#if !defined(Q_OS_LINUX_ANDROID)
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
pthread_testcancel();
@ -348,7 +348,7 @@ void QThreadPrivate::finish(void *arg)
d->priority = QThread::InheritPriority;
void *data = &d->data->tls;
locker.unlock();
emit thr->finished();
emit thr->finished(QThread::QPrivateSignal());
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
QThreadStorageData::finish((void **)data);
locker.relock();

View File

@ -336,7 +336,7 @@ unsigned int __stdcall QT_ENSURE_STACK_ALIGNED_FOR_SSE QThreadPrivate::start(voi
thr->metaObject()->className() : objectName.constData());
#endif
emit thr->started();
emit thr->started(QThread::QPrivateSignal());
QThread::setTerminationEnabled(true);
thr->run();
@ -354,7 +354,7 @@ void QThreadPrivate::finish(void *arg, bool lockAnyway)
d->priority = QThread::InheritPriority;
void **tls_data = reinterpret_cast<void **>(&d->data->tls);
locker.unlock();
emit thr->finished();
emit thr->finished(QThread::QPrivateSignal());
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
QThreadStorageData::finish(tls_data);
locker.relock();

View File

@ -79,7 +79,7 @@ public:
{
Q_Q(QTimeLine);
if (newState != state)
emit q->stateChanged(state = newState);
emit q->stateChanged(state = newState, QTimeLine::QPrivateSignal());
}
void setCurrentTime(int msecs);
@ -126,14 +126,14 @@ void QTimeLinePrivate::setCurrentTime(int msecs)
qDebug() << "QTimeLinePrivate::setCurrentTime: frameForTime" << currentTime << currentFrame;
#endif
if (!qFuzzyCompare(lastValue, q->currentValue()))
emit q->valueChanged(q->currentValue());
emit q->valueChanged(q->currentValue(), QTimeLine::QPrivateSignal());
if (lastFrame != currentFrame) {
const int transitionframe = (direction == QTimeLine::Forward ? endFrame : startFrame);
if (looping && !finished && transitionframe != currentFrame) {
#ifdef QTIMELINE_DEBUG
qDebug() << "QTimeLinePrivate::setCurrentTime: transitionframe";
#endif
emit q->frameChanged(transitionframe);
emit q->frameChanged(transitionframe, QTimeLine::QPrivateSignal());
}
#ifdef QTIMELINE_DEBUG
else {
@ -153,11 +153,11 @@ void QTimeLinePrivate::setCurrentTime(int msecs)
qDebug("QTimeLinePrivate::setCurrentTime: not transitionframe because %s", reason.constData());
}
#endif
emit q->frameChanged(currentFrame);
emit q->frameChanged(currentFrame, QTimeLine::QPrivateSignal());
}
if (finished && state == QTimeLine::Running) {
q->stop();
emit q->finished();
emit q->finished(QTimeLine::QPrivateSignal());
}
}

View File

@ -125,10 +125,26 @@ public Q_SLOTS:
void toggleDirection();
Q_SIGNALS:
void valueChanged(qreal x);
void frameChanged(int);
void stateChanged(QTimeLine::State newState);
void finished();
void valueChanged(qreal x
#if !defined(qdoc)
, QPrivateSignal
#endif
);
void frameChanged(int
#if !defined(qdoc)
, QPrivateSignal
#endif
);
void stateChanged(QTimeLine::State newState
#if !defined(qdoc)
, QPrivateSignal
#endif
);
void finished(
#if !defined(qdoc)
QPrivateSignal
#endif
);
protected:
void timerEvent(QTimerEvent *event);