I build a small xhtml editor.... start point is QTextEdit

to discovery the objekt QTextTable is easy and i can make context menu to chance cellpadding spacing background color widht and so....

QTextTable * QTextCursor::currentTable () const
Returns a pointer to the current table if the cursor position() is inside a block that is part of a table; otherwise returns 0.



Now i like to discovery QTextImageFormat objekt to chance hight widht name ... how i find a pointer ?...


Qt Code:
  1. /* QTextEdit *html_area; */
  2. connect(html_area, SIGNAL(cursorPositionChanged()),this , SLOT(WakeUpCursor()));
  3.  
  4. void Html_Editor::WakeUpCursor()
  5. {
  6. QTextCursor findercursor(html_area->textCursor());
  7. if (!findercursor.isNull()) {
  8. /* discovery if a table is selected to display CustomContextMenu start */
  9. if (findercursor.currentTable()) { /* !=0 */
  10. worktable = true;
  11. existingtable = findercursor.currentTable(); /* (header) QTextTable *existingtable; */
  12. SetupTable();
  13. html_area->setContextMenuPolicy( Qt::CustomContextMenu );
  14. connect(html_area , SIGNAL( customContextMenuRequested( const QPoint & ) ), this, SLOT( TableContexMenu() ) );
  15. } else {
  16. ResetTableContex(); /* disconnect remove table context menu and work table false */
  17. }
  18. /* discovery if a table is selected to display CustomContextMenu end */
  19.  
  20. /* discovery?? #include <QTextImageFormat>*/
  21. }
  22.  
  23. }
To copy to clipboard, switch view to plain text mode