Results 1 to 10 of 10

Thread: QFont Object not recognized.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QFont Object not recognized.

    Qt Code:
    1. QFont font("Times",12);
    2. myWidget.setFont(font);
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to FelixB for this useful post:

    eLancaster (8th February 2011)

  3. #2
    Join Date
    Dec 2010
    Location
    My bed
    Posts
    21
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFont Object not recognized.

    I still dont understand why you have to do that. I've never read of anything like that, i'm very sorry to say :$
    also i still get the error "invalid use of void expression"

  4. #3
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QFont Object not recognized.

    also i still get the error "invalid use of void expression"
    Because code like this
    Qt Code:
    1. ui->SLineEdit->setFont(font->setBold(false));
    To copy to clipboard, switch view to plain text mode 
    makes no sense: font->setBold() is a method that returns 'void', and "setFont()" requires 'const QFont&'.
    Modify your font and then assign it to QLineEdits:
    Qt Code:
    1. font->setBold(true);
    2. font->...
    3. ui->lineEdit->setFont( *font ); //!< if you dont know why its here ...
    To copy to clipboard, switch view to plain text mode 
    ... read this

  5. The following user says thank you to stampede for this useful post:

    eLancaster (8th February 2011)

Similar Threads

  1. Swipe gesture not recognized
    By Luc4 in forum Qt Programming
    Replies: 2
    Last Post: 16th December 2014, 15:13
  2. Qmake command not recognized
    By Rakula in forum Installation and Deployment
    Replies: 2
    Last Post: 15th September 2014, 13:10
  3. Resize Policy not recognized
    By Ishmael in forum Newbie
    Replies: 1
    Last Post: 20th May 2010, 08:46
  4. mingw32-make not recognized
    By freekill in forum Installation and Deployment
    Replies: 4
    Last Post: 8th January 2010, 16:26
  5. slots and signals don't seem to be recognized
    By Jessehk in forum Qt Programming
    Replies: 2
    Last Post: 31st July 2007, 19:50

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
  •  
Qt is a trademark of The Qt Company.