I have the following Count class
[U]count.h[/U]
class Count
{
private:
bool table[19][8];
public:
int start_line,end_line,alarm_lines; start_line,end_line,alarm_lines;
};
[U]count.h[/U]
class Count
{
private:
bool table[19][8];
QString line
public:
int start_line,end_line,alarm_lines; start_line,end_line,alarm_lines;
};
To copy to clipboard, switch view to plain text mode
in MainWindow.cpp
I create new objects "Count number [15]" this way
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "count.h"
Count number[15];
MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "count.h"
Count number[15];
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
To copy to clipboard, switch view to plain text mode
and in one of methods MainWindows I create new Object
void MainWindow::on_actionActionpreview_triggered()
{
preview = new Preview(this);
preview->setModal(true);
preview->exec();
}
void MainWindow::on_actionActionpreview_triggered()
{
preview = new Preview(this);
preview->setModal(true);
preview->exec();
}
To copy to clipboard, switch view to plain text mode
In the method void Preview:n_pushButton_clicked() I would like to change start_line in object number[0]
#include "preview.h"
#include "ui_preview.h"
#include <QDebug>
#include "mainwindow.h"
Preview
::Preview(QWidget *parent
) : ui(new Ui::Preview)
{
ui->setupUi(this);
}
void Preview::on_pushButton_clicked()
{
number[0].start_line = 5;
}
#include "preview.h"
#include "ui_preview.h"
#include <QDebug>
#include "mainwindow.h"
Preview::Preview(QWidget *parent) :
QDialog(parent),
ui(new Ui::Preview)
{
ui->setupUi(this);
}
void Preview::on_pushButton_clicked()
{
number[0].start_line = 5;
}
To copy to clipboard, switch view to plain text mode
but during compilation I have the following error :" 'alarm' was not declared in this scope"
What are the possibilities to change the start line for the number [0] ?
Regards
Artur
Bookmarks