Hello. In my app I need to put three plain textboxes in three tabs. I'm trying to set the font of the textboxes via stylesheets but I seem to be doing something wrong -- can anyone help?

I looked up the documentation and it said that for QTextEdits I should set the style for QAbstractScrollArea but still it is not working. I'm using a QPlainTextEdit -- is that a problem?

The code is:

Qt Code:
  1. # include <QtGui/QApplication>
  2. # include <QtGui/QPlainTextEdit>
  3. # include <QtGui/QTabWidget>
  4.  
  5. int main ( int argc, char * argv [] )
  6. {
  7. QApplication app ( argc, argv ) ;
  8. app . setStyleSheet ( "QAbstractScrollArea { font : \"DejaVu Sans\" }" ) ;
  9.  
  10. QPlainTextEdit * myInput = new QPlainTextEdit ;
  11.  
  12. QPlainTextEdit * stdOutput = new QPlainTextEdit ;
  13. stdOutput -> setReadOnly ( true ) ;
  14.  
  15. QPlainTextEdit * stdError = new QPlainTextEdit ;
  16. stdError -> setReadOnly ( true ) ;
  17.  
  18. QTabWidget * tabWidget = new QTabWidget ;
  19. tabWidget -> addTab ( myInput, "Input" ) ;
  20. tabWidget -> addTab ( stdOutput, "Output" ) ;
  21. tabWidget -> addTab ( stdError, "Errors" ) ;
  22.  
  23. tabWidget -> show () ;
  24. return app . exec () ;
  25. }
To copy to clipboard, switch view to plain text mode 

Any help is appreciated. Thanks.