Qt-interest Archive, June 2007
QStyle::standardIconImplementation
Message 1 in thread
Greetings,
Recently, I tried to implement my own QT style to give new look for my window application. But when I tried to implement protected slot standardIconImplementation() to change new Icon maximize, minimize and close button, there was somthing missing with this slot function. My standardIconImplementation() never loaded when I run my window. Please help me to solve this problem.
here is my snippet code in customstyle.h
class CustomStyle :
public QWindowsStyle
{
Q_OBJECT
public:
CustomStyle(void);
public:
~CustomStyle(void);
void drawPrimitive(PrimitiveElement element, const QStyleOption *option,
QPainter *painter, const QWidget *widget) const;
protected slots:
QIcon standardIconImplementation(StandardPixmap standardIcon,
const QStyleOption *option,
const QWidget *widget) const;
};
and int the customstyle.cpp
QIcon CustomStyle::standardIconImplementation(StandardPixmap standardIcon,
const QStyleOption *option,
const QWidget *widget) const
{
//never loaded here
switch(standardIcon) {
case SP_TitleBarMaxButton:
if (qstyleoption_cast<const QStyleOptionDockWidget *>(option))
{
int a = 0;
}
break;
case SP_TitleBarCloseButton:
{
int a = 0;
}
break;
case SP_TitleBarNormalButton:
if (qstyleoption_cast<const QStyleOptionDockWidget *>(option))
{
int a = 0;
}
break;
}
return QWindowsStyle::standardIconImplementation(standardIcon, option, widget);
}
Thanks
Islahul
--
[ signature omitted ]
Message 2 in thread
Hi,
anyone an idea what I could do wrong?
I try to embed a .wav file using the Qt resource system:
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>Resources/GridButton1.png</file>
<file>Resources/rico.wav</file>
</qresource>
</RCC>
When I try to play the sound using:
QSound::play(":/Resources/rico.wav");
I hear that I hear nothing. QSound::isAvailable() returns true.
NAS is installed and works fine, i.e. if I provide the absolute path:
QSound::play("/home/guido/rico.wav");
it plays fine.
The resources files and the pathes should be ok, since the GridButton1.png
is found and can be used without any problems.
Is this a special .wav problem? My bug? Trolltech bug?
Guido
--
[ signature omitted ]
Message 3 in thread
On 6/25/07, Guido Seifert <wargand@xxxxxx> wrote:
> QSound::play(":/Resources/rico.wav");
>
> I hear that I hear nothing. QSound::isAvailable() returns true.
>
> NAS is installed and works fine, i.e. if I provide the absolute path:
>
> QSound::play("/home/guido/rico.wav");
>
> Is this a special .wav problem? My bug? Trolltech bug?
QSound can't play embedded files. This is a big con to the not so many pros.
From the doc page
"""
Note that QSound does not support resources. This might be fixed in a
future Qt version.
""".
I've opened Trolltech issue #97276 for this, vote and they might fix it :-)
--
[ signature omitted ]
Message 4 in thread
> QSound can't play embedded files. This is a big con to the not so many pros.
Ouch, this really hurts.
> >From the doc page
> """
> Note that QSound does not support resources. This might be fixed in a
> future Qt version.
> """.
*sigh* Missed that.
> I've opened Trolltech issue #97276 for this, vote and they might fix it :-)
Don't know I still can. :-)
Guido
--
[ signature omitted ]
Message 5 in thread
On 6/25/07, Guido Seifert <wargand@xxxxxx> wrote:
> > QSound can't play embedded files. This is a big con to the not so many pros.
>
> Ouch, this really hurts.
We moved on with mpglib + portaudio instead, works like a charm and we
can embed mp3s and save a lot of space.
--
[ signature omitted ]
Message 6 in thread
Ouch, indeed. How do I play a sound that is NOT in a file at all? My program
get sounds from a database. I want to set the memory buffer and play the
sound without saving it to disk.
QSound has to load the sound into memory to play it at some point, we just
need access to set that buffer directly.
Of course the workaround is to save the buffer (or resource) to a temp file
and play the temp file. Can anyone say S - L - O - W? Of course, this
requires that the user has write access to the disk, which they might not
have.
Keith
**Please do not reply to me, reply to the list.**
On 06-25-2007 5:46 AM, "Guido Seifert" wrote:
>> QSound can't play embedded files. This is a big con to the not so many pros.
>
> Ouch, this really hurts.
>
>>> From the doc page
>> """
>> Note that QSound does not support resources. This might be fixed in a
>> future Qt version.
>> """.
>
> *sigh* Missed that.
>
>> I've opened Trolltech issue #97276 for this, vote and they might fix it :-)
>
> Don't know I still can. :-)
>
> Guido
--
[ signature omitted ]
Message 7 in thread
On 6/25/07, Keith Esau <keith.esau@xxxxxxx> wrote:
> Ouch, indeed. How do I play a sound that is NOT in a file at all? My program
> get sounds from a database. I want to set the memory buffer and play the
> sound without saving it to disk.
>
> Of course the workaround is to save the buffer (or resource) to a temp file
> and play the temp file. Can anyone say S - L - O - W? Of course, this
> requires that the user has write access to the disk, which they might not
> have.
If you really want to do anything with the sound, etc, it's probably
just easier to skip QSound all together.
As I wrote earlier, we moved to portaudio, trying RTaudio in between.
--
[ signature omitted ]
Message 8 in thread
Robin Ericsson schrieb:
>> ...
> As I wrote earlier, we moved to portaudio, trying RTaudio in between.
Just for the record: www.libsdl.org also offers cross-platform sound
support.
Cheers, Oliver
--
[ signature omitted ]
Message 9 in thread
Yes, if current program wasn't so small so that it is not worth the effort, I'd
see whether I could not integrate a ramdisk.
Of course, 3rd party libs are always possible, but may pose different problems.
> Of course the workaround is to save the buffer (or resource) to a temp file
> and play the temp file. Can anyone say S - L - O - W? Of course, this
> requires that the user has write access to the disk, which they might not
> have.
--
[ signature omitted ]