Results 1 to 7 of 7

Thread: Showing the QDialog in the task bar

  1. #1
    Join Date
    Feb 2007
    Posts
    158
    Thanks
    25
    Qt products
    Qt4
    Platforms
    Windows

    Default Showing the QDialog in the task bar

    Hi,

    My application is a simple mail checker : it informs the user when he got mails.
    The user may have many accounts, and my application display 1 QDialog for each account that got new mails.

    Like I don't want to get many new frames in my taskbar, I don't want them to be visible inside. So, the constructor of the QDialog implementation class has a "parent object" parameter.
    Qt Code:
    1. MyQdialog_impl(QWidget *parent = 0);
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. MyQdialog_impl::MyQdialog_impl(QWidget *parent = 0) {...}
    To copy to clipboard, switch view to plain text mode 

    In order to hide the QDialogs in the taskbar, I create them like this :
    Qt Code:
    1. QDialog *dialog_mailchecker;
    2. dialog_mailchecker = new QDialog();
    3. dialog_mailchecker->hide();
    4.  
    5. for each account to be shown
    6. {
    7. MyQdialog_impl *messageTable;
    8. messageTable= new MyQdialog_impl(dialog_mailchecker);
    9. {...}
    10. messageTable.show();
    11. }
    To copy to clipboard, switch view to plain text mode 

    So all my messageTable are linked to a hidden QDialog and they don't appear in the task bar. That's well !

    But now I've got a new functionnality in those tables : when my user click a message, I create a QProcess that calls FireFox (targetting the webmail). So FireFox is opened in front of the QDialogs... And like they aren't in the task bar, the user can't show/hide them easily.

    Is it possible, at this moment, to force the QDialogs to be shown in the tasbar please ?




    .
    Last edited by Nyphel; 16th April 2007 at 15:04.

  2. #2
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Showing the QDialog in the task bar

    Quote Originally Posted by Nyphel View Post
    Is it possible, at this moment, to force the QDialogs to be shown in the tasbar please ?
    .
    What about calling QWidget::show() ??? You may also consider relying on a QSystemTrayIcon to allow easy user interaction...
    Current Qt projects : QCodeEdit, RotiDeCode

  3. #3
    Join Date
    Feb 2007
    Posts
    158
    Thanks
    25
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Showing the QDialog in the task bar

    In reality all my application is managed by a TrayIcon application.
    This application is a "manager", and it launch various other process like the one i talk above .

    If I set another Trayicon for the above application, I would have 2 TrayIcons for something that appear to be the same application for the user.

    And if I show the hadden QDialog... I will be visible ^_^
    I would like the user not to see it.

  4. #4
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Showing the QDialog in the task bar

    Quote Originally Posted by Nyphel View Post
    n QDialog... I will be visible ^_^
    I would like the user not to see it.
    It's confusing but I think I nearly got it : you want the dialog to appear in the task bar so that it can be shown on user request but will remain hidden until the user asks for it. Is that right? In this case QWidget::showMinimized() should fit...
    Current Qt projects : QCodeEdit, RotiDeCode

  5. #5
    Join Date
    Feb 2007
    Posts
    158
    Thanks
    25
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Showing the QDialog in the task bar

    Not really

    I want the main QDialog, the anchor, to not be visible at all. Never. Nor in the task bar, nor minimized .

    But I want all the other QDialogs, attached to the main one, to be displayed in the task bar when I click a button...

    I will have a look to the showminimized for the other QDialogs, thanks


  6. #6
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Showing the QDialog in the task bar

    Thats little confusing... cud u explain with a pic

    neways, if u never want to show the dialog , why make it a dialog ??? u can simply create a class and use it... in this way it will hold ur data and will not be shown... !!
    hope i am right...if not explain a little further...

  7. #7
    Join Date
    Feb 2007
    Posts
    158
    Thanks
    25
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Showing the QDialog in the task bar

    Yes, I shloud create a class...

Similar Threads

  1. showing close Button(x) in QDialog
    By vishal.chauhan in forum Newbie
    Replies: 6
    Last Post: 4th April 2007, 10:01
  2. Resizing a QDialog to the content size
    By Nyphel in forum Qt Programming
    Replies: 8
    Last Post: 15th March 2007, 08:16
  3. Showing Pixmap as a QListWidget Item
    By vishal.chauhan in forum Qt Programming
    Replies: 1
    Last Post: 1st February 2007, 12:25
  4. Qdialog as a child widget
    By dave in forum Newbie
    Replies: 12
    Last Post: 14th November 2006, 09:43
  5. Replies: 1
    Last Post: 28th July 2006, 14:10

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.