Results 1 to 5 of 5

Thread: minimize slot does not work in linux.Is it a Bug in Qt?

  1. #1
    Join Date
    Apr 2009
    Posts
    58
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default minimize slot does not work in linux.Is it a Bug in Qt?

    hi All,
    i am trying to minimize application on the click of a button.The same code works perfactly in windows but does not work in linux .What i need to do ?

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: minimize slot does not work in linux.Is it a Bug in Qt?

    How does the non-working code look?

  3. #3
    Join Date
    Apr 2009
    Posts
    58
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: minimize slot does not work in linux.Is it a Bug in Qt?

    hi,
    I have created a frameless QWidget ,then i create a pushbutton and on its clicked signal i called the slot showMinimized() but my frameless widget is not minimizing.
    here is the code
    Qt Code:
    1. widget::widget(QWidget *parent):QWidget(parent)
    2. {
    3. setWindowFlags(Qt::FramelessWindowHint);
    4. QPushButton *button=new QPushButton(this);
    5. button->setGeometry(10,10,20,20);
    6. connect(button,SIGNAL(clicked()),this,SLOT(showMinimized()));
    7. }
    To copy to clipboard, switch view to plain text mode 
    this code runs perfectly in windows but does nt work in linux...Why??
    Is there any other way to minimize frameless QWidget in linux.

  4. #4
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: minimize slot does not work in linux.Is it a Bug in Qt?

    Actually, looking at the docs for the showMinimized function, they do say that this only works on Windows. I suspect that this is because the windows manager is responsible for more tasks, and not as standardized, in an X11 environment than a Windows environment.

    I would try the setWindowState function and see if that does the trick...

  5. #5
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: minimize slot does not work in linux.Is it a Bug in Qt?

    From Qt Documents you can read

    Qt::FramelessWindowHint Produces a borderless window. The user cannot move or resize a borderless window via the window system. On X11, the result of the flag is dependent on the window manager and its ability to understand Motif and/or NETWM hints. Most existing modern window managers can handle this.
    void QWidget::showMinimized () [slot]

    Shows the widget minimized, as an icon.

    Calling this function only affects windows.
    bool QWidget::isWindow () const

    Returns true if the widget is an independent window, otherwise returns false.

    A window is a widget that isn't visually the child of any other widget and that usually has a frame and a window title.

    A window can have a parent widget. It will then be grouped with its parent and deleted when the parent is deleted, minimized when the parent is minimized etc. If supported by the window manager, it will also have a common taskbar entry with its parent.

    QDialog and QMainWindow widgets are by default windows, even if a parent widget is specified in the constructor. This behavior is specified by the Qt::Window flag.
    Verify the value of Qt::Window flag in X11
    A camel can go 14 days without drink,
    I can't!!!

Similar Threads

  1. copy() slot doesn't work
    By Macok in forum Qt Programming
    Replies: 3
    Last Post: 14th February 2009, 11:55

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.