Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
|
|
Source code |
1 |
MyDialog dlg(this); |
|
|
Source code |
1 |
MyDialog *dlg = new MyDialog(this); |
Quoted
Originally posted by Marrt
actually, there is another question: how to make a qColorDialog appear?
|
|
Source code |
1 |
QColor color = QColorDialog::getColor(); |
This post has been edited 1 times, last edit by "wysota" (Jul 29th 2004, 10:13am)
Quoted
Originally posted by Marrt
how can i map a Qcolor to int and back? that would be very very helpful.
|
|
Source code |
1 2 |
darstellung_LbyL windowLbyL = new darstellung_LbyL(this); windowLbyL.create(dataDialog); |
|
|
Source code |
1 2 |
darstellung_LbyL *windowLbyL = new darstellung_LbyL(this); windowLbyL->create(dataDialog); |
|
|
Source code |
1 2 3 4 5 6 7 8 9 |
darstellung_LbyL::create(Datendialog &dataDialog)
{
// some labels
...
exec(); //show();
...
// visualization part
...
}
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 |
darstellung_LbyL::create(Datendialog &dataDialog)
{
// some labels
...
// visualization part
...
exec(); //show();
}
|
Quoted
what's about Qrgb? this seems to be a pixel value. no chance to "int" it?
but then, how do i define a function set returns a QColor?
|
|
Source code |
1 2 |
QRGB myint; QColor color(myint); |
Quoted
but in that case (i tried it), the window is shown and all the labels, but NOT my painter-visualization.
Quoted
ok thanks. if i have the rgb-values of a color, how do i translate them into the corresponding qrgb? 255255255 doesnt work correct, i think.
Quoted
Originally posted by Marrt
so the first two digits stand for the r-value (00-FF), the next two for the g and the last two for b?
Quoted
so i only have to:
convert color-parts decimal->hex?
concat them
convert whole thing in decimal
save in an array
read out
convert into hex
read the rgb-values out
convert them to dec?
|
|
Source code |
1 |
QColor col(255, 255, 0); |
|
|
Source code |
1 2 3 4 5 |
QColor col(0xff, 0xff, 0x0;[/quote] or to change an existing colour: [code]QColor col; col.setRgb(255,255,0); |
|
|
Source code |
1 2 3 4 5 |
uint r, g, b; QColor col; r = col.red(); g = col.green(); b = col.blue(); |
|
|
Source code |
1 |
QRgb rgb = col.rgb(); |
|
|
Source code |
1 2 |
QRgb rgb = 0xffff00; // yellow QColor col(rgb); // make col yellow |