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. Window flags equivalent to Qt::SubWindow?
Forum Updated to NodeBB v4.3 + New Features

Window flags equivalent to Qt::SubWindow?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.4k 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.
  • CAD_codingC Offline
    CAD_codingC Offline
    CAD_coding
    wrote on last edited by
    #1

    Hi,
    I want to set window flags to QMessageBox such that I want to show title bar but none of the buttons like close, minmax, help, etc buttons on it.
    So I got the same results by using Qt::SubWindow as a window flag.
    But I am getting a qWarning() whenever the messagebox is displayed. The error is

    @setGeometry: Unable to set geometry 327x69+355+94 on QWidgetWindow/'QMessageBoxClassWindow'. Resulting geometry: 333x93+355+94 (frame: 0, 0, 0, 0, custom margin: 0, 0, 0, 0, minimum size: 327x69, maximum size: 327x69).@

    So I would like to know any other possible combination of flags which gives the same results?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      Hi,

      this code

      @void Widget::on_pushButton_clicked()
      {
      QMessageBox dlg(this);

      Qt::WindowFlags flags = dlg.windowFlags();
      qDebug("FLAGS: %X", flags);
      flags &= ~Qt::WindowCloseButtonHint;
      flags &= ~Qt::WindowSystemMenuHint;
      flags |= Qt::CustomizeWindowHint;
      
      qDebug("FLAGS: %X", flags);
      dlg.setWindowFlags(flags);
      
      dlg.setIcon(QMessageBox::Information);
      dlg.setText("Hello");
      dlg.exec();
      

      }
      @

      works for me

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      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