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 get the property value form the widget created by ShowNormal() method
QtWS25 Last Chance

How to get the property value form the widget created by ShowNormal() method

Scheduled Pinned Locked Moved Mobile and Embedded
qt5.4creatorioswidget
10 Posts 3 Posters 3.7k 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
    mkdh
    wrote on 12 Sept 2015, 00:57 last edited by
    #1

    I want to show a widget which is special size in my screen.

    Hence, I can't use exec() in iOS. exec will let your widget maximized.

    It just can use ShowNormal. =.=

    But, how to get the property value form the widget created by ShowNormal() method

    R 1 Reply Last reply 12 Sept 2015, 09:44
    0
    • M mkdh
      12 Sept 2015, 00:57

      I want to show a widget which is special size in my screen.

      Hence, I can't use exec() in iOS. exec will let your widget maximized.

      It just can use ShowNormal. =.=

      But, how to get the property value form the widget created by ShowNormal() method

      R Offline
      R Offline
      raf924
      wrote on 12 Sept 2015, 09:44 last edited by
      #2

      @mkdh I'm not sure i get what you want but i'll try to help you anyway:
      overload the QWidget::resizeEvent(QResizeEvent*e) method so that when you call showNormal you can just get the size with

      e->size();
      
      M 1 Reply Last reply 17 Sept 2015, 07:21
      0
      • R raf924
        12 Sept 2015, 09:44

        @mkdh I'm not sure i get what you want but i'll try to help you anyway:
        overload the QWidget::resizeEvent(QResizeEvent*e) method so that when you call showNormal you can just get the size with

        e->size();
        
        M Offline
        M Offline
        mkdh
        wrote on 17 Sept 2015, 07:21 last edited by mkdh
        #3

        @raf924
        Does it possible to set the size and position for mydiaSaveSimple?

        It always show maxmun size when I exec() mydiaSaveSimple in my iOS.

            mydiaSaveSimple=new diaSaveSimple(this);
            float tmpWidth=wDesktop;
            float tmpHeight=hDesktop;
            
            if(wDesktop>hDesktop){
                tmpHeight=tmpWidth;
            }
            
            float tmpScale=gData->getScaleShow(tmpWidth,tmpHeight);
            float wformOpen=1357*tmpScale;
            float hformOpen=448*tmpScale;
            mydiaSaveSimple->setGeometry((wDesktop-wformOpen)/2
                                         ,(hDesktop-hformOpen)/2
                                         ,wformOpen
                                         ,hformOpen
                                         );
           
            QString newFilePath="";
            mydiaSaveSimple->setFocus();
            if(mydiaSaveSimple->exec()==QDialog::Accepted){
                //....omit
            }
        
        
        R 1 Reply Last reply 17 Sept 2015, 18:11
        0
        • M mkdh
          17 Sept 2015, 07:21

          @raf924
          Does it possible to set the size and position for mydiaSaveSimple?

          It always show maxmun size when I exec() mydiaSaveSimple in my iOS.

              mydiaSaveSimple=new diaSaveSimple(this);
              float tmpWidth=wDesktop;
              float tmpHeight=hDesktop;
              
              if(wDesktop>hDesktop){
                  tmpHeight=tmpWidth;
              }
              
              float tmpScale=gData->getScaleShow(tmpWidth,tmpHeight);
              float wformOpen=1357*tmpScale;
              float hformOpen=448*tmpScale;
              mydiaSaveSimple->setGeometry((wDesktop-wformOpen)/2
                                           ,(hDesktop-hformOpen)/2
                                           ,wformOpen
                                           ,hformOpen
                                           );
             
              QString newFilePath="";
              mydiaSaveSimple->setFocus();
              if(mydiaSaveSimple->exec()==QDialog::Accepted){
                  //....omit
              }
          
          
          R Offline
          R Offline
          raf924
          wrote on 17 Sept 2015, 18:11 last edited by
          #4

          @mkdh I just read that all windows and dialogs are show fullscreen on iOS when using the show method ( which is used by the exec method i guess) so what you have to do is show the dialog with showNormal and connect to the dialog's "accepted" signal.

          M 1 Reply Last reply 18 Sept 2015, 01:33
          0
          • R raf924
            17 Sept 2015, 18:11

            @mkdh I just read that all windows and dialogs are show fullscreen on iOS when using the show method ( which is used by the exec method i guess) so what you have to do is show the dialog with showNormal and connect to the dialog's "accepted" signal.

            M Offline
            M Offline
            mkdh
            wrote on 18 Sept 2015, 01:33 last edited by mkdh
            #5

            @raf924
            If I use showNormal method, than A, B and C Statement will be executed simultaneously.

            But C Statement depends on the result of B Statement.

            If I use exec() method, C Statement will be executed after getting the result of B Statement.

            How to deal this case?

            //Pseudo code:
            function QQ(){
               // A Statement.
               XXX
            
               // B Statement
               mydiaSaveSimple->showNormal();
            
               // C Statement. 
               // C Statement depends on the result of B Statement. 
               // C will use the value from A Statement.
               XXX
            }
            
            
            J 1 Reply Last reply 18 Sept 2015, 05:40
            0
            • M mkdh
              18 Sept 2015, 01:33

              @raf924
              If I use showNormal method, than A, B and C Statement will be executed simultaneously.

              But C Statement depends on the result of B Statement.

              If I use exec() method, C Statement will be executed after getting the result of B Statement.

              How to deal this case?

              //Pseudo code:
              function QQ(){
                 // A Statement.
                 XXX
              
                 // B Statement
                 mydiaSaveSimple->showNormal();
              
                 // C Statement. 
                 // C Statement depends on the result of B Statement. 
                 // C will use the value from A Statement.
                 XXX
              }
              
              
              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 18 Sept 2015, 05:40 last edited by
              #6

              @mkdh If I understand it right showNormal() is a non-blocking call. You should implement a slot for accepted() and rejected() signals and move the C part to that slot. Then you connect this slot to the accepted()/rejected() signals of your dialog.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              R M 2 Replies Last reply 18 Sept 2015, 16:28
              0
              • J jsulm
                18 Sept 2015, 05:40

                @mkdh If I understand it right showNormal() is a non-blocking call. You should implement a slot for accepted() and rejected() signals and move the C part to that slot. Then you connect this slot to the accepted()/rejected() signals of your dialog.

                R Offline
                R Offline
                raf924
                wrote on 18 Sept 2015, 16:28 last edited by
                #7

                @jsulm @mkdh that is exactly what i meant. I thought it was comprehensible, my bad.

                1 Reply Last reply
                0
                • J jsulm
                  18 Sept 2015, 05:40

                  @mkdh If I understand it right showNormal() is a non-blocking call. You should implement a slot for accepted() and rejected() signals and move the C part to that slot. Then you connect this slot to the accepted()/rejected() signals of your dialog.

                  M Offline
                  M Offline
                  mkdh
                  wrote on 28 Oct 2015, 08:24 last edited by mkdh
                  #8

                  @jsulm
                  Thanks.
                  By the way. I can't edit the QLineEdit on the mydiaSaveSimple in my iPad....
                  When I touch the QLineEdit in my iPad ,then there are no keyboard appear.
                  And, It the blank index disapper.....
                  Why..... ~=.=~

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on 28 Oct 2015, 08:55 last edited by
                    #9

                    Is the line edit read-only?

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    M 1 Reply Last reply 2 Nov 2015, 08:43
                    0
                    • J jsulm
                      28 Oct 2015, 08:55

                      Is the line edit read-only?

                      M Offline
                      M Offline
                      mkdh
                      wrote on 2 Nov 2015, 08:43 last edited by
                      #10

                      @jsulm
                      I add a button even as below.

                      void Dialog::on_pushButton_clicked()
                      {
                          SubView *QQ=new SubView(this);
                          QQ->setModal(true);
                          QQ->setEnabled(true);
                          QQ->showNormal();
                      }
                      

                      Then, I put a QEditline on the subview .
                      Of course, subview is a class inherited from the dialog.
                      This is a very simple code.

                      Or

                      You can try this
                      https://github.com/mkdh/QEditlineOnNewWidgetiOS

                      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