Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Games
KSpaceDuel
Commits
4f18d950
Commit
4f18d950
authored
Apr 25, 2017
by
Andrius Štikonas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port status bar to QStatusBar.
parent
79cc7025
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
18 deletions
+26
-18
defines.h
defines.h
+2
-2
mainview.h
mainview.h
+1
-1
topwidget.cpp
topwidget.cpp
+19
-14
topwidget.h
topwidget.h
+4
-1
No files found.
defines.h
View file @
4f18d950
...
...
@@ -20,8 +20,8 @@
// #include <qnamespace.h>
#define IDS_PAUSE
1
#define IDS_MAIN
2
#define IDS_PAUSE
0
#define IDS_MAIN
1
#define PlayerKeyLeft 0
#define PlayerKeyRight 1
...
...
mainview.h
View file @
4f18d950
...
...
@@ -25,7 +25,7 @@
#include <QWidget>
#include <
kr
andom
s
equence
.h
>
#include <
KR
andom
S
equence>
class
KToggleAction
;
class
KActionCollection
;
class
QGraphicsSimpleTextItem
;
...
...
topwidget.cpp
View file @
4f18d950
...
...
@@ -18,20 +18,20 @@
#include "topwidget.h"
#include <QBoxLayout>
#include <QIcon>
#include <kshortcutsdialog.h>
#include <QStatusBar>
#include <KActionCollection>
#include <KLocalizedString>
#include <kstandardaction.h>
#include <kstandardgameaction.h>
#include <qstatusbar.h>
#include <ktoggleaction.h>
#include <kactioncollection.h>
#include <KShortcutsDialog>
#include <KStandardAction>
#include <KStandardGameAction>
#include <KToggleAction>
#include "mainview.h"
#include "playerinfo.h"
#include <QBoxLayout>
MyTopLevelWidget
::
MyTopLevelWidget
()
{
...
...
@@ -163,9 +163,16 @@ void MyTopLevelWidget::setupActions()
void
MyTopLevelWidget
::
initStatusBar
(
)
{
//QT5 statusBar( )->insertItem(i18n(" paused "),IDS_PAUSE);
//QT5 statusBar( )->insertItem(QLatin1String( " " ),IDS_MAIN ,1);
//QT5 statusBar( )->insertItem(QLatin1String( "" ),42);
for
(
auto
&
label
:
m_statusBarLabel
)
{
label
=
new
QLabel
(
this
);
label
->
setAlignment
(
Qt
::
AlignCenter
);
statusBar
()
->
addWidget
(
label
,
1
);
}
m_statusBarLabel
[
IDS_PAUSE
]
->
setText
(
i18n
(
" paused "
));
m_statusBarLabel
[
IDS_MAIN
]
->
setText
(
QLatin1String
());
m_statusBarLabel
[
2
]
->
setText
(
QLatin1String
());
}
void
MyTopLevelWidget
::
start
()
...
...
@@ -175,7 +182,7 @@ void MyTopLevelWidget::start()
void
MyTopLevelWidget
::
setStatusText
(
const
QString
&
str
,
int
id
)
{
//QT5
statusBar
( )->changeItem
(str
,id
);
m_
statusBar
Label
[
id
]
->
setText
(
str
);
}
void
MyTopLevelWidget
::
keySetup
()
...
...
@@ -183,5 +190,3 @@ void MyTopLevelWidget::keySetup()
playfield
->
pause
();
KShortcutsDialog
::
configure
(
actionCollection
(
),
KShortcutsEditor
::
LetterShortcutsAllowed
,
this
,
true
);
}
topwidget.h
View file @
4f18d950
...
...
@@ -19,10 +19,11 @@
#ifndef __MY_TOP_WIDGET_H
#define __MY_TOP_WIDGET_H
#include <
kx
ml
g
ui
w
indow
.h
>
#include <
KX
ml
G
ui
W
indow>
class
PlayerInfo
;
class
MyMainView
;
class
QLabel
;
class
MyTopLevelWidget
:
public
KXmlGuiWindow
{
...
...
@@ -46,6 +47,8 @@ protected:
private:
PlayerInfo
*
playerinfo
[
2
];
MyMainView
*
playfield
;
QLabel
*
m_statusBarLabel
[
3
];
};
#endif
Write
Preview
Markdown
is supported
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