"QT" C + + GUI QT4 Learning Note 5

Source: Internet
Author: User

Toss for several days, finally the book's third chapter and the fourth chapter to see a probably.

The function call relationships inside are complex.

A part of the function relationship is organized as follows:

The cell Relationship Cleanup data (role) returns the value that should be displayed or the value of the alignment or formula     ->value () cell, and if it is old, re-get the value to Cachedvalue and return to the input with the ' start and = ' Beginning of the special treatment             - >formula () Gets the cell's edit role                     ->data (edit role)             ->evalexpression () evaluates the value of the expression Setformula (formula)// Set cell formula--     setData (Editrole, Formula) to edit role call SetData,          qtablewidgetitem::setdata (role value) to cell Assigns a value to the given value with the given formula          ->setdirty () If the value of Editrole is set to the old

Problem:

?? where the data () is called
Qt::D isplayrole
Where did Qt::textalignmentrole come from?

?? The difference between text () and data () in Qtablewigetitem
?? What's the use of setting the value to the old one?

Spreadsheet Relationship Cleanup spreadsheet ()     |->qtablewidget::setitemprototype (new cell)//Set the type of each cell      |-> SelectionMode ()//Set selection mode qt comes with     |->somethingchanged ()//slot function     |      | ->recalculate ()//recalculation     |      |     | ->cell ()//Convert cell to cell form     |      |     |     ->qtablewidget::item ()     |      |     | ->cell::setdirty ()//Set all values to be old     |      |     | ->viewport ()->update () update??     |      |     |      | ->modified ()//Signal     |     | ->clear ()//clear the entire table            |->setrowcount (0)             |->setcolumncount (0)            |->setrowcount (RowCount);// Set how many lines qt comes with            |->setcolumncount (ColumnCount);//Set how many columns qt comes with          setautorecalculate ()//If Auto-count is true, call the operator below     

There are some problems I haven't figured out yet. Marked with a question mark.

For these modules, from small to large to tidy up a bit:

The smallest is that the qtablewigetitem is the representation of the cells of the two-dimensional table qtablewidget, but what is entered shows nothing, no function

And then the Cell is the extension of the Qtablewigetitem added to the special input format processing and expression calculation function

And then the spreadsheet extended from the two-dimensional table qtablewidget uses the cell, adding copy, paste, find, sort, save, read function.

Finally, the function of MainWindow is the interface button and function docking.

"QT" C + + GUI QT4 Learning Note 5

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.