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. How to make Dialog fit it's contents?
Forum Updated to NodeBB v4.3 + New Features

How to make Dialog fit it's contents?

Scheduled Pinned Locked Moved Mobile and Embedded
qmlqtquickqt 5.4.1dialog
1 Posts 1 Posters 769 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.
  • F Offline
    F Offline
    flashmozzg
    wrote on last edited by flashmozzg
    #1

    I have something like this:

    Dialog {
            id: dialog
            title: qsTr("Choose someText")
            standardButtons: StandardButton.Ok | StandardButton.Cancel
    
            Row {
                id: row
                spacing: 5
                Label {text: qsTr("this is someText:");anchors.verticalCenter: tf.verticalCenter}
                TextField {
                    id:tf
                    text: someText
                }
                Label {text: "text2";anchors.verticalCenter: tf.verticalCenter}
            }
        }
    

    But no matter what (changing spacing, commenting out labels), Dialog width always stays at 225 cutting part from leftmost label. In docs it said it should fit the content of it's content item but it doesn't! How to solve this? I don't want to recreate dialog with all of it's buttons and signals using window.
    P.S. sort of unrelated question: is there a way to wait until dialog is closed? For example if I want to use value retrieved from dialoge in signal, I want to .open() dialog and wait until it closes to send signal. connecting to onAccepted() won't work because I don't want to send this signal every time this dialog closes, only after I open it from specific place.

    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