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. Plugin Dll with QWinWidget not showing any content
Forum Updated to NodeBB v4.3 + New Features

Plugin Dll with QWinWidget not showing any content

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.3k 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.
  • 0 Offline
    0 Offline
    0matic
    wrote on last edited by
    #1

    Hi,

    I'm trying to create a plugin for a Windows program and would like to use Qt. I found the Qt-winmigrate solution and tried it.

    I have no problem opening a QMessageBox like this:
    @QWinWidget win1( static_cast<HWND>(m_LocalPIWin) );
    win1.showCentered();
    QMessageBox::about( &win, "About QtMfc", "QtMfc Version 1.0\nCopyright (C) 2003" );@

    But when I try to create the QWinWidget with its children inside of the given parent I can't see any content.
    @HWND hWnd = static_cast<HWND>(m_LocalPIWin);
    QWinWidget win(hWnd);
    HWND winId = (HWND)win.winId();
    QHBoxLayout hbox(&win);
    hbox.setSpacing(5);
    hbox.setMargin(0);
    QPushButton *pb = new QPushButton("Qt command button", &win);
    pb->setObjectName("pb");
    hbox.addWidget(pb);
    QLabel *label = new QLabel("Some label", &win);
    label->setObjectName("label");
    hbox.addWidget(label);
    QLineEdit *le1 = new QLineEdit(&win);
    le1->setObjectName("le1");
    hbox.addWidget(le1);
    QLineEdit *le2 = new QLineEdit(&win);
    le1->setObjectName("le2");
    hbox.addWidget(le2);
    QLineEdit *le3 = new QLineEdit(&win);
    le1->setObjectName("le3");
    hbox.addWidget(le3);

    win.move(0, 0);
    win.show();
    
    ShowWindow(hWnd, SW_SHOWNORMAL);
    UpdateWindow(hWnd);@
    

    I'm pretty lost on this one. Any advise?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Do you have a QApplication anywhere in your code prior to loading your plugin ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        zeroobligation
        wrote on last edited by
        #3

        Hi Omatic. I am running into the same problem as you. Did you ever find a solution to this?

        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