jimbo
10th March 2019, 12:33
Hello,
Qt Creator 4.8.2
int qty = 6;
QLabel *topLabel[qty], *numLabel[qty];
for( int i = 0; i < qty; i++)
{
topLabel[i] = newQLabel(topLabel[i]);
topLabel[i]->setGeometry(20+(i*108),20,102,67);
topLabel[i]->setFrameStyle(QFrame::StyledPanel|QFrame::Sunken);
topLabel[i]->setLineWidth(4);
numLabel[i] = newQLabel(topLabel[i]);
numLabel[i]->setGeometry(2,86,100,70);
numLabel[i]->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
numLabel[i]->setStyleSheet("QLabel{color:blue;}");
numLabel[i]->setFont(*font);
}
header
#ifndef TEST_H
#define TEST_H
#include <QMainWindow>
class test : public QMainWindow
{
Q_OBJECT
public:
test(QWidget *parent = nullptr);
~test();
private:
void tDelay(int milliSecs);
QList<uint> getList(int maxNum, int minNum, int qty);
};
#endif
pro file
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = test
TEMPLATE = app
SOURCES += main.cpp\
test.cpp
HEADERS += test.h
CONFIG += c++11
warning: variable length arrays are a C99 feature
It compiled without warnings on an earlier version of Qt.
Now the program compiles and runs OK, but with various warnings, this being one of them.
If I turn off clang, all warnings are gone.
Suggestions please.
Regards
Qt Creator 4.8.2
int qty = 6;
QLabel *topLabel[qty], *numLabel[qty];
for( int i = 0; i < qty; i++)
{
topLabel[i] = newQLabel(topLabel[i]);
topLabel[i]->setGeometry(20+(i*108),20,102,67);
topLabel[i]->setFrameStyle(QFrame::StyledPanel|QFrame::Sunken);
topLabel[i]->setLineWidth(4);
numLabel[i] = newQLabel(topLabel[i]);
numLabel[i]->setGeometry(2,86,100,70);
numLabel[i]->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
numLabel[i]->setStyleSheet("QLabel{color:blue;}");
numLabel[i]->setFont(*font);
}
header
#ifndef TEST_H
#define TEST_H
#include <QMainWindow>
class test : public QMainWindow
{
Q_OBJECT
public:
test(QWidget *parent = nullptr);
~test();
private:
void tDelay(int milliSecs);
QList<uint> getList(int maxNum, int minNum, int qty);
};
#endif
pro file
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = test
TEMPLATE = app
SOURCES += main.cpp\
test.cpp
HEADERS += test.h
CONFIG += c++11
warning: variable length arrays are a C99 feature
It compiled without warnings on an earlier version of Qt.
Now the program compiles and runs OK, but with various warnings, this being one of them.
If I turn off clang, all warnings are gone.
Suggestions please.
Regards