[Interest] Problem with setting font via stylesheet

Jason H scorp1us at yahoo.com
Thu Aug 16 17:41:14 CEST 2012


IIRC, text edits have capability build on scroll areas. Hint. 



________________________________
 From: Shriramana Sharma <samjnaa at gmail.com>
To: interest at qt-project.org 
Sent: Thursday, August 16, 2012 11:38 AM
Subject: [Interest] Problem with setting font via stylesheet
 
Hello. In my app I need to put three plain textboxes in three tabs, so
I am doing the following. However I'm trying to set the font of the
textboxes via stylesheets but I seem to be doing something wrong --
can anyone help?

Thanks.

Shriramana.

------- code -------

# include <QtGui/QApplication>
# include <QtGui/QPlainTextEdit>
# include <QtGui/QTabWidget>

int main ( int argc, char * argv [] )
{
    QApplication app ( argc, argv ) ;
    app . setStyleSheet ( "QPlainTextEdit { font : \"Gentium Basic\" }" ) ;
    
    QPlainTextEdit * myInput = new QPlainTextEdit ;
    
    QPlainTextEdit * stdOutput = new QPlainTextEdit ;
    stdOutput -> setReadOnly ( true ) ;
    
    QPlainTextEdit * stdError = new QPlainTextEdit ;
    stdError -> setReadOnly ( true ) ;
    
    QTabWidget * tabWidget = new QTabWidget ;
    tabWidget -> addTab ( myInput, "Input" ) ;
    tabWidget -> addTab ( stdOutput, "Output" ) ;
    tabWidget -> addTab ( stdError, "Errors" ) ;

    tabWidget -> show () ;
    return app . exec () ;
}

-- 
Shriramana Sharma
_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120816/d73b4aca/attachment.html>


More information about the Interest mailing list