Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Positioning of QMessageBox::information
Qt 6.12 LTS is out! See what's new in the release blog

Positioning of QMessageBox::information

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 633 Views 2 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.
  • PerdrixP Offline
    PerdrixP Offline
    Perdrix
    wrote on last edited by Perdrix
    #1

    Using following code:

    QString message{ tr("Total stacking time: %1").arg(exposureToString(elapsed.count())) };
    QMessageBox::information(this, "DeepSkyStacker", message, QMessageBox::Ok, QMessageBox::Ok);
    

    *this is a QWidget. Messagebox doesn't appear in front of it though - it opens near to top left of desktop.

    What am I missing?

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

      Hi,

      What is this ?
      Where is it located ?
      Which OS ?
      If Linux, which desktop environment ?

      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
      • PerdrixP Offline
        PerdrixP Offline
        Perdrix
        wrote on last edited by Perdrix
        #3

        It's on Win 10 what extra details do you want? If it helps any here's the code that sets things up once the initial CDialog subclass is opened.

        "*this" in the question is the stackingDlg object of class type DSS::StackingDlg which is a QWidget sub-class

        BOOL CDeepStackerDlg::OnInitDialog()
        {
        	CDialog::OnInitDialog();
        	CRect rect;
        	GetWindowRect(&rect);
        
        	widget = new QWinWidget(this);
        	QVBoxLayout* verticalLayout { new QVBoxLayout(widget) };
        	verticalLayout->setObjectName("verticalLayout");
        
        	splitter = new QSplitter(Qt::Horizontal, widget);
        	splitter->setObjectName("splitter");
        
        	explorerBar = new ExplorerBar(splitter);
        	explorerBar->setObjectName("explorerBar");
        	splitter->addWidget(explorerBar);
        
        	stackedWidget = new QStackedWidget(splitter);
        	stackedWidget->setObjectName("stackedWidget");
        	splitter->addWidget(stackedWidget);
        
        	stackingDlg = new DSS::StackingDlg(stackedWidget);
        	stackingDlg->setObjectName("stackingDlg");
        
        	stackedWidget->addWidget(stackingDlg);
        	stackedWidget->setCurrentWidget(stackingDlg);
        
        

        Thanks, David

        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
        • Unsolved