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. [SOLVED] QInputDialog::getDouble : Width issue
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] QInputDialog::getDouble : Width issue

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.0k 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.
  • A Offline
    A Offline
    Anthony Fr
    wrote on last edited by
    #1

    Hi everybody,

    I'm upgrading my software from Qt 4.7.4 to Qt 5.4.0 Beta (I'm waiting for the release the 4th Dec).

    I find a weird issue and I want to be sure it's not a mistake from myself before post a bug report.

    If I call the method QInputDialog::getDouble (from the context menu of my QGLWidget inherited class) like that:
    @
    void CViewer3D_v2::ZFar()
    {
    bool ok;
    double value = QInputDialog::getDouble(this, "zFar", "Enter a decimal number", xd_ZFar, 0, DBL_MAX, 2, &ok);
    if(ok)
    {
    SetZFar(value);
    }
    }
    @

    The dialog has a really big width, more than my screen can display, I think it's something like 1800px.
    Although, if I call in the same context QInputDialog::getInt method, I don't get any trouble.

    Have any idea, please?

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

      Hi,

      Intriguing, can you reproduce this with a minimal compilable example ?

      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
      • A Offline
        A Offline
        Anthony Fr
        wrote on last edited by
        #3

        Hi,

        Yes, I can. If I create an empty project and the same lines, I get the same width issue:
        @
        #include "qinputdialogtest.h"

        #include <QInputDialog>

        QInputDialogTest::QInputDialogTest(QWidget *parent)
        : QMainWindow(parent)
        {
        ui.setupUi(this);
        bool ok;
        double value = QInputDialog::getDouble(this, "zFar", "Enter a decimal number", 30., 0, DBL_MAX, 2, &ok);
        }
        @

        Here the result on my screens:
        !http://imgur.com/MQU5gpF(QInputDialog::getDouble UI result)!

        Edit: I failed to post the image, please follow this link imgur link:
        "http://imgur.com/MQU5gpF":http://imgur.com/MQU5gpF

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

          Looks like it's because of DBL_MAX. Most likely, the widget is expanded to allow showing the maximum double value which it pretty big.

          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

          • Login

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