Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Painting on top of QAxWidget

Painting on top of QAxWidget

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 718 Views 1 Watching
  • 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.
  • A Offline
    A Offline
    astodolski
    wrote on last edited by
    #1

    I host an ActiveX control which displays video. It is wrapped in QAxWidget. I try painting within QAxWidget but it always appears behind:

    @
    void MainWindow::paintEvent(QPaintEvent* e)
    {
    QMainWindow::paintEvent(e);
    QPainter p(this);
    p.setPen(Qt::red);
    p.drawRect(10,10,100,100);
    p.end();
    }
    @

    I can see the left top and left bottom corners of the rect to know it's drawn but don't understand how to get the z-order changed. The items are laid out in QDesigner. Below is some of the derived header from the UI compiler:

    ui_mainwindow.h
    @
    centralWidget = new QWidget(MainWindow);
    centralWidget->setObjectName(QStringLiteral("centralWidget"));
    gridLayout = new QGridLayout(centralWidget);
    gridLayout->setSpacing(6);
    gridLayout->setContentsMargins(11, 11, 11, 11);
    gridLayout->setObjectName(QStringLiteral("gridLayout"));
    HDVideo = new QAxWidget(centralWidget);
    HDVideo->setControl(QStringLiteral("{cb1671db-6c24-4c48-b5f9-8276d135501e}"));
    HDVideo->setObjectName(QStringLiteral("HDVideo"));

        gridLayout->addWidget(HDVideo, 0, 0, 1, 1);
    

    @

    I've tried calling ui->HDVideo->lower as well as ui->HDVideo->stackUnder(this) which doesn't work. How can you paint on a QAxWidget?

    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