Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QGLWidget + QInputDialog
QtWS25 Last Chance

QGLWidget + QInputDialog

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 1 Posters 1.5k 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.
  • M Offline
    M Offline
    matti-
    wrote on last edited by
    #1

    (repost from qt-android list..)

    My app is a QGLWidget based fully opengl app which is now running otherwise
    rather smoothly on samsung galaxy s3. The only bit of regular UI in the app is a QInputDialog I'm trying to use for asking forsimple text user input in the following fashion:

    @ QString text = QInputDialog::getText(const_cast<GLWidget*>(this),
    tr("Enter your name"), tr("Enter your name"),
    QLineEdit::Normal, defaultText);
    qDebug() << "QueryUserName(): " << text;@

    the entire screen just goes black. No controls are visible. however when tapping on the screen it
    seems to find the input field since the keyboard appears and it accepts the
    text properly (can see this from the log line). I'm calling this from within QGLWidget::paintGL(), would this be a bad thing?

    the screen never recovers even after the dialog apparently closes, and the
    screen remains all black, even though I resume the opengl rendering (= restart the update timer). :o

    And If I dont stop the opengl rendering, the whole app crashes after some
    seconds after introducing the QInputDialog..

    Tried calling this (found it via googling..):

    @setStyleSheet( "QMenu {background-color: rgba(255,255,255,255);}" );@

    but it doesnt change anything.

    So the question is, what's the proper way to ask for user input in a
    QGLWidget app? I realize I'm a bit of a noob when it comes to mobile UI stuff with Qt..

    • M

    Author of <a href="http://mmark.777-team.org/">MMark13</a>

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

      Wonder if this is outdated or should I use this approach and skip the QInputDialog?

      http://doc.qt.digia.com/qq/qq26-openglcanvas.html#turbocharginggraphicsview

      Author of <a href="http://mmark.777-team.org/">MMark13</a>

      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