Results 1 to 2 of 2

Thread: How to input text working css properties?

  1. #1
    Join Date
    Sep 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question How to input text working css properties?

    Hi!
    I just made some "QLineEdit" and want to give the text that I put inside those "QLineEdit"'s, with CSS.

    I want another color and put som CSS shadow for it, can someone tell me how, getting so tired trying

    Cheers!

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to input text working css properties?

    A Qt style sheet is not CSS although it has many similarities. Text in a different colour is trivial and you probably want to tweak the selection highlight colour also:
    Qt Code:
    1. #include <QtGui>
    2. int main(int argc, char **argv)
    3. {
    4. QApplication app(argc, argv);
    5. l.setStyleSheet(
    6. "QLineEdit { "
    7. "color: red; background-color: white; "
    8. "selection-color: white; selection-background-color: red; }" );
    9. l.show();
    10. return app.exec();
    11. }
    To copy to clipboard, switch view to plain text mode 

    As far as I can see Qt Style Sheets do not have any equivalent of the CSS3 text-shadow property.

Similar Threads

  1. Some text properties...
    By "BumbleBee" in forum Newbie
    Replies: 1
    Last Post: 16th March 2011, 17:34
  2. Weird text input problem
    By zeldaknight in forum Qt Programming
    Replies: 6
    Last Post: 10th July 2010, 21:19
  3. Input a text file
    By dwarnold45 in forum Newbie
    Replies: 2
    Last Post: 30th March 2010, 06:47
  4. How to limit the input text in QPlaintextedit?
    By sudhansu in forum Qt Programming
    Replies: 4
    Last Post: 10th March 2010, 10:42
  5. [?] Input text programmatically
    By XuTMAH in forum Newbie
    Replies: 3
    Last Post: 24th September 2007, 16:47

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.