Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Italian
  4. Centrare testo su QTableWidgetItem
Qt 6.11 is out! See what's new in the release blog

Centrare testo su QTableWidgetItem

Scheduled Pinned Locked Moved Unsolved Italian
3 Posts 3 Posters 583 Views 2 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.
  • S Offline
    S Offline
    Stefanoxjx
    wrote on last edited by
    #1

    Ciao a tutti,
    ho una QTAbleWidget sulla quale ho inserite un QTableWidgetItem come segue:

    ui->tableData->setItem(riga++, 1, new QTableWidgetItem (lang.at(ConfigData.at(32))));
    

    tableData è il QTableWidget.
    Vorrei che il dato (lang.at(ConfigData...) venisse centrato nella cella.
    Ho fatto un po' di ricerche, ma ho trovato soluzione che purtroppo ancora non riesco a comprendere.
    Qualche consiglio?
    Grazie.

    Stefano

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      https://forum.qt.io/topic/108137/text-alignment-on-qtablewidgetitem/

      1 Reply Last reply
      2
      • V Offline
        V Offline
        Vittus
        wrote on last edited by
        #3

        Hai provato con questo?

        ui->tableData->setItem(riga++, 1, new QTableWidgetItem (lang.at(ConfigData.at(32))));
        ui->tableData->item(riga++, 1)->setTextAlignment(Qt::AlignCenter);

        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