Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build for Qt 5.15 #11

Merged
merged 2 commits into from
Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/abteilungsliste.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define ABTEILUNGSLISTE_H

#include <QDateTime>
#include <QSet>
class QColor;

// nicht als Vorwärtsdeklarationen möglich
Expand Down
2 changes: 1 addition & 1 deletion src/findkontodialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void FindKontoDialog::createWidgets()

valueChoose = new QComboBox(this);
valueChoose->setEditable(true);
valueChoose->setAutoCompletion(false);
valueChoose->setCompleter(NULL);
valueChoose->setFocus();
valueChoose->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon);
valueChoose->setMinimumContentsLength(40);
Expand Down
2 changes: 1 addition & 1 deletion src/kontotreeitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void KontoTreeItem::setBgColor(const QColor bgColor)
m_bgColor = bgColor;
for( int i=0; i<NUM_COLUMNS; i++ )
{
setBackgroundColor(i, bgColor);
setBackground(i, QBrush(bgColor));
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/lock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <fcntl.h> // (_)O_RDWR

#ifdef WIN32
#include <Windows.h>
#include <windows.h>
#include <io.h>

#else // !WIN32
Expand Down Expand Up @@ -81,7 +81,7 @@ bool Lock::check() {
}

#ifdef WIN32
LockLocal::LockLocal(const QString& name, bool user):path((user ? "Local\\" : "Global\\" ) + name),name(name),user(user) {}
LockLocal::LockLocal(const QString& name, bool user):user(user),name(name),path((user ? "Local\\" : "Global\\" ) + name) {}

bool LockLocal::_acquire() {
handle = CreateEventA(NULL, false, true, name.toLocal8Bit());
Expand Down
2 changes: 1 addition & 1 deletion src/sctime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ int main(int argc, char **argv ) {
fatal(QObject::tr("sctime: Configuration problem"),
QObject::tr("Cannot access configration directory %1.").arg(configdirstring));
}
configDir=directory.path();
configDir.setPath(directory.path());

if (!zeitkontenfile.isEmpty())
zeitkontenfile=absolutePath(zeitkontenfile);
Expand Down
2 changes: 1 addition & 1 deletion src/sctimexmlsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ void SCTimeXMLSettings::writeSettings(bool global, AbteilungsListe* abtList)

QString SCTimeXMLSettings::color2str(const QColor& color)
{
return QString().sprintf("#%.2x%.2x%.2x",color.red(),color.green(),color.blue());
return QString("#%1%2%3").arg(color.red(),2,16,QChar('0')).arg(color.green(),2,16,QChar('0')).arg(color.blue(),2,16,QChar('0'));
}

QColor SCTimeXMLSettings::str2color(const QString& str)
Expand Down
1 change: 1 addition & 0 deletions src/specialremunerationsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "specialremunerationsdialog.h"
#include <QDialog>
#include <QMessageBox>
#include "specialremuntypemap.h"
#include "abteilungsliste.h"
#include "unterkontoliste.h"
Expand Down
2 changes: 1 addition & 1 deletion src/src.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CONFIG += c++11
# you have to explicitly recompile sctime.cpp whenever you change this value
VERSION = 1.2.1
CONFIG += precompile_header
PRECOMPILED_HEADER = stable.h # LANG=C LC_CTYPE=C grep -h "#include <Q" *{,/*}.{cpp,h} | sort | uniq > stable.h
# PRECOMPILED_HEADER = stable.h # LANG=C LC_CTYPE=C grep -h "#include <Q" *{,/*}.{cpp,h} | sort | uniq > stable.h
DEFINES += APP_VERSION=$$VERSION
QT += xml gui core network sql widgets
TARGET = sctime
Expand Down
1 change: 1 addition & 0 deletions src/statusbar.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <QStatusBar>
#include <QLabel>
#include <QDateTime>
#include <QSet>
#include "timecounter.h"

/** The status bar of the main window */
Expand Down
4 changes: 1 addition & 3 deletions src/timecounter.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ class TimeCounter {

QString toString()
{
QString qs;

return qs.sprintf("%2i:%.2i ",seconds/3600, (seconds%3600)/60);
return QString("%1:%2 ").arg(seconds/3600,2).arg((seconds%3600)/60,2,10,QChar('0'));
}

static TimeCounter fromString(QString str)
Expand Down
1 change: 1 addition & 0 deletions src/timemainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <QTextBrowser>
#include <QAction>
#include <QMutex>
#include <QDesktopWidget>

#include "globals.h"
#include "time.h"
Expand Down