Results 1 to 5 of 5

Thread: connect() problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2012
    Posts
    25
    Thanks
    10

    Default connect() problem

    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

    Qt Code:
    1. #ifndef NOWYWPIS_H
    2. #define NOWYWPIS_H
    3. #include <QWidget>
    4. #include <QLabel>
    5. QT_BEGIN_NAMESPACE
    6. class QGroupBox;
    7. class QComboBox;
    8. QT_END_NAMESPACE
    9. extern QMap<QString, QString> al;
    10. extern QList<QString> Lista; //QMap and QList are made in another file
    11. class NowyWpis : public QWidget
    12. {
    13. Q_OBJECT
    14. public:
    15. NowyWpis(QWidget *parent = 0);
    16. private slots:
    17. void Aktual();
    18. private:
    19. void Wybor ();
    20. void Dane ();
    21. QGroupBox *wybortr;
    22. QComboBox *wybierz;
    23. QLabel *ikona;
    24. QString wybrany;
    25. };
    26. #endif // NOWYWPIS_H
    To copy to clipboard, switch view to plain text mode 


    nowywpis.cpp
    Qt Code:
    1. #include <QtGui>
    2. #include "nowywpis.h"
    3. NowyWpis::NowyWpis(QWidget *parent)
    4. : QWidget(parent)
    5. {
    6. Wybor ();
    7. QVBoxLayout *Layout = new QVBoxLayout;
    8. Layout->addWidget(wybortr);
    9. setLayout(Layout);
    10. setWindowTitle(tr("Dodaj "));
    11. resize(800, 600);
    12. }
    13. void NowyWpis::Wybor ()
    14. {
    15. wybortr = new QGroupBox(tr("Wybor "));
    16. QGridLayout *grid = new QGridLayout;
    17. wybierz = new QComboBox;
    18.  
    19. extern void wypisz ();
    20. wypisz ();
    21. foreach (QString k, Lista)
    22. {
    23. wybierz->addItem(k);
    24. }
    25.  
    26. connect(wybierz, SIGNAL(currentIndexChanged(int)),
    27. this, SLOT(Aktual()));
    28. grid->addWidget(wybierz, 0, 0);
    29. grid->addWidget(ikona, 0, 1);
    30. wybortr->setLayout(grid);
    31. }
    32. void NowyWpis::Aktual ()
    33. {
    34. wybrany =(wybierz->currentText());
    35. ikona = new QLabel();
    36. ikona->setAlignment(Qt::AlignBottom | Qt::AlignRight);
    37. ikona->setPixmap(QPixmap("Obrazy/+wybrany+"asd.png"));
    38. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by Pawello; 1st August 2012 at 11:54.

Similar Threads

  1. Problem with connect
    By Momergil in forum Newbie
    Replies: 8
    Last Post: 29th July 2011, 01:27
  2. connect() problem
    By harmodrew in forum Newbie
    Replies: 14
    Last Post: 5th August 2010, 17:45
  3. Connect Problem
    By nrabara in forum Newbie
    Replies: 3
    Last Post: 4th May 2009, 12:19
  4. connect problem
    By liengen in forum Newbie
    Replies: 2
    Last Post: 22nd October 2008, 16:21
  5. Problem with connect()
    By mrnor3 in forum Qt Programming
    Replies: 3
    Last Post: 23rd July 2008, 14:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.