PDA

View Full Version : Problem about staying on taskbar



adorp
24th July 2007, 13:04
How can I make an Application whose interface is a dialog appear in the taskbar under Linux, for example Fedora 6?

1. If just only writing codes, how to implement it?
2. And if using Qt Designer, how to implement it then?

Michiel
24th July 2007, 13:20
That is specific to the window manager. If you're talking about KDE, check the KDE api. I think you want the KPanelApplet (http://api.kde.org/3.5-api/kdelibs-apidocs/kdeui/html/classKPanelApplet.html) class.

adorp
24th July 2007, 18:09
But I think this has nothing to do with "specific" platform, in Fedora 6:

1. when I use Qt4 write the program with QMainWindow and after I start up the program , I can find it on taskbar;

2. But If I write such a program with QDialog as its main interface, then as I run it, it seems nomral except that it can't stay on task bar. So, why? Can anybody have idea?

Michiel
24th July 2007, 20:02
Oh. I misunderstood you. I thought you wanted to make a taskbar applet.

So you're just talking about a windows taskbar entry. Actually, in my Linux Gentoo / KDE installation, a QDialog does show up in the taskbar.


#include <QApplication>
#include <QDialog>

int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QDialog window;
window.show();
return app.exec();
}

The only thing I can think of is that you might have to play a bit with the QWidget windowFlags.

Which window manager are you using, anyway?

adorp
24th July 2007, 21:54
The only thing I can think of is that you might have to play a bit with the QWidget windowFlags.

Which window manager are you using, anyway?

I am using gnome as my window manager, I regret I made the decision cause I installed and used Linux 8 months ago for the FIRST time, I had no experience about Linux before. I just think Fedora not bad, gnome is not good, many people tell me KDE is the best, but I didn't hear them and selected the DEFAULT gnome. I will install Fedora 8 by the end of year and choose KDE as my desktop.

I'm not familiar with that "QWidget windowFlags", could you please give me small code snippet? Thanks ahead:rolleyes:

marcel
24th July 2007, 21:58
Use this in the constructor of the dialog:


setWindowFlags( Qt::Dialog );


Also, have you tried running the Window Flags example? It is in the Widgets section, in qt demos. Just switch the flags and see for which one you get an entry in the task bar.

Regards

fullmetalcoder
24th July 2007, 22:20
I am using gnome as my window manager, I regret I made the decision cause I installed and used Linux 8 months ago for the FIRST time, I had no experience about Linux before. I just think Fedora not bad, gnome is not good, many people tell me KDE is the best, but I didn't hear them and selected the DEFAULT gnome. I will install Fedora 8 by the end of year and choose KDE as my desktop.
And what about using yum (or pirut) to install KDE packages? Is that SOOO hard to open up a package manager, select a package group, click on a button and go drinking something while your new desktop is being installed? :rolleyes:

Contrary to Windows, the installation process is not something that freeze your system under Linux... Everything can be changed provided you have a broadband connection (or a medium full of packages...) and enough common sense to get a package manager doing what you want :D

marcel
24th July 2007, 22:23
I say to forget about Fedora( it sucks actually ), and if you want something fast, robust and scalable just install Slackware. It's the best.

Or, if you want something more automated, get a SuSE dist.

Regards

fullmetalcoder
24th July 2007, 22:31
I say to forget about Fedora( it sucks actually ), and if you want something fast, robust and scalable just install Slackware. It's the best.
It depends... I used to use Fedora because it was the only distro that managed to get every piece of hardware working on my 6 years old box (HP printer, Nvidia GF2MX, Wifi card with only ndiswrapper working, ...). However I finally found Frugalware (which is ,or used to be, based on Slackware) and I'm quite happy with it :)


Or, if you want something more automated, get a SuSE dist.
Suse is heavy and the default GUI themes are crappy... I've tested about 20 distros in a year and, apart from the two mentioned above only Pardus and Mepis someway satisfied me (but not enough to keep them obviously... :p)

