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. QWidget top level widget
Forum Updated to NodeBB v4.3 + New Features

QWidget top level widget

Scheduled Pinned Locked Moved Unsolved General and Desktop
21 Posts 5 Posters 2.4k Views 3 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 Alexey Serebryakov

    @mrjj is it correct code?

    class Widget : public QWidget
    {
        Q_OBJECT
    public:
         Widget(QWidget *parent = nullptr) : QWidget(parent, Qt::Window) {}
        ~Widget();
    };
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
    
        Widget w1;
        Widget w2;
    
        w1.show();
        w1.windowHandle()->setScreen(QApplication::screens()[0]);
    
        w2.show();
        w2.windowHandle()->setScreen(QApplication::screens()[1]);
    
        return a.exec();
    }
    
    Z Offline
    Z Offline
    zoujiu
    wrote on last edited by
    #21

    @Alexey-Serebryakov thank you

    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