Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Polish
  4. Pobranie danych z komórki w QTableView
Forum Updated to NodeBB v4.3 + New Features

Pobranie danych z komórki w QTableView

Scheduled Pinned Locked Moved Solved Polish
qtableview c++c++pobieranie
2 Posts 2 Posters 1.9k 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.
  • D Offline
    D Offline
    drock
    wrote on last edited by
    #1

    Dzień dobry,
    chciałbym się zapytać jak można pobrać dane z komórki w QTableView ?

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by Chris Kawa
      #2

      Cześć,

      QTableView to klasa widoku. Dane znajdują się w modelu i to z niego je wyciągasz, np.

      QModelIndex komorka = jakisTableView->model()->index(wiersz, kolumna);
      
      QString tekst_komorki = komorka->data().toString();
      QColor  kolor_tekstu  = komorka->data(Qt::ForegroundRole).value<QColor>();
      QFont   font_tekstu   = komorka->data(Qt::FontRole).value<QFont>();
      
      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