marcel
24th July 2007, 22:34
It depends... I used to use Fedora because it was the only distro that managed to get every piece of hardware working on my 6 years old box (HP printer, Nvidia GF2MX, Wifi card with only ndiswrapper working, ...). However I finally found Frugalware (which is ,or used to be, based on Slackware) and I'm quite happy with it :)

Nowadays mostly all hardware is supported and works very well, especially if you use vendor drivers.



Suse is heavy and the default GUI themes are crappy... I've tested about 20 distros in a year and, apart from the two mentioned above only Pardus and Mepis someway satisfied me (but not enough to keep them obviously... :p)

You can always drop the themes and use a default KDE installation.
Anyway, I don't really like updaters. It is better to compile almost everything locally.

Regards

marcel
24th July 2007, 22:35
It depends... I used to use Fedora because it was the only distro that managed to get every piece of hardware working on my 6 years old box (HP printer, Nvidia GF2MX, Wifi card with only ndiswrapper working, ...). However I finally found Frugalware (which is ,or used to be, based on Slackware) and I'm quite happy with it :)

Nowadays mostly all hardware is supported and works very well, especially if you use vendor drivers.



Suse is heavy and the default GUI themes are crappy... I've tested about 20 distros in a year and, apart from the two mentioned above only Pardus and Mepis someway satisfied me (but not enough to keep them obviously... :p)

You can always drop the themes(and even the whole package) and use a default KDE installation. It's better to compile almost everything locally.

Regards

fullmetalcoder
24th July 2007, 22:38
Anyway, I don't really like updaters. It is better to compile almost everything locally.
Gimme your PC!!! No really... one can afford the niceties offered by a source-only distro if and only if he has an extremely powerful PC. I once tried to install Gentoo and went mad compiling a whole KDE desktop, and then firefox. I just managed to log graphically (after days of compilation :crying:) to find out that I needed even more compilation to have an usable system so I just dropped it. :mad:

marcel
24th July 2007, 22:43
:) It's not much of a PC, really...
Compiling Qt 4.3 takes about 2 hours and KDE takes about 3-4 hours( never had the patience to stay in front of it ).

I never tried compiling Firefox though. :).




once tried to install Gentoo and went mad compiling a whole KDE desktop, and then firefox. I just managed to log graphically (after days of compilation)

:) What computer do you have? A 486(DX :)) or something?
Never took that long to get KDE up and running.

Regards

fullmetalcoder
24th July 2007, 22:46
What computer do you have? A 486(DX :)) or something?
Never took that long to get KDE up and running.
Athlon 1.4Ghz with 512Mb SDRAM and 40Gb HDD (no SATA)
two power supply block died already trying to keep this old beast alive... ;)

[keep dreaming]Hopefully I'll win a brand new Macbook thanks to QtCentre contest :D[/keep dreaming]

marcel
24th July 2007, 22:49
Athlon 1.4Ghz with 512Mb SDRAM and 40Gb HDD (no SATA)
two power supply block died already trying to keep this old beast alive... ;)


I think that small memory is causing the long compile times.
The processor is good enough.



[keep dreaming]Hopefully I'll win a brand new Macbook thanks to QtCentre contest :D[/keep dreaming]

Your IDE is one of the most complex/useful applications in there.
You could win.

Regards

adorp
24th July 2007, 22:49
Use this in the constructor of the dialog:


setWindowFlags( Qt::Dialog );


Also, have you tried running the Window Flags example? It is in the Widgets section, in qt demos. Just switch the flags and see for which one you get an entry in the task bar.

Regards
That still fails, but if we change Qt::Dialog to Qt::Window, look, it works! Thanks anyway, and I found that example which although can't help solve the problem, but it is heuristic after all:p

marcel
24th July 2007, 22:51
That is not normal. At least in KDE, Windows and Mac a QDialog has a taskbar/dock button/icon.

Regards