Results 1 to 6 of 6

Thread: Image as window form

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Image as window form

    Hello, I want to make window frame using some picture. Window shouldn't have borders, titlebars, etc. It also should be hidden from active windows list (in taskbar).

    Second part of question I did with:

    Qt Code:
    1. this->setAttribute(Qt::WA_NoSystemBackground);
    2. this->setAttribute(Qt::WA_QuitOnClose);
    3.  
    4. this->setAutoFillBackground(true);
    5.  
    6. this->setWindowFlags(Qt::FramelessWindowHint | Qt::Tool);
    To copy to clipboard, switch view to plain text mode 
    for new class which inherits QMainWindow. It's hidden, for example, at gnome taskbar, but in Awn (awant windows navigator) I seed it in the list of active windows .

    What about first part. I did this some time ago with QRegion, QPixmap and mask in overloaded paintEvent. I've lost the code. Can you help me with this?

    I tried the code like:
    Qt Code:
    1. void MainWindow::paintEvent(QPaintEvent * event)
    2. {
    3. QPainter painter(this);
    4.  
    5. QPixmap pixmap = QPixmap();
    6. pixmap.load("/home/my_image.jpg");
    7.  
    8. painter.drawPixmap(event->rect(), pixmap);
    9. }
    To copy to clipboard, switch view to plain text mode 
    But I see my picture and black rectangle under it.
    Last edited by Ockonal; 3rd April 2011 at 08:33.

Similar Threads

  1. Qt form to bitmap image .. How to
    By Ratheendrans in forum Qt Programming
    Replies: 2
    Last Post: 24th November 2010, 13:22
  2. setting an image on the form
    By Yayati.Ekbote in forum Newbie
    Replies: 6
    Last Post: 15th March 2010, 11:39
  3. [Qt4.1] How to insert an image inside a Form?
    By Gonzalez in forum Qt Tools
    Replies: 5
    Last Post: 23rd September 2008, 11:20
  4. How to insert an image in background of a Form?
    By awanish_jmi in forum Qt Tools
    Replies: 2
    Last Post: 8th August 2008, 10:52
  5. Replies: 7
    Last Post: 13th November 2006, 15:44

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