Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Polish
  4. Problem z signal i slot
Forum Updated to NodeBB v4.3 + New Features

Problem z signal i slot

Scheduled Pinned Locked Moved Polish
2 Posts 2 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    matx132
    wrote on last edited by
    #1

    Witam,
    Mam zrobiony taki conect:

    @connect(u,
    SIGNAL(requestGreen(const QString,const QString)),
    this,
    SLOT(createGreen(const QString, const QString)));@

    w klasie utilis
    funkcja green

    @void utilis::green(const QString name,const QString p){
    emit requestGreen(name,p);
    }@

    plik utilis.h
    @signals:
    void requestGreen(const QString, const QString);@

    i w main

    @public slots:
    void createGreen(const QString,const QString);@

    Po wywołaniu funkcji green z klasy utilis, program się wyłącza, przy debugowaniu zatrzymuje się przy funkcji w moc

    @void utilis::requestGreen(const QString _t1, const QString _t2)
    {
    void _a[] = { 0, const_cast<void>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
    QMetaObject::activate(this, &staticMetaObject, 0, _a);
    }@

    na linijce:
    @QMetaObject::activate(this, &staticMetaObject, 0, _a);@

    i teraz nie wiem gdzie jest błąd, i czemu tak się dzieje, czy ktoś może pomóc ?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mateczek
      wrote on last edited by
      #2

      slot w funkcji main ??

      Czy to ma prawo działać ?? poza tym w main nie ma wskaźnika this.
      Sygnały i sloty służą do połączenia dwóch obiektów.
      sygnał z obiektu "a" łączymy ze zlotem obiektu "b"

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved