Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Italian
  4. Come usare la clipboard
Forum Updated to NodeBB v4.3 + New Features

Come usare la clipboard

Scheduled Pinned Locked Moved Unsolved Italian
3 Posts 2 Posters 899 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.
  • B Offline
    B Offline
    bvox123
    wrote on 13 Dec 2017, 06:57 last edited by
    #1

    Buongiorno.
    Sto cercando di scrivere dei dati presenti in una QTableWidget nella clipboard per poi poterli trasferire in un foglio di calcolo LibreOffice (sono su Linux). Inserendo dei cout intermedi vedo che la clipboard è popolata, ma se provo ad incollarla sul foglio di calcolo non ho nessun effetto. Cos'è che sbaglio ?
    Ecco lo stralcio della routine:

    void HRnet_0100_QuadroComandi::on_qt5PulsanteCopia_clicked()
    {
      QClipboard *clipboard = QApplication::clipboard();
      stringstream tabella;
      for (int i = 0; i < indtabanalisi; i++) {
          for (int j = 0; j < 3; j++) {
              QString yyy = ui->qt5TabellaAnalisi->item(i,j)->text();
              tabella << yyy.toStdString();
              tabella << " ";
            }
          cout << tabella.str() << endl;
          tabella << "\n";
        }
      clipboard->setText(QString::fromStdString(tabella.str()));
      cout << "Questa è la clipboard : " << endl;
      cout << clipboard->text().toStdString() << endl;
    }
    
    
    1 Reply Last reply
    0
    • V Offline
      V Offline
      VRonin
      wrote on 13 Dec 2017, 10:29 last edited by
      #2

      A pagina 101 di questo libro trovi l'esempio esatto di quello che stai tentando di fare

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bvox123
        wrote on 13 Dec 2017, 10:54 last edited by
        #3

        Molte grazie.

        1 Reply Last reply
        0

        1/3

        13 Dec 2017, 06:57

        • Login

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