Home > Blockchain >  How can I get the cell's color in QTableWidget?
How can I get the cell's color in QTableWidget?

Time:08-20

I need to know the color of cell's background. What the function can make it?

CodePudding user response:

Try something like

auto item = myTableWidget->itemAt(0, 0); // adapt that to the cell you want
auto color = item->background().color();

By the way, I don't want to be an asshole but that took me literally 10 seconds reading the documentation

Qt modules (expecially Core and Widgets) are very well documented, it's really worth spending some time searching through it, you'll find answer way faster than waiting for a random guy to answer on stack overflow.

CodePudding user response:

I have found this library (libfort) on github: libfort.

  •  Tags:  
  • c qt
  • Related