Results 1 to 6 of 6

Thread: [SOLVED] Display order (z-axis) of objects in a same widget

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2016
    Posts
    3
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default [SOLVED] Display order (z-axis) of objects in a same widget

    Hey Folks,

    I am new to Qt and i got a problem on an application I am trying to code.
    First of all, i am using Qt5 on Ubuntu.
    That being said, I am trying to code a widget containing a QImage (png) and a label. I would like that at some moment, the image goes on top of the label. A hide() method isn't what I am looking for as my image is not plain and do not recover entirely my label, I still want it to be "part" visible.

    My problem is that my label is always on top and never in background of my QImage, and I don't know how to manage it from my repaint event.

    Here is what my code looks like:
    Qt Code:
    1. QImage myPicture = QImage("./Foo.png");
    2. QPainter painter(this);
    3.  
    4. path.addText(0, 0, painter.font(), "Foo");
    5. painter.drawPath(path);
    6. painter.drawImage(myPicture.rect(), myPicture, myPicture.rect());
    To copy to clipboard, switch view to plain text mode 

    Does anybody have an idea on this problem of mine ?

    Thanks for having a look.
    Last edited by Mystogan; 9th March 2016 at 13:18.

Similar Threads

  1. Replies: 2
    Last Post: 28th October 2016, 11:12
  2. Display System Drives in Specific Order in QTreeView
    By owais_blore in forum Qt Programming
    Replies: 6
    Last Post: 5th December 2012, 08:07
  3. Using a tree widget to display a list of model objects
    By xtal256 in forum Qt Programming
    Replies: 9
    Last Post: 30th May 2011, 03:00
  4. Changing QTableView column display order
    By scarleton in forum Qt Programming
    Replies: 3
    Last Post: 18th October 2010, 00:04
  5. display order of subwindows in mdi area
    By eric_vi in forum Qt Programming
    Replies: 3
    Last Post: 11th May 2010, 16:05

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.