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. How to update promoted widget of new window when show it?
Forum Updated to NodeBB v4.3 + New Features

How to update promoted widget of new window when show it?

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 1.2k 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.
  • B Offline
    B Offline
    beqa
    wrote on last edited by A Former User
    #1

    I can't access this private ui ,like this

    newWindow->ui->widget ->update();
    newWindow->show();
    

    What can i do?

    Edit: Added code tags -- @Wieland

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

      Hi @beqa

      What about adding showEvent function on your promoted widget source ?

      http://doc.qt.io/qt-5/qwidget.html#showEvent

      1 Reply Last reply
      1
      • B Offline
        B Offline
        beqa
        wrote on last edited by
        #3

        hi.
        thanks, but this showEvent funthion call while i call newWindow->show()?

        mrjjM 1 Reply Last reply
        0
        • B beqa

          hi.
          thanks, but this showEvent funthion call while i call newWindow->show()?

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @beqa
          Yes it is.
          You cannot acces newwindows ui directly so other option is to add
          access function for what you want to do to the Widget from outside

          void newWindow::setSomeText( ... ) {
          ui->widget->setText(..)
          }

          and then

          newWindow->setSomeText("whatever");
          newWindow->show();

          That helps keep the code going too spaghetti and all the outside needs to know about
          newWindow is what it can set or get for others. The outside should not know anything from ui::
          as it makes better code.

          1 Reply Last reply
          3
          • M Offline
            M Offline
            mostefa
            wrote on last edited by
            #5

            @beqa
            Yes, i think that it is called when you call newWidnow->show() just before rendering the widget on your screen

            Non-spontaneous show events are sent to widgets immediately before they are shown
            
            1 Reply Last reply
            2
            • B Offline
              B Offline
              beqa
              wrote on last edited by
              #6

              thanks all of you

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mostefa
                wrote on last edited by
                #7

                @beqa

                You are welcome =)

                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