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. Window size adjustment on Smartphone (Xperia Z2)
Forum Updated to NodeBB v4.3 + New Features

Window size adjustment on Smartphone (Xperia Z2)

Scheduled Pinned Locked Moved Mobile and Embedded
11 Posts 2 Posters 2.6k 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi,

    Can you show an image of what happens ?

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    0
    • Flaming MoeF Offline
      Flaming MoeF Offline
      Flaming Moe
      wrote on last edited by Flaming Moe
      #3

      How can i load a photo? Or is it only possible via a link?

      best regards,
      Moe

      A lovely day for a ̶g̶̶u̶̶i̶̶n̶̶n̶̶e̶̶s̶ DUFF^^

      1 Reply Last reply
      0
      • Flaming MoeF Offline
        Flaming MoeF Offline
        Flaming Moe
        wrote on last edited by SGaist
        #4

        Ok, i´m home and loaded the fotos in DropBox

        As you can see in the picture, the red backround of the ui only exits under the slider and numbers. Also the black rectangle at the top has allways the same size and positions, no matter which values i use in setGeometry();

        The "App" itself
        https://www.dropbox.com/s/3fgewiqvebgqfye/Screenshot_2015-03-11-19-36-52.png?dl=0

        The ui
        https://www.dropbox.com/s/2zil29kewpfezvp/UI_QtCreator.jpg?dl=0

        The MainFile:

        #include <QTimer>
        #include <QWidget>
        #include <QApplication>
        #include "acc.h"
        #include <QVBoxLayout>
        #include <QScreen>
        #include <QGuiApplication>
        
        int main(int argc, char *argv[])
        {
            QApplication a(argc, argv);
            QScreen* screen =  QApplication::screens().at(0);
            QWidget w;
        
            QWidget* testWidget = new QWidget;
            testWidget->setGeometry(0, 0, 50, 20);
            testWidget->setStyleSheet("background-color:black");
            //w.setBaseSize(100, 100);
        
            QTimer* timer = new QTimer();
            ACC* acc = new ACC();
            acc->screen = screen;
        
            QVBoxLayout* layout;
            layout = new QVBoxLayout(&w);
            layout->addWidget(testWidget);
            layout->addWidget(acc);
        
            QObject::connect(timer, SIGNAL(timeout()), acc, SLOT(triggerCap()));
            timer->start(10);
        
            w.show();//acc->show();
            a.exec();
            return 1;
        }
        

        [edit: added missing coding tags: 3 ` before and after SGaist]

        A lovely day for a ̶g̶̶u̶̶i̶̶n̶̶n̶̶e̶̶s̶ DUFF^^

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #5

          You put testWidget in a layout, that's why it won't have the geometry you set on it.

          How are you setting the red background ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • Flaming MoeF Offline
            Flaming MoeF Offline
            Flaming Moe
            wrote on last edited by
            #6

            The background is set by a stylesheet "background-color:red" in the creator.
            Also when i set this by code, only the elements are underlayed with red.

            May be it´s some kind of property i need to set? I parsed them, but i´m not sure.

            A lovely day for a ̶g̶̶u̶̶i̶̶n̶̶n̶̶e̶̶s̶ DUFF^^

            1 Reply Last reply
            0
            • Flaming MoeF Offline
              Flaming MoeF Offline
              Flaming Moe
              wrote on last edited by
              #7

              In between i made by code a widget with yellow background which contains 3 numbers.
              This works out. So i think it has something to do with the Widget Designer, some corresponding properties...

              https://www.dropbox.com/s/wcmro6j7bp6vgvz/Screenshot_2015-03-12-10-05-49.jpg?dl=0

              A lovely day for a ̶g̶̶u̶̶i̶̶n̶̶n̶̶e̶̶s̶ DUFF^^

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #8

                Did you set the red background on each separated widget or on the containing widget ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • Flaming MoeF Offline
                  Flaming MoeF Offline
                  Flaming Moe
                  wrote on last edited by
                  #9

                  On the containing widget.

                  A lovely day for a ̶g̶̶u̶̶i̶̶n̶̶n̶̶e̶̶s̶ DUFF^^

                  1 Reply Last reply
                  0
                  • Flaming MoeF Offline
                    Flaming MoeF Offline
                    Flaming Moe
                    wrote on last edited by
                    #10

                    I solved it by a workaround. That means, i don´t know if it´s a workaround, main thing is, it works.

                    In the QtDesigner I put a normal blank widget on the Form at first and on top of that Widget the slider and Numbers. Now it´s solid painted.

                    First i tried something with "setBackgroundRole(QPalette::ColorRole role)"

                    A lovely day for a ̶g̶̶u̶̶i̶̶n̶̶n̶̶e̶̶s̶ DUFF^^

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #11

                      It think I may have understood your problem. You didn't put your separated widgets in a layout ?

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      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