summaryrefslogtreecommitdiffstats
path: root/doc/html/customstyles.html
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-26 23:32:43 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-26 23:32:43 -0600
commitea318d1431c89e647598c510c4245c6571aa5f46 (patch)
tree996d29b80c30d453dda86d1a23162d441628f169 /doc/html/customstyles.html
parentaaf89d4b48f69c9293feb187db26362e550b5561 (diff)
downloadtqt3-ea318d1431c89e647598c510c4245c6571aa5f46.tar.gz
tqt3-ea318d1431c89e647598c510c4245c6571aa5f46.zip
Update to latest tqt3 automated conversion
Diffstat (limited to 'doc/html/customstyles.html')
-rw-r--r--doc/html/customstyles.html74
1 files changed, 37 insertions, 37 deletions
diff --git a/doc/html/customstyles.html b/doc/html/customstyles.html
index 47e6afc4..541b5ee3 100644
--- a/doc/html/customstyles.html
+++ b/doc/html/customstyles.html
@@ -54,16 +54,16 @@ applications.
<a name="1-1"></a><p> The first step is to pick one of the base styles provided with TQt to
build your custom style from. The choice will depend on what look and
feel you are trying to achieve. We recommend that you choose from the
-<a href="qwindowsstyle.html">TQWindowsStyle</a> derived classes or the <a href="qmotifstyle.html">TQMotifStyle</a> derived classes.
+<a href="ntqwindowsstyle.html">TQWindowsStyle</a> derived classes or the <a href="ntqmotifstyle.html">TQMotifStyle</a> derived classes.
These are the two base look and feel classes in the TQt style engine.
-Inheriting directly from <a href="qcommonstyle.html">TQCommonStyle</a> is also an option if you want to
+Inheriting directly from <a href="ntqcommonstyle.html">TQCommonStyle</a> is also an option if you want to
start almost from scratch when implementing your style. In this simple
example we will inherit from TQWindowsStyle.
<p> <h3> 2. Re-implement the necessary functions in your derived class.
</h3>
<a name="1-2"></a><p> Depending on which parts of the base style you want to change, you
must re-implement the functions that are used to draw those parts
-of the interface. If you take a look at the <a href="qstyle.html">TQStyle</a> documentation,
+of the interface. If you take a look at the <a href="ntqstyle.html">TQStyle</a> documentation,
you will find a list of the different primitives, controls and complex
controls. In this example we will first change the look of the
standard arrows that are used in the TQWindowsStyle. The arrows are
@@ -71,17 +71,17 @@ PrimitiveElements that are drawn by the drawPrimitive() function,
so we need to re-implement that function. We need the following class
declaration:
<p> <pre>
-#include &lt;<a href="qwindowsstyle-h.html">qwindowsstyle.h</a>&gt;
+#include &lt;<a href="qwindowsstyle-h.html">ntqwindowsstyle.h</a>&gt;
-class CustomStyle : public <a href="qwindowsstyle.html">TQWindowsStyle</a> {
+class CustomStyle : public <a href="ntqwindowsstyle.html">TQWindowsStyle</a> {
<a href="metaobjects.html#Q_OBJECT">Q_OBJECT</a>
public:
CustomStyle();
~CustomStyle();
void drawPrimitive( PrimitiveElement pe,
- <a href="qpainter.html">TQPainter</a> *p,
- const <a href="qrect.html">TQRect</a> &amp; r,
+ <a href="ntqpainter.html">TQPainter</a> *p,
+ const <a href="ntqrect.html">TQRect</a> &amp; r,
const <a href="qcolorgroup.html">TQColorGroup</a> &amp; cg,
SFlags flags = Style_Default,
const <a href="qstyleoption.html">TQStyleOption</a> &amp; = TQStyleOption::Default ) const;
@@ -94,10 +94,10 @@ private:
</pre>
<p> Note that we disable the copy constructor and the '=' operator for our
-style. <a href="qobject.html">TQObject</a> is the base class for all style classes in TQt, and a
+style. <a href="ntqobject.html">TQObject</a> is the base class for all style classes in TQt, and a
TQObject inherently cannot be copied since there are some aspects of it
that are not copyable.
-<p> From the <a href="qstyle.html">TQStyle</a> docs we see that <tt>PE_ArrowUp</tt>, <tt>PE_ArrowDown</tt>, <tt>PE_ArrowLeft</tt> and <tt>PE_ArrowRight</tt> are the primitives we need to do
+<p> From the <a href="ntqstyle.html">TQStyle</a> docs we see that <tt>PE_ArrowUp</tt>, <tt>PE_ArrowDown</tt>, <tt>PE_ArrowLeft</tt> and <tt>PE_ArrowRight</tt> are the primitives we need to do
something with. We get the following in our drawPrimitive() function:
<p> <pre>
CustomStyle::CustomStyle()
@@ -109,44 +109,44 @@ CustomStyle::~CustomStyle()
}
void CustomStyle::drawPrimitive( PrimitiveElement pe,
- <a href="qpainter.html">TQPainter</a> * p,
- const <a href="qrect.html">TQRect</a> &amp; r,
+ <a href="ntqpainter.html">TQPainter</a> * p,
+ const <a href="ntqrect.html">TQRect</a> &amp; r,
const <a href="qcolorgroup.html">TQColorGroup</a> &amp; cg,
SFlags flags,
const <a href="qstyleoption.html">TQStyleOption</a> &amp; opt ) const
{
// we are only interested in the arrows
if (pe &gt;= PE_ArrowUp &amp;&amp; pe &lt;= PE_ArrowLeft) {
- <a href="qpointarray.html">TQPointArray</a> pa( 3 );
+ <a href="ntqpointarray.html">TQPointArray</a> pa( 3 );
// make the arrow cover half the area it is supposed to be
// painted on
- int x = r.<a href="qrect.html#x">x</a>();
- int y = r.<a href="qrect.html#y">y</a>();
- int w = r.<a href="qrect.html#width">width</a>() / 2;
- int h = r.<a href="qrect.html#height">height</a>() / 2;
- x += (r.<a href="qrect.html#width">width</a>() - w) / 2;
- y += (r.<a href="qrect.html#height">height</a>() - h) /2;
+ int x = r.<a href="ntqrect.html#x">x</a>();
+ int y = r.<a href="ntqrect.html#y">y</a>();
+ int w = r.<a href="ntqrect.html#width">width</a>() / 2;
+ int h = r.<a href="ntqrect.html#height">height</a>() / 2;
+ x += (r.<a href="ntqrect.html#width">width</a>() - w) / 2;
+ y += (r.<a href="ntqrect.html#height">height</a>() - h) /2;
switch( pe ) {
case PE_ArrowDown:
- pa.<a href="qpointarray.html#setPoint">setPoint</a>( 0, x, y );
- pa.<a href="qpointarray.html#setPoint">setPoint</a>( 1, x + w, y );
- pa.<a href="qpointarray.html#setPoint">setPoint</a>( 2, x + w / 2, y + h );
+ pa.<a href="ntqpointarray.html#setPoint">setPoint</a>( 0, x, y );
+ pa.<a href="ntqpointarray.html#setPoint">setPoint</a>( 1, x + w, y );
+ pa.<a href="ntqpointarray.html#setPoint">setPoint</a>( 2, x + w / 2, y + h );
break;
case PE_ArrowUp:
- pa.<a href="qpointarray.html#setPoint">setPoint</a>( 0, x, y + h );
- pa.<a href="qpointarray.html#setPoint">setPoint</a>( 1, x + w, y + h );
- pa.<a href="qpointarray.html#setPoint">setPoint</a>( 2, x + w / 2, y );
+ pa.<a href="ntqpointarray.html#setPoint">setPoint</a>( 0, x, y + h );
+ pa.<a href="ntqpointarray.html#setPoint">setPoint</a>( 1, x + w, y + h );
+ pa.<a href="ntqpointarray.html#setPoint">setPoint</a>( 2, x + w / 2, y );
break;
case PE_ArrowLeft:
- pa.<a href="qpointarray.html#setPoint">setPoint</a>( 0, x + w, y );
- pa.<a href="qpointarray.html#setPoint">setPoint</a>( 1, x + w, y + h );
- pa.<a href="qpointarray.html#setPoint">setPoint</a>( 2, x, y + h / 2 );
+ pa.<a href="ntqpointarray.html#setPoint">setPoint</a>( 0, x + w, y );
+ pa.<a href="ntqpointarray.html#setPoint">setPoint</a>( 1, x + w, y + h );
+ pa.<a href="ntqpointarray.html#setPoint">setPoint</a>( 2, x, y + h / 2 );
break;
case PE_ArrowRight:
- pa.<a href="qpointarray.html#setPoint">setPoint</a>( 0, x, y );
- pa.<a href="qpointarray.html#setPoint">setPoint</a>( 1, x, y + h );
- pa.<a href="qpointarray.html#setPoint">setPoint</a>( 2, x + w, y + h / 2 );
+ pa.<a href="ntqpointarray.html#setPoint">setPoint</a>( 0, x, y );
+ pa.<a href="ntqpointarray.html#setPoint">setPoint</a>( 1, x, y + h );
+ pa.<a href="ntqpointarray.html#setPoint">setPoint</a>( 2, x + w, y + h / 2 );
break;
default: break;
@@ -155,16 +155,16 @@ void CustomStyle::drawPrimitive( PrimitiveElement pe,
// use different colors to indicate that the arrow is
// enabled/disabled
if ( flags &amp; Style_Enabled ) {
- p-&gt;<a href="qpainter.html#setPen">setPen</a>( cg.<a href="qcolorgroup.html#mid">mid</a>() );
- p-&gt;<a href="qpainter.html#setBrush">setBrush</a>( cg.<a href="qcolorgroup.html#brush">brush</a>( TQColorGroup::ButtonText ) );
+ p-&gt;<a href="ntqpainter.html#setPen">setPen</a>( cg.<a href="qcolorgroup.html#mid">mid</a>() );
+ p-&gt;<a href="ntqpainter.html#setBrush">setBrush</a>( cg.<a href="qcolorgroup.html#brush">brush</a>( TQColorGroup::ButtonText ) );
} else {
- p-&gt;<a href="qpainter.html#setPen">setPen</a>( cg.<a href="qcolorgroup.html#buttonText">buttonText</a>() );
- p-&gt;<a href="qpainter.html#setBrush">setBrush</a>( cg.<a href="qcolorgroup.html#brush">brush</a>( TQColorGroup::Mid ) );
+ p-&gt;<a href="ntqpainter.html#setPen">setPen</a>( cg.<a href="qcolorgroup.html#buttonText">buttonText</a>() );
+ p-&gt;<a href="ntqpainter.html#setBrush">setBrush</a>( cg.<a href="qcolorgroup.html#brush">brush</a>( TQColorGroup::Mid ) );
}
- p-&gt;<a href="qpainter.html#drawPolygon">drawPolygon</a>( pa );
+ p-&gt;<a href="ntqpainter.html#drawPolygon">drawPolygon</a>( pa );
} else {
// let the base style handle the other primitives
- TQWindowsStyle::<a href="qstyle.html#drawPrimitive">drawPrimitive</a>( pe, p, r, cg, flags, data );
+ TQWindowsStyle::<a href="ntqstyle.html#drawPrimitive">drawPrimitive</a>( pe, p, r, cg, flags, data );
}
}
</pre>
@@ -179,7 +179,7 @@ application's main() function:
int main( int argc, char ** argv )
{
- TQApplication::<a href="qapplication.html#setStyle">setStyle</a>( new CustomStyle() );
+ TQApplication::<a href="ntqapplication.html#setStyle">setStyle</a>( new CustomStyle() );
// do the usual routine on creating your TQApplication object etc.
}
</pre>