Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to receive SIGNAL from ItemWidget ?
Forum Updated to NodeBB v4.3 + New Features

How to receive SIGNAL from ItemWidget ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 598 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.
  • sonichyS Offline
    sonichyS Offline
    sonichy
    wrote on last edited by sonichy
    #1

    I want download of form finished emit signal, the item will move from downloading list to downloaded list in slot.
    But the form was create in slot of dialog accept, slot in slot has no response.
    https://github.com/sonichy/HTYDown

    {
        connect(dialognew,SIGNAL(accepted()),this,SLOT(addnew()));
    }
    
    MainWindow::addnew(){
        Form *form = new Form;
        QListWidgetItem *LWI = new QListWidgetItem(ui->listWidgetDownloading);
        ui->listWidgetDownloading->setItemWidget(LWI,form);
        LWI->setSizeHint(QSize(1200,30));
        ui->listWidgetDownloading->addItem(LWI);
        connect(form,SIGNAL(downloadFinish()),this,SLOT(moveToDownloaded()));
    }
    
    Form::download(QString surl){
        emit downloadFinish();
    }
    

    [Added code tags ~kshegunov]

    https://github.com/sonichy

    kshegunovK 1 Reply Last reply
    0
    • sonichyS sonichy

      I want download of form finished emit signal, the item will move from downloading list to downloaded list in slot.
      But the form was create in slot of dialog accept, slot in slot has no response.
      https://github.com/sonichy/HTYDown

      {
          connect(dialognew,SIGNAL(accepted()),this,SLOT(addnew()));
      }
      
      MainWindow::addnew(){
          Form *form = new Form;
          QListWidgetItem *LWI = new QListWidgetItem(ui->listWidgetDownloading);
          ui->listWidgetDownloading->setItemWidget(LWI,form);
          LWI->setSizeHint(QSize(1200,30));
          ui->listWidgetDownloading->addItem(LWI);
          connect(form,SIGNAL(downloadFinish()),this,SLOT(moveToDownloaded()));
      }
      
      Form::download(QString surl){
          emit downloadFinish();
      }
      

      [Added code tags ~kshegunov]

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      You're making the connection after you emit the signal. By default the connection is done with Qt::AutoConnection, which expands to Qt::DirectConnection in single threaded environment. Additionally, you should move to Qt 5 and its connection syntax.

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      1

      • Login

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