Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, August 2003
More custom colors in QColorDialog


Message 1 in thread

Hello,

I have a problem in the "QColorDialog" of Qt. There you can define 16 custom
colors, but I need 128 custom colors. Is it possible to raise the number of
custom colors in this dialog?

Yours sincerely,
Michael


Message 2 in thread

Hi,

> I have a problem in the "QColorDialog" of Qt. There you can define 16 custom
> colors, but I need 128 custom colors. Is it possible to raise the number of
> custom colors in this dialog?

I don't think so. This seems to be hardcoded (have a look at source file 
src/dialogs/qqcolordialog.cpp).

--
 [ signature omitted ] 

Message 3 in thread

I have the 3.1.2 evaluation, and am trying to learn how qmake works. I 
copied one of the example .pro files and munged it a bit for my simple 
(single file) test app, and it correctly builds a Makefile. Unfortunately, 
when I then run nmake, I keep getting this link error:

	LINK : fatal error LNK1181: cannot open input file "qt-mteval312.lib"

Shouldn't qmake know where to find this library?
--
 [ signature omitted ] 

Message 4 in thread

On August 7, 2003 12:22 pm, Paul Miller wrote:
> I have the 3.1.2 evaluation, and am trying to learn how qmake works. I
> copied one of the example .pro files and munged it a bit for my simple
> (single file) test app, and it correctly builds a Makefile. Unfortunately,
> when I then run nmake, I keep getting this link error:
>
> 	LINK : fatal error LNK1181: cannot open input file "qt-mteval312.lib"
>
> Shouldn't qmake know where to find this library?

Are you sure the QTDIR environment variable is set correctly?  Do you have 
qt-mteval312.lib in the appropriate directory?


Message 5 in thread

> > Shouldn't qmake know where to find this library?
>
>Are you sure the QTDIR environment variable is set correctly?  Do you have
>qt-mteval312.lib in the appropriate directory?

Yep - the rest of the build works fine (include paths are found, moc is run 
properly, etc) so I can only assume QTDIR is set properly (and I 
double-checked it). All of the examples build fine too. All the libs are in 
the lib dir, as I would expect.

As a test, I manually copied qt-mteval312.lib and qtmain.lib to my build 
dir and it linked fine.

Here is my .pro file - am I missing anything?

TEMPLATE             = app
CONFIG                  += qt opengl stl warn_on release
HEADERS                 =
SOURCES                 = ogl.cpp
INCLUDEPATH             = ../../sdk/NVSDK/OpenGL/include/glh
TARGET                  = ogl

Seems pretty simple!


--
 [ signature omitted ] 

Message 6 in thread

>Here is my .pro file - am I missing anything?
>
>TEMPLATE             = app
>CONFIG                  += qt opengl stl warn_on release
>HEADERS                 =
>SOURCES                 = ogl.cpp
>INCLUDEPATH             = ../../sdk/NVSDK/OpenGL/include/glh
>TARGET                  = ogl
>
>Seems pretty simple!

On another note - I'm trying to build the same project on Macintosh now, 
using qmake, and qmake is not building the ogl.moc file for me. So the 
#include at the end of the ogl.cpp file fails, since the .moc is not 
getting created.

I thought qmake was supposed to recognize the Q_OBJECT stuff in the code 
and build .moc files for me automatically, as part of the Makefile?

What am I doing wrong? This part is working on Windows.


--
 [ signature omitted ] 

Message 7 in thread

On August 8, 2003 09:20 am, Paul Miller wrote:
> >Here is my .pro file - am I missing anything?
> >
> >TEMPLATE             = app
> >CONFIG                  += qt opengl stl warn_on release
> >HEADERS                 =
> >SOURCES                 = ogl.cpp
> >INCLUDEPATH             = ../../sdk/NVSDK/OpenGL/include/glh
> >TARGET                  = ogl
> >
> >Seems pretty simple!
>
> On another note - I'm trying to build the same project on Macintosh now,
> using qmake, and qmake is not building the ogl.moc file for me. So the
> #include at the end of the ogl.cpp file fails, since the .moc is not
> getting created.
>
> I thought qmake was supposed to recognize the Q_OBJECT stuff in the code
> and build .moc files for me automatically, as part of the Makefile?
>
> What am I doing wrong? This part is working on Windows.

Qmake, on Mac, does indeed generate the moc files for you automatically.  I 
know this as I use qmake on my Mac.

Try removing the existing Makefile.  Make sure you have the Q_OBJECT macro.  
And make sure if your class derives from multiple base classes, the Qt class 
is first on the list.


Message 8 in thread

> > What am I doing wrong? This part is working on Windows.
>
>Qmake, on Mac, does indeed generate the moc files for you automatically.  I
>know this as I use qmake on my Mac.

I expected it to - but it's not even writing the ogl.moc into the mocables 
in the Makefile.

>Try removing the existing Makefile.  Make sure you have the Q_OBJECT macro.
>And make sure if your class derives from multiple base classes, the Qt class
>is first on the list.

Yep - did all that. It's all good (like I mentioned, it builds the .moc on 
Windows - but on Windows, I have a different problem. I am using the 
"exceptions" config setting and it's not putting the -GX flag on my nmake 
build line).

For some reason, I expected all this to "just work".

--
 [ signature omitted ] 

Message 9 in thread

>Yep - did all that. It's all good (like I mentioned, it builds the .moc on 
>Windows - but on Windows, I have a different problem. I am using the 
>"exceptions" config setting and it's not putting the -GX flag on my nmake 
>build line).

AHA!!

Apparently qmake or the moc compiler has issues when the line-endings are 
Mac-style line endings. I removed all my code and rechecked out with UNIX 
line endings and it worked fine.

Weird - I would EXPECT it to be line-ending agnostic.


--
 [ signature omitted ] 

Message 10 in thread

On August 8, 2003 09:48 am, Paul Miller wrote:
> >Yep - did all that. It's all good (like I mentioned, it builds the .moc on
> >Windows - but on Windows, I have a different problem. I am using the
> >"exceptions" config setting and it's not putting the -GX flag on my nmake
> >build line).
>
> AHA!!
>
> Apparently qmake or the moc compiler has issues when the line-endings are
> Mac-style line endings. I removed all my code and rechecked out with UNIX
> line endings and it worked fine.
>
> Weird - I would EXPECT it to be line-ending agnostic.

What are Mac-style line-endings?  On Windows machines, they are CRLF, on Unix 
it is just a CR (or just a LF, I always forget).


Message 11 in thread

>What are Mac-style line-endings?  On Windows machines, they are CRLF, on Unix
>it is just a CR (or just a LF, I always forget).

"Mac" style line endings is CR, unix is LF.

qmake was detecting and processing mocs when the code has LFs, but not with 
CRs.

Sounds like the moc detector might be hard-coded to look for LFs and not 
the typical possible 3 combinations of line-endings. Parsers I write check 
for all 3 cases.


--
 [ signature omitted ]