Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Transparent Window in kde
QtWS25 Last Chance

Transparent Window in kde

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 3.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bijanbina
    wrote on last edited by
    #1

    Hi
    i want to create a window with transparent background.i create it for gnome successfully but in kde some shadow draw around window(you can see it in screen shot around map icon).some guys said you can use QML and QDeclarativeView but i cant use them for some reason.
    i found that if you create an image that have some alpha blend and then create a mask for window it disable the window shadow but if you move window something draw on your screen(they are like noise and when the screen update they destroy)!
    if you don't understand you can see in my screen shot the window with shadow enable and the other with no shadow.
    !http://www.youimages.org/public/images/082755EKG5.png(ScreenShot)!
    also my code:

    @
    #include <QtGui/QApplication>
    #include "QLabel"

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    QMainWindow mainwindow = new QMainWindow();
    QLabel
    mainwidget = new QLabel();
    QPixmap pm = QPixmap("/home/bijan/Pictures/Maps.png");
    QPixmap maskImage = QPixmap("/home/bijan/Pictures/MapsMask.png");
    mainwindow->setMask(maskImage.mask());
    mainwindow->setAttribute(Qt::WA_TranslucentBackground);
    mainwindow->setWindowFlags(Qt::FramelessWindowHint);
    mainwidget->setPixmap(pm);
    mainwindow->setCentralWidget(mainwidget);
    mainwindow->show();
    return a.exec();
    }
    @

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      closed due to duplicate post from "this thread":http://developer.qt.nokia.com/forums/viewthread/1107/

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • G Offline
        G Offline
        giesbert
        wrote on last edited by
        #3

        reopened due to user request

        Nokia Certified Qt Specialist.
        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved