Results 1 to 5 of 5

Thread: problem with stroking demo.

  1. #1
    Join Date
    Jan 2006
    Location
    Riverside, Rhode Island, USA
    Posts
    245
    Thanks
    52
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default problem with stroking demo.

    I'm running Qt4.1.4 in Kubuntu 6.06 distro.

    I am trying to learn.......

    I setup the "Path Stroking" demo as suggested in the Qpen "more".

    when I run "make" after generating the "Makefile" of course, the "arthurwidget.h" is missing error comes up. What do i need?.

    thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: problem with stroking demo.

    You can find working pathstroke demo in $QTDIR/demos/pathstroke. Missing classes are in $QTDIR/demos/shared.

  3. The following user says thank you to jacek for this useful post:

    impeteperry (5th July 2006)

  4. #3
    Join Date
    Jan 2006
    Location
    Riverside, Rhode Island, USA
    Posts
    245
    Thanks
    52
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: problem with stroking demo.

    I must be blind.
    The demo is beautiful and I like the layout, but it would be much more helpful to someone learning, to have a straight line (or lines ) from point a to point b and show the code for the line type elected.

    It takes a lot of time to decipher the code when all you want is the "setPen(......)" code to appliy to the lines in your code. somthing like
    Qt Code:
    1. QPen pen;
    2. QVector<qreal> dashes;
    3. qreal space = 4;
    4.  
    5. dashes << 1 << space << 3 << space << 9 << space
    6. << 27 << space << 9;
    7.  
    8. pen.setDashPattern(dashes);
    To copy to clipboard, switch view to plain text mode 
    in the documentation, but specific to the lines in the demo.

    Is there a way to set "dashDot" line that is not dependent on line width?

    Thanks

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: problem with stroking demo.

    Quote Originally Posted by impeteperry
    Is there a way to set "dashDot" line that is not dependent on line width?
    Maybe something like this?
    Qt Code:
    1. pen.setStyle( Qt::DashDotLine );
    To copy to clipboard, switch view to plain text mode 

  6. The following user says thank you to jacek for this useful post:

    impeteperry (5th July 2006)

  7. #5
    Join Date
    Jan 2006
    Location
    Riverside, Rhode Island, USA
    Posts
    245
    Thanks
    52
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: problem with stroking demo.

    Quote Originally Posted by jacek
    Maybe something like this?
    Qt Code:
    1. pen.setStyle( Qt::DashDotLine );
    To copy to clipboard, switch view to plain text mode 
    Thanks, I had tried that but spaces too small so I tried this,
    Qt Code:
    1. QPainter painter( this );
    2.  
    3. QPen pen(Qt::blue, 0, Qt::DashLine);
    4. painter.setPen(pen);
    5.  
    6. for( n = 0; n < paintLines.count(); ++n )
    7. {
    To copy to clipboard, switch view to plain text mode 
    I want a thin line "0" and the length of the spaces. that a line width of 3 would give me. Now I am aware that QPen doc. has
    Qt Code:
    1. QPen pen;
    2. QVector<qreal> dashes;
    3. qreal space = 4;
    4.  
    5. dashes << 1 << space << 3 << space << 9 << space
    6. << 27 << space << 9;
    7.  
    8. pen.setDashPattern(dashes);
    To copy to clipboard, switch view to plain text mode 
    , but the demo doesn't go into this and in addition we have anothrer widget "QVector" and "qreal" instead of "single" or "double". I assume this will display the same line regardless of screen resolution?.Will Let you know how i make out

    thanks,
    pete

Similar Threads

  1. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  2. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  3. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.