[Qt-interest] how to hide the taskbar/dock icon?

Jan Dasselaar jan at altus-escon.com
Thu Jul 22 15:16:58 CEST 2010


Hi,

On the Mac (snow leopard) you can add/edit the following entry of the 
info.plist file of your app bundle:

LSUIElement = 0 (dock icon is shown)
LSUIElement = 1 (dock icon is hidden)


Regards,

Jan


On 21/07/2010 13:11, Gabriele Kahlout wrote:
> Okay, so on Mac (snow leopard) that will not work (see screenshot attached).
> I've also tried not to show the window and subwindow flag.
>
>
> 2010/7/20, Denis Akhmetzyanov<dakhmetzyanov at smartlabs.tv>:
>> Hi,
>>> If I use QApplication I don't have a window to set it's flag to subwindow.
>>
>> Why don't you? It is possible to create windows with QApplication.
>> SSCCE code:
>>
>> // main.cpp
>>
>> #include<QtGui/QApplication>
>>
>> #include<QWidget>
>>
>>   int main(int argc, char *argv[])
>>
>> {
>>
>>      QApplication a(argc, argv);
>>
>>       QWidget w;
>>
>>      w.setWindowFlags(Qt::Tool); // comment this line for show taskbar icon
>>
>>      w.show();
>>
>>       return a.exec();
>>
>> }
>>
>>
>> Also I've attached archive with project.
>> I've tested this code on Ubuntu 10.04 Gnome and KDE and Windows XP SP3. And
>> taskbar icon have been hided everywhere. You could try this code. What is
>> your environment?
>> P.S. I've tried flag Qt::SubWindow and it doesn't work.
>>
>> 2010/7/20 Gabriele Kahlout<gabriele at mysimpatico.com>
>>
>>> I already use qxtglobalshortuct and it works fine under QApplication,
>>> but as I said if the application runs as QCoreApplication then the
>>> shortcut is not listened to any more.
>>>
>>> If I use QApplication I don't have a window to set it's flag to
>>> subwindow. But anyway, could u post code known to hide the taskbar
>>> icon, a SSCCE?
>>>
>>> 2010/7/19, Denis Akhmetzyanov<dakhmetzyanov at smartlabs.tv>:
>>>> Hi,
>>>> I only tried hide the taskbar icon for my application. It didn't listen
>>> to
>>>> any shortcuts. I think you could have a look at the QxtGlobalShortcut
>>>> http://doc.libqxt.org/tip/qxtglobalshortcut.html .
>>>> Qt bugtracker has task related to this issue:Implement global shortcuts
>>>> http://bugreports.qt.nokia.com/browse/QTBUG-5183
>>>> May be it helps.
>>>>
>>>>
>>>> 2010/7/18 Gabriele Kahlout<gabriele at mysimpatico.com>
>>>>
>>>>> That has not worked out for me.
>>>>> The code is hosted here
>>>>> http://screenshoter.svn.sourceforge.net/viewvc/screenshoter/.
>>>>>
>>>>> The application is intended to be a background one which is activated
>>>>> by key sequence.
>>>>> So when launched it does nothing but listen to specified key
>>>>> sequences. A window is created later. But even creating a window and
>>>>> not showing it won't work.
>>>>>
>>>>> Starting it as a QCoreApplication will not display the taskbar but
>>>>> will not even listen to the hot keys.
>>>>> So, what should I do in this case?
>>>>>
>>>>> 2010/7/13, Denis Akhmetzyanov<dakhmetzyanov at smartlabs.tv>:
>>>>>> Hi,
>>>>>> I've done such thing using:
>>>>>>
>>>>>> setWindowFlags(Qt::Tool);
>>>>>>
>>>>>> This flag hides taskbar tab for application, but reduces window title
>>>>> bar.
>>>>>> Also I've heard a suggestion to use Qt::SubWindow flag for this
>>> purpose,
>>>>> but
>>>>>> never tried myself.
>>>>>>
>>>>>>
>>>>>> 2010/7/10 Gabriele Kahlout<gabriele at mysimpatico.com>
>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> My application is a background process that occassionally shows a
>>>>>>> window
>>>>>>> (set always on top). I'd like not to have a dock item/taskbar tab
>>>>>>> for
>>>>>>> it
>>>>>>> at
>>>>>>> all.
>>>>>>> How can I do that?
>>>>>>>
>>>>>>> Couldn't find any reference in the doc, while previous posts don't
>>> work
>>>>>>> (eg. Qt::Popup or splashscreen) or are incomplete.
>>>>>>>
>>>>>>> --
>>>>>>> Regards,
>>>>>>> K. Gabriele
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Qt-interest mailing list
>>>>>>> Qt-interest at trolltech.com
>>>>>>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Best regards,
>>>>>> Denis Akhmetzyanov
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Regards,
>>>>> K. Gabriele
>>>>>
>>>>> --- unchanged since 25/1/10 ---
>>>>> P.S. Unless a notification (LON), please reply either with an answer
>>>>> OR with " ACK" appended to this subject within 48 hours. Otherwise, I
>>>>> might resend.
>>>>> In(LON, this) ∨ In(48h, TimeNow) ∨ ∃x. In(x, MyInbox) ∧ IsAnswerTo(x,
>>>>> this) ∨ (In(subject(this), subject(x)) ∧ In(ACK, subject(x)) ∧
>>>>> ¬IsAnswerTo(x,this)) ⇒ ¬IResend(this).
>>>>>
>>>>> Also note that correspondence may be received only from specified a
>>>>> priori senders, or if the subject of this email ends with a code, eg.
>>>>> -LICHT01X, then also from senders whose reply contains it.
>>>>> ∀x. In(x, MyInbox) ⇒ In(senderAddress(x), MySafeSenderList) ∨ (∃y.
>>>>> In(y, subject(this) ) ∧ In(y,x) ∧ isCodeLike(y, -LICHT01X) ).
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Best regards,
>>>> Denis Akhmetzyanov
>>>>
>>>
>>>
>>> --
>>> Regards,
>>> K. Gabriele
>>>
>>
>>
>>
>> --
>> Best regards,
>> Denis Akhmetzyanov
>>
>
>
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list