Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
KWordQuiz
Commits
c691c6be
Commit
c691c6be
authored
Sep 03, 2021
by
Laurent Montel
😁
Browse files
Use Q_EMIT/Q_SLOTS/Q_SIGNALS
parent
2e60dd3f
Changes
27
Hide whitespace changes
Inline
Side-by-side
src/dlgspecchar.cpp
View file @
c691c6be
...
...
@@ -67,12 +67,12 @@ QChar DlgSpecChar::chr()
void
DlgSpecChar
::
slotDoubleClicked
()
{
emit
insertChar
(
chr
());
Q_EMIT
insertChar
(
chr
());
closeDialog
();
}
void
DlgSpecChar
::
slotUser1
(
)
{
emit
insertChar
(
chr
());
Q_EMIT
insertChar
(
chr
());
closeDialog
();
}
src/dlgspecchar.h
View file @
c691c6be
...
...
@@ -32,10 +32,10 @@ public:
explicit
DlgSpecChar
(
QWidget
*
parent
,
const
QFont
&
font
,
const
QChar
&
chr
);
void
closeDialog
();
signals
:
Q_SIGNALS
:
void
insertChar
(
QChar
);
private
slots
:
private
Q_SLOTS
:
void
slotUser1
();
void
slotDoubleClicked
();
...
...
src/flashview.h
View file @
c691c6be
...
...
@@ -38,10 +38,10 @@ public:
void
init
()
override
;
private
slots
:
private
Q_SLOTS
:
void
slotTimer
();
public
slots
:
public
Q_SLOTS
:
void
slotCheck
()
override
;
void
slotKnow
();
void
slotDontKnow
();
...
...
src/kwordquiz.cpp
View file @
c691c6be
...
...
@@ -1296,7 +1296,7 @@ void KWordQuizApp::slotApplyPreferences()
editUnmarkBlank
->
setEnabled
(
Prefs
::
enableBlanks
());
m_tableView
->
reset
();
updateSpecialCharIcons
();
emit
settingsChanged
();
Q_EMIT
settingsChanged
();
}
void
KWordQuizApp
::
updateSpecialCharIcons
()
...
...
src/kwordquiz.h
View file @
c691c6be
...
...
@@ -130,10 +130,10 @@ class KWordQuizApp : public KXmlGuiWindow
*/
void
readProperties
(
const
KConfigGroup
&
_cfg
)
override
;
signals
:
Q_SIGNALS
:
void
settingsChanged
();
public
slots
:
public
Q_SLOTS
:
/** open a new application window by creating a new instance of KWordQuizApp */
void
slotFileNew
();
/** open a file and load it into the document*/
...
...
src/kwordquizprefs.cpp
View file @
c691c6be
...
...
@@ -62,7 +62,7 @@ bool KWordQuizPrefs::isDefault()
void
KWordQuizPrefs
::
updateSettings
(
)
{
m_prefCharacter
->
updateSettings
();
emit
settingsChanged
(
QLatin1String
(
""
));
Q_EMIT
settingsChanged
(
QLatin1String
(
""
));
}
void
KWordQuizPrefs
::
updateWidgetsDefault
()
...
...
src/kwordquizprefs.h
View file @
c691c6be
...
...
@@ -38,7 +38,7 @@ class KWordQuizPrefs : public KConfigDialog
public:
KWordQuizPrefs
(
QWidget
*
parent
,
const
QString
&
name
,
KConfigSkeleton
*
config
,
KActionCollection
*
actionCollection
);
protected
slots
:
protected
Q_SLOTS
:
void
updateSettings
()
override
;
void
updateWidgetsDefault
()
override
;
...
...
src/kwqcardscene.cpp
View file @
c691c6be
...
...
@@ -150,6 +150,6 @@ void KWQCardScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent)
{
QGraphicsItem
*
item
=
itemAt
(
mouseEvent
->
scenePos
(),
QTransform
());
if
(
item
!=
0
)
emit
cardClicked
();
Q_EMIT
cardClicked
();
QGraphicsScene
::
mouseReleaseEvent
(
mouseEvent
);
}
src/kwqcardscene.h
View file @
c691c6be
...
...
@@ -47,7 +47,7 @@ public:
void
setFrameColor
(
const
QColor
&
);
void
setImage
(
const
QPixmap
&
);
signals
:
Q_SIGNALS
:
void
cardClicked
();
protected:
...
...
src/kwqcardview.h
View file @
c691c6be
...
...
@@ -40,7 +40,7 @@ public:
void
setFrameColor
(
const
QColor
&
);
void
setImage
(
const
QPixmap
&
);
signals
:
Q_SIGNALS
:
void
cardClicked
();
protected:
...
...
src/kwqcleardialog.h
View file @
c691c6be
...
...
@@ -30,10 +30,10 @@ class KWQClearDialog : public QDialog, private Ui::ClearDialogBase {
public:
explicit
KWQClearDialog
(
QWidget
*
parent
=
nullptr
);
public
slots
:
public
Q_SLOTS
:
void
accept
()
override
;
private
slots
:
private
Q_SLOTS
:
void
buttonGroupChanged
(
int
);
private:
...
...
src/kwqquizmodel.cpp
View file @
c691c6be
...
...
@@ -335,9 +335,9 @@ QString KWQQuizModel::question()
}
if
(
m_quizType
!=
Prefs
::
EnumStartSession
::
Flashcard
&&
m_currentQuestion
>
0
)
emit
checkingAnswer
(
m_list
.
at
(
m_currentQuestion
-
1
));
Q_EMIT
checkingAnswer
(
m_list
.
at
(
m_currentQuestion
-
1
));
else
emit
checkingAnswer
(
row
);
Q_EMIT
checkingAnswer
(
row
);
return
s
;
}
...
...
@@ -487,7 +487,7 @@ int KWQQuizModel::questionCount()
void
KWQQuizModel
::
finish
()
{
emit
checkingAnswer
(
-
1
);
Q_EMIT
checkingAnswer
(
-
1
);
}
...
...
src/kwqquizmodel.h
View file @
c691c6be
...
...
@@ -79,7 +79,7 @@ public:
QList
<
int
>
errorList
()
const
{
return
m_errorList
;}
void
removeLastError
();
signals
:
Q_SIGNALS
:
void
checkingAnswer
(
int
);
protected:
...
...
src/kwqquizview.h
View file @
c691c6be
...
...
@@ -45,7 +45,7 @@ class KWQQuizView : public QWidget
void
setQuiz
(
KWQQuizModel
*
quiz
);
virtual
void
init
()
=
0
;
public
slots
:
public
Q_SLOTS
:
virtual
void
slotCheck
()
=
0
;
virtual
void
slotApplySettings
()
=
0
;
void
slotRepeat
();
...
...
src/kwqsortfiltermodel.h
View file @
c691c6be
...
...
@@ -36,7 +36,7 @@ class KWQSortFilterModel : public QSortFilterProxyModel
void
setTableModel
(
KWQTableModel
*
sourceModel
);
KWQTableModel
*
sourceModel
()
const
;
public
slots
:
public
Q_SLOTS
:
void
restoreNativeOrder
();
void
shuffle
();
...
...
src/kwqtabledelegate.cpp
View file @
c691c6be
...
...
@@ -62,8 +62,8 @@ void KWQTableDelegate::commitAndCloseEditor()
{
QWidget
*
editor
=
qobject_cast
<
QWidget
*>
(
sender
());
emit
commitData
(
editor
);
emit
closeEditor
(
editor
,
QAbstractItemDelegate
::
NoHint
);
Q_EMIT
commitData
(
editor
);
Q_EMIT
closeEditor
(
editor
,
QAbstractItemDelegate
::
NoHint
);
}
void
KWQTableDelegate
::
drawDecoration
(
QPainter
*
painter
,
const
QStyleOptionViewItem
&
option
,
const
QRect
&
rect
,
const
QPixmap
&
pixmap
)
const
...
...
src/kwqtabledelegate.h
View file @
c691c6be
...
...
@@ -45,7 +45,7 @@ class KWQTableDelegate : public QItemDelegate
void
drawFocus
(
QPainter
*
painter
,
const
QStyleOptionViewItem
&
option
,
const
QRect
&
rect
)
const
override
;
void
drawDecoration
(
QPainter
*
painter
,
const
QStyleOptionViewItem
&
option
,
const
QRect
&
rect
,
const
QPixmap
&
pixmap
)
const
override
;
private
slots
:
private
Q_SLOTS
:
void
commitAndCloseEditor
();
};
...
...
src/kwqtablemodel.cpp
View file @
c691c6be
...
...
@@ -142,7 +142,7 @@ bool KWQTableModel::setData(const QModelIndex & index, const QVariant & value, i
break
;
}
emit
dataChanged
(
index
,
index
);
Q_EMIT
dataChanged
(
index
,
index
);
return
true
;
}
...
...
@@ -168,7 +168,7 @@ bool KWQTableModel::setHeaderData(int section, Qt::Orientation orientation, cons
documentSettings
.
save
();
}
emit
headerDataChanged
(
orientation
,
section
,
section
);
Q_EMIT
headerDataChanged
(
orientation
,
section
,
section
);
return
true
;
}
return
false
;
...
...
src/kwqtableview.h
View file @
c691c6be
...
...
@@ -65,7 +65,7 @@ protected:
void
keyPressEvent
(
QKeyEvent
*
)
override
;
void
updateKeyboardLayout
();
public
slots
:
public
Q_SLOTS
:
void
adjustRow
(
int
);
void
slotSpecChar
(
const
QChar
&
);
void
slotCheckedAnswer
(
int
);
...
...
@@ -74,7 +74,7 @@ public slots:
void
slotHeaderClicked
(
int
);
void
slotSortByColumn
(
int
);
protected
slots
:
protected
Q_SLOTS
:
void
closeEditor
(
QWidget
*
editor
,
QAbstractItemDelegate
::
EndEditHint
hint
)
override
;
void
commitData
(
QWidget
*
editor
)
override
;
void
verticalHeaderResized
(
int
,
int
,
int
);
...
...
src/kwqtutor.h
View file @
c691c6be
...
...
@@ -34,7 +34,7 @@ class KWQTutor : public KStatusNotifierItem
/* init systray icon, meny, actions */
explicit
KWQTutor
(
const
QUrl
&
fileToOpen
,
QWidget
*
parent
=
nullptr
);
public
slots
:
public
Q_SLOTS
:
/* self-calling function: it sets the time interval,calls itself and call func to display flashcard*/
void
updateTimer
();
/*open keduvocdocument from the menu */
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment