Results 1 to 11 of 11

Thread: Qlabel

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    115
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanked 1 Time in 1 Post

    Default Re: Qlabel

    Iám newbe,

    Maby a stuppid question where put i the width and height of the pixmap.

    Qt Code:
    1. QPixmap erf = (QPixmap(":/images/erf.png");
    2. freeslabel->setPixmap(erf); // here
    3. freesLabel->setProperty("imagePath", ":/images/erf.png");
    4.  
    5. imgfmt->setName(freesLabel->property(":/images/erf.png").toString());
    6. imgfmt->setWidth(freesLabel->pixmap()->width()); //or here
    7. imgfmt->setHeight(freesLabel->pixmap()->height()); //or here
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: Qlabel

    Well, I have read the docs more carefully, and you might not need that.
    Only do this when you wish to insert a pixmap:
    Qt Code:
    1. QImage img = freesLabel->pixamp()->toImage();
    2. textDoc->addResource(QTextDocument::ImageResource, QUrl("labelImage"), img);
    3. cursor.insertImage("labelImage");
    To copy to clipboard, switch view to plain text mode 

    This will work just fine if you implement it correctly.
    textDocument is your QTextDocument.

    Regards

  3. #3
    Join Date
    Jan 2006
    Posts
    115
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanked 1 Time in 1 Post

    Default Re: Qlabel

    Marcel thanks for your time and answers it works fine now.

Similar Threads

  1. background-image on QLabel does NOT work
    By VireX in forum Newbie
    Replies: 2
    Last Post: 8th June 2007, 20:30
  2. QLabel links?
    By gfunk in forum Qt Programming
    Replies: 3
    Last Post: 23rd December 2006, 00:42
  3. QScrollArea display custom QLabel
    By spawnwj in forum Qt Programming
    Replies: 6
    Last Post: 6th December 2006, 03:38
  4. QLineEdit && QLabel
    By eleanor in forum Newbie
    Replies: 16
    Last Post: 12th November 2006, 17:30
  5. QLabel with HTML-style formatting docs?
    By Everall in forum Qt Programming
    Replies: 6
    Last Post: 7th February 2006, 20:01

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.