Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. French
  4. Création de fenêtres avec des widget
Qt 6.11 is out! See what's new in the release blog

Création de fenêtres avec des widget

Scheduled Pinned Locked Moved Unsolved French
2 Posts 2 Posters 85 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.
  • L Offline
    L Offline
    lacombe
    wrote last edited by
    #1

    Bonjour,
    Lorsque j'utilise "Window" en paramètre la fenêtre enfant ne s'affiche pas.
    Voici le code:

    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
     
        QWidget *Window = new QWidget();
        Window->setWindowTitle("Fenêtre parent");
         Window->setGeometry(10,10,600,400);
       Window->show();
    
    
        QWidget *childWindow = new QWidget(Window); 
        childWindow->setWindowTitle("Fenêtre enfant");
        childWindow->setGeometry(20,20,300,200);
        childWindow->show();
    
    
        return QCoreApplication::exec();
    
    Merci de votre aide.
    
    JonBJ 1 Reply Last reply
    0
    • L lacombe

      Bonjour,
      Lorsque j'utilise "Window" en paramètre la fenêtre enfant ne s'affiche pas.
      Voici le code:

      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
       
          QWidget *Window = new QWidget();
          Window->setWindowTitle("Fenêtre parent");
           Window->setGeometry(10,10,600,400);
         Window->show();
      
      
          QWidget *childWindow = new QWidget(Window); 
          childWindow->setWindowTitle("Fenêtre enfant");
          childWindow->setGeometry(20,20,300,200);
          childWindow->show();
      
      
          return QCoreApplication::exec();
      
      Merci de votre aide.
      
      JonBJ Offline
      JonBJ Offline
      JonB
      wrote last edited by JonB
      #2

      @lacombe said in Création de fenêtres avec des widget:

      return QCoreApplication::exec();

      QCoreApplication Class

      The QCoreApplication class provides an event loop for Qt applications without UI.

      ?

      QApplication a(argc, argv);
      ...
      return a.exec();
      
      1 Reply Last reply
      1
      • SGaistS SGaist moved this topic from General and Desktop

      • Login

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