Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Impossible to show a dialog box with a title bar under Android
Forum Updated to NodeBB v4.3 + New Features

Impossible to show a dialog box with a title bar under Android

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 903 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.
  • F Offline
    F Offline
    Francky033
    wrote on last edited by
    #1

    Hello,
    Impossible to show a dialog box with a title bar under Android (runs fine on windows, macos, linux) ...

    QDialog *boite = new QDialog(this);
    	boite->setWindowTitle(tr("Help..."));
    	Qt::WindowFlags flags = 0;
    	
    	flags |= Qt::Dialog | Qt::WindowTitleHint |
    		Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint;
    
    	boite->setWindowFlags(flags);
    
    	QTextEdit *srctext = new QTextEdit(boite);
    	srctext->setAcceptRichText(true);
    	srctext->setText(
    		tr("blalbla"));
    	srctext->setTextBackgroundColor(QColor(50, 50, 50, 200));
    	QScrollBar *scrollbar = new QScrollBar(srctext);
    	scrollbar->setFixedWidth(15);
    	srctext->setVerticalScrollBar(scrollbar);
    	srctext->setReadOnly(true);
    	srctext->setMaximumHeight(300);
    	boite->setFixedWidth(450);
    	boite->setFixedHeight(300);
    	srctext->setMinimumWidth(450);
    	srctext->setMinimumHeight(300);
    
    	boite->setModal(false);
    	boite->showNormal();
    

    How to solve the problem?

    Thanks !

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by sierdzio
      #2

      Android does not support multiple windows and it's windowing system does not add any title bars. If you want to show a component/ widget with title bar, you need to draw it yourself. Or call native Android calls to show some popup, if your use case is simple enough.

      (Z(:^

      1 Reply Last reply
      1
      • F Offline
        F Offline
        Francky033
        wrote on last edited by
        #3

        Thank siedzio for your response... I'll try to find another solution.

        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