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. [SOLVED] Error with QTableViewWidget
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Error with QTableViewWidget

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 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.
  • I Offline
    I Offline
    I-sty
    wrote on last edited by
    #1

    Hi,
    !http://kepfeltoltes.hu/120725/qt4_www.kepfeltoltes.hu_.png(qt)!
    I use @ui->tableWidget->clear ();@ but, my table size is increasing.
    In the FOR I use @ui->tableWidget->insertRow(i);@
    What's the problem?

    Sorry, for my bad English. My first language is Hungarian.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Sam
      wrote on last edited by
      #2

      Its too far to analyse the problem unless you provide some more lines of code.

      1 Reply Last reply
      0
      • JeroentjehomeJ Offline
        JeroentjehomeJ Offline
        Jeroentjehome
        wrote on last edited by
        #3

        Hi there,
        What might be the problem (if you are really using the model/view with the QTableView) is that the model controls all the column and row information. Not the View itself. I think you have the QTableWidget instead.
        The clear() function will not resize the number of rows/columns etc!! Stated in the documentation.

        void QTableWidget::clear () [slot]

        Removes all items in the view. This will also remove all selections. The table dimensions stay the same.
        Use the setColumnCount function to delete any unwanted columns. The used items / widgets in the deleted rows are unallocated automatic in the latest libs of Qt, so don't worry about memory leaks.
        Hope this helps, otherwise supply more code!

        Greetz, Jeroen

        1 Reply Last reply
        0
        • I Offline
          I Offline
          I-sty
          wrote on last edited by
          #4

          [quote author="Jeroentje@home" date="1343207543"]
          Use the setColumnCount function to delete any unwanted columns. The used items / widgets in the deleted rows are unallocated automatic in the latest libs of Qt, so don't worry about memory leaks.
          Hope this helps, otherwise supply more code!
          [/quote]

          Thanks, Jeroentje@home
          You solved my problem. :)

          Sorry, for my bad English. My first language is Hungarian.

          1 Reply Last reply
          0

          • Login

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