Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. 2dpainting

2dpainting

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 173 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shao
    wrote on last edited by
    #1

    Hi,
    I can build and run the example "2dpainting" on my Host PC (Ubuntu20.04).
    opengl.png

    I copy the whole example directory to my embedded device (google-coral dev board).
    I can build the example project but run uncorrect.
    It show my the whole black window.
    black.jpg
    I add some related library in 2dpaint.pro

    LIBS += -lGLESv2 -lm -lEGL -lwayland-client -lwayland-egl
    
    

    make.jpg
    It show something, but some color in opengl is wrong.
    So I change some code in helper.cpp paint brush in exmaple.
    ex:

        QLinearGradient gradient(QPointF(50, -20), QPointF(80, 20));
        gradient.setColorAt(0.0, Qt::white);
        gradient.setColorAt(1.0, QColor(0xa6, 0xce, 0x39));
    
        background = QBrush(QColor(64, 32, 64));
        circleBrush = QBrush(gradient);
        circlePen = QPen(Qt::black);
        circlePen.setWidth(1);
        textPen = QPen(Qt::white);
        textFont.setPixelSize(50);
    

    change to

    /*
        QLinearGradient gradient(QPointF(50, -20), QPointF(80, 20));
        gradient.setColorAt(0.0, QColor(255,255,255));
        gradient.setColorAt(1.0, QColor(0xa6, 0xce, 0x39));
    */
    
        background = QBrush(QColor(64, 32, 64));
        circleBrush = QBrush(QColor(0xa6,0xce,0x39));
        circlePen = QPen(Qt::black);
        circlePen.setWidth(1);
        textPen = QPen(Qt::red);  //white is also work
        textFont.setPixelSize(50);
    

    red.jpg

    Here is two problem

    1. How to fix QLinearGradient ?
    2. How to cancel the white background on text(Qt) ?
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved