Results 1 to 3 of 3

Thread: Qt5.1 behaves randomly erroneous while creating a table.

  1. #1
    Join Date
    Aug 2013
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Qt5.1 behaves randomly erroneous while creating a table.

    Hello,

    I'm creating a table with a qt widget. My widget displays the table only if it has been filled with information. in qt 4.8 it displays without error the table, however in qt5.1.0 sometimes it displays the table and sometimes it doesn't.

    The inheritance relation in my widget is

    Qt Code:
    1. class TableWidget : public QTableWidget
    To copy to clipboard, switch view to plain text mode 

    Note: There is no change in code nor in the qml code, nor in the qtWidget code, only the lbraries of qt change from 4.8 to 5.1

    Can someone help to shed some light into the behavior of my widget in Qt5.1.?

    Thank you in advance for your help.

    Ulises Vega

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,578
    Thanks
    13
    Thanked 1,584 Times in 1,513 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qt5.1 behaves randomly erroneous while creating a table.

    Can someone help to shed some light into the behavior of my widget in Qt5.1.?
    How? You tell us absolutely nothing about your widget code, how your widget fits into a larger UI, what "sometimes it displays the table and sometimes it doesn't" means, what you are actually seeing, what you expected to see, what QML has to do with any of this etc.

  3. #3
    Join Date
    Aug 2013
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Qt5.1 behaves randomly erroneous while creating a table.

    Let me describe you a bit more of my application. I have a tabbed application, in one tab of this one i have to display a pair of tables. This table come from QTableWidget as a base class. This tables display 5 columns and 3 rows. In qt 4.8 this tables are displayed correctly all the times I run my application, however when I moved to qt5.1.0 this tables and its contents are not displayed all the time (every time i run my application) sometimes they display the data correctly and someother time they don't display the data correctly. The displaying of the data is during initialization of my tabbed application In the following picture you have a pictorial description of my application whent it does not display the data correctly.tables.jpg In the following picture you can see how the data is correctly displayed in the tables during initialization tablescorrect.jpg

    This tabbed application is done in qml and qt c++. The tabs are done in qml, and the widget in qt c++. I want to emphasize that my tables work perfectly in qt 4.8 but they don't work perfectly in qt5.1.0

    This function is the one I use to fill dummy data in the table during initialization.
    Qt Code:
    1. this is javascript qml
    2.  
    3. /*
    4.   * This function fills with dummy info (zeros) the contents of a table.
    5.   *Params:
    6.   * idTable, the table to be filled with dummy data,
    7.   * numRows, the number of rows to be filled with dummy data
    8.   * numColumns, the number of columns to be filled with dummy data
    9.   */
    10. function vFillTableWithDummyData(idTable, numRows, numColumns)
    11. {
    12. var i=0,j=0;
    13.  
    14. for( i=0 ; i < numRows ; i++)
    15. {
    16. for( j= 0 ; j < numColumns ; j++)
    17. {
    18. idTable.vAppendItemText(i, j, "00000000");
    19. }
    20. }
    21. }
    22.  
    23. this qt c++
    24.  
    25. void TableQt::vAppendItemText(int intRow, int intColumn, QString sText)
    26. {
    27. //check that indexes exist
    28. if (( intRow <= m_intRows) && ( intColumn <= m_intColumns))
    29. {
    30. QTableWidgetItem *poWidget = new QTableWidgetItem(sText);
    31. poWidget->setTextAlignment(Qt::AlignVCenter); // V center aligment
    32. poWidget->setTextAlignment(Qt::AlignHCenter); // H center aligment
    33. m_poTable->setItem(intRow,intColumn,poWidget); // <row, col, item>
    34. if (!m_poTable->isVisible())
    35. {
    36. m_poTable->setVisible(true);
    37. }
    38. }
    39. }
    40.  
    41. TableQt.h
    42.  
    43. class TableQt : public QGraphicsProxyWidget {
    44. Q_OBJECT
    45. ....
    46.  
    47. // base clase pointer member
    48. TableWidget* m_poTable;
    49. };
    50.  
    51. class TableWidget :
    52. public QTableWidget
    53. {
    54. Q_OBJECT
    55. }
    56.  
    57. TableWidget::TableWidget(QWidget *parent)
    58. : QTableWidget(parent)
    59. {
    60. m_verticalScrollBar = new ScrollBar(this);
    61. this->setVerticalScrollBar(m_verticalScrollBar);
    62.  
    63. }
    To copy to clipboard, switch view to plain text mode 

    I hope this makes things clear, and thanks for your help and the time provided in my question.

    Ulises Vega

Similar Threads

  1. Erroneous paths of qt libraries on Mac
    By Feoggou in forum Installation and Deployment
    Replies: 1
    Last Post: 4th November 2011, 09:40
  2. program crashing randomly code -1073741819
    By feraudyh in forum General Programming
    Replies: 6
    Last Post: 21st September 2010, 18:07
  3. Replies: 2
    Last Post: 20th September 2007, 20:37
  4. KeyPressEvent behaves strange, skips the F key.
    By pir in forum Qt Programming
    Replies: 1
    Last Post: 18th August 2006, 18:07
  5. creating table plugin
    By mgurbuz in forum Qt Programming
    Replies: 3
    Last Post: 28th April 2006, 14:50

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.