Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. International
  3. Spanish
  4. Se puede pasar una lista completa del dialog al mainwindow????
Qt 6.12 LTS is out! See what's new in the release blog

Se puede pasar una lista completa del dialog al mainwindow????

Scheduled Pinned Locked Moved Unsolved Spanish
2 Posts 2 Posters 1.0k Views
  • 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.
  • C Offline
    C Offline
    Casino
    wrote on last edited by
    #1

    En el caso de que se pudiera, cual es la forma???

    JonBJ 1 Reply Last reply
    0
    • C Casino

      En el caso de que se pudiera, cual es la forma???

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Casino

      class ADialog : public QDialog
      {
      private:
          QStringList _stringList;
          // In ui->...
              QListWidget *listWidget;
      public:
          QStringList stringList() const { return _stringList; }
          QStringList widgetStringList() const
          {
              QStringList stringList;
              for (const QListWidgetItem &item : ui->listWidget->selectedItems())
                  stringList.append(item.text());
              return stringList;
          }
      }
      
      // In main window
      ADialog aDialog;
      if (aDialog.exec())
      {
          qDebug() << aDialog.stringList();
          qDebug() << aDialog.widgetStringList();
      }
      
      1 Reply Last reply
      0
      • SGaistS SGaist moved this topic from General and Desktop on

      • Login

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