Hi,
I've got a problem with compilation of my program. beneath I wrote file nowywpis.cpp with header- I have problem with proper use of function connect . After adding it my program to after compiling gives a result -107374181 instead of 0.
Thanks for your help:
nowywpis.h
#ifndef NOWYWPIS_H
#define NOWYWPIS_H
#include <QWidget>
#include <QLabel>
QT_BEGIN_NAMESPACE
QT_END_NAMESPACE
extern QMap<QString, QString> al;
extern QList<QString> Lista; //QMap and QList are made in another file
{
Q_OBJECT
public:
private slots:
void Aktual();
private:
void Wybor ();
void Dane ();
};
#endif // NOWYWPIS_H
#ifndef NOWYWPIS_H
#define NOWYWPIS_H
#include <QWidget>
#include <QLabel>
QT_BEGIN_NAMESPACE
class QGroupBox;
class QComboBox;
QT_END_NAMESPACE
extern QMap<QString, QString> al;
extern QList<QString> Lista; //QMap and QList are made in another file
class NowyWpis : public QWidget
{
Q_OBJECT
public:
NowyWpis(QWidget *parent = 0);
private slots:
void Aktual();
private:
void Wybor ();
void Dane ();
QGroupBox *wybortr;
QComboBox *wybierz;
QLabel *ikona;
QString wybrany;
};
#endif // NOWYWPIS_H
To copy to clipboard, switch view to plain text mode
nowywpis.cpp
#include <QtGui>
#include "nowywpis.h"
NowyWpis
::NowyWpis(QWidget *parent
){
Wybor ();
Layout->addWidget(wybortr);
setLayout(Layout);
setWindowTitle(tr("Dodaj "));
resize(800, 600);
}
void NowyWpis::Wybor ()
{
extern void wypisz ();
wypisz ();
{
wybierz->addItem(k);
}
connect(wybierz, SIGNAL(currentIndexChanged(int)),
this, SLOT(Aktual()));
grid->addWidget(wybierz, 0, 0);
grid->addWidget(ikona, 0, 1);
wybortr->setLayout(grid);
}
void NowyWpis::Aktual ()
{
wybrany =(wybierz->currentText());
ikona->setAlignment(Qt::AlignBottom | Qt::AlignRight);
ikona
->setPixmap
(QPixmap("Obrazy/+wybrany+"asd.
png"));}
#include <QtGui>
#include "nowywpis.h"
NowyWpis::NowyWpis(QWidget *parent)
: QWidget(parent)
{
Wybor ();
QVBoxLayout *Layout = new QVBoxLayout;
Layout->addWidget(wybortr);
setLayout(Layout);
setWindowTitle(tr("Dodaj "));
resize(800, 600);
}
void NowyWpis::Wybor ()
{
wybortr = new QGroupBox(tr("Wybor "));
QGridLayout *grid = new QGridLayout;
wybierz = new QComboBox;
extern void wypisz ();
wypisz ();
foreach (QString k, Lista)
{
wybierz->addItem(k);
}
connect(wybierz, SIGNAL(currentIndexChanged(int)),
this, SLOT(Aktual()));
grid->addWidget(wybierz, 0, 0);
grid->addWidget(ikona, 0, 1);
wybortr->setLayout(grid);
}
void NowyWpis::Aktual ()
{
wybrany =(wybierz->currentText());
ikona = new QLabel();
ikona->setAlignment(Qt::AlignBottom | Qt::AlignRight);
ikona->setPixmap(QPixmap("Obrazy/+wybrany+"asd.png"));
}
To copy to clipboard, switch view to plain text mode
Bookmarks