PDA

View Full Version : Showing the QDialog in the task bar



Nyphel
16th April 2007, 14:40
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.

MyQdialog_impl(QWidget *parent = 0);

MyQdialog_impl::MyQdialog_impl(QWidget *parent = 0) {...}

In order to hide the QDialogs in the taskbar, I create them like this :


QDialog *dialog_mailchecker;
dialog_mailchecker = new QDialog();
dialog_mailchecker->hide();

for each account to be shown
{
MyQdialog_impl *messageTable;
messageTable= new MyQdialog_impl(dialog_mailchecker);
{...}
messageTable.show();
}


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 ? :)




.

fullmetalcoder
16th April 2007, 15:26
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...

Nyphel
16th April 2007, 15:49
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.

fullmetalcoder
16th April 2007, 18:51
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... :)

Nyphel
17th April 2007, 08:13
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 :)

:D

aamer4yu
17th April 2007, 10:19
Thats little confusing... cud u explain with a pic :D

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... :)

Nyphel
17th April 2007, 10:25
Yes, I shloud create a class... :o