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. mac: QMessageBox setMinimumHeight / Width doesn't work??

mac: QMessageBox setMinimumHeight / Width doesn't work??

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 541 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.
  • D Offline
    D Offline
    davecotter
    wrote on last edited by
    #1

    my dialog from xcode looks the way i want it:
    0_1557209237926_Screen Shot 2019-05-06 at 11.06.12 PM.png
    Nice and large, buttons spaced exactly how the spec requires.
    When i attempt to implement in Qt, it auto resizes like this:
    0_1557209288500_Screen Shot 2019-05-06 at 11.05.48 PM.png
    now, at the constructor of the dialog i call this:

    i_qDlg.setMinimumHeight(200);
    i_qDlg.setMinimumWidth(480);
    

    yet these calls are totally ignored? why?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      davecotter
      wrote on last edited by
      #4

      i just need to write my own dialog, and not use QMessageBox

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

        Hi,

        Can you show the full code you are using to setup and show this dialog ?

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

          missing some but here's the gist:

          QtDefaultWindowFlags are:
          		  Qt::Window 
          		| Qt::CustomizeWindowHint	//	this flag prevents user resizing
          		| Qt::WindowTitleHint
          		| Qt::Dialog;
          
          
          QMessageBox		i_qDlg;
          
          i_qDlg(
          	QMessageBox::NoIcon, 
          	QString(), QString(), 
          	QMessageBox::NoButton, NULL, 
          	QtDefaultWindowFlags()),
          
          i_qDlg.setText(i_quick3CheckRec.titleStr);
          i_qDlg.setInformativeText(i_quick3CheckRec.messageStr);
          i_qDlg.setMinimumHeight(200);
          i_qDlg.setMinimumWidth(482);
          
          QHBoxLayout		*layoutP = NULL;
          
          {
          	QList<QHBoxLayout *>		list(i_qDlg.findChildren<QHBoxLayout *>());
          	
          	CF_ASSERT(list.size() == 1);
          	layoutP = list[0];
          }
          
          for (int _indexS: KQuick3_Result_NUMTYPES) {
          	DialogItemIndex		itemS = Q3C_ItemID_Button_1 - _indexS;
          	const SuperString&	buttonStr(i_quick3CheckRec.buttonRecA[_indexS].buttonStr);
          
          	if (buttonStr.empty()) {
          			layoutP->addSpacing(80);
          		//	i_pushButtonA[_indexS] = i_qDlg.addButton("", QMessageBox::ActionRole);
          		//	i_pushButtonA[_indexS]->hide();
          	} else {
          		i_pushButtonA[_indexS] = i_qDlg.addButton(buttonStr, QMessageBox::ActionRole);
          	}
          }
          
          i_qDlg.Run();
          
          1 Reply Last reply
          0
          • D Offline
            D Offline
            davecotter
            wrote on last edited by
            #4

            i just need to write my own dialog, and not use QMessageBox

            1 Reply Last reply
            1

            • Login

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