Si te zmadhohet horizontalLayout se bashku me MainWindow



  • Kam filluar nje projekt te vogel dhe problemi im i pare qe hasa eshte se nuk mund ti rregulloj objektet qe vet te zmadhohen apo zvogelohen proporcionalish me dritaren ame. Ato rrine fikse.

    Shiko se cka kam bere deri tash:

    @
    <?xml version="1.0" encoding="UTF-8"?>
    <ui version="4.0">
    <class>MainWindow</class>
    <widget class="QMainWindow" name="MainWindow">
    <property name="geometry">
    <rect>
    <x>0</x>
    <y>0</y>
    <width>600</width>
    <height>400</height>
    </rect>
    </property>
    <property name="windowTitle">
    <string>MainWindow</string>
    </property>
    <widget class="QWidget" name="centralWidget">
    <widget class="QWidget" name="horizontalLayoutWidget">
    <property name="geometry">
    <rect>
    <x>10</x>
    <y>20</y>
    <width>392</width>
    <height>281</height>
    </rect>
    </property>
    <layout class="QHBoxLayout" name="horizontalLayout" stretch="0">
    <property name="spacing">
    <number>12</number>
    </property>
    <property name="sizeConstraint">
    <enum>QLayout::SetNoConstraint</enum>
    </property>
    <item>
    <layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,0">
    <property name="spacing">
    <number>16</number>
    </property>
    <item>
    <widget class="QListView" name="listView">
    <property name="sizePolicy">
    <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
    <horstretch>0</horstretch>
    <verstretch>0</verstretch>
    </sizepolicy>
    </property>
    </widget>
    </item>
    <item>
    <widget class="QPushButton" name="pushButton">
    <property name="text">
    <string>Get IPs</string>
    </property>
    </widget>
    </item>
    </layout>
    </item>
    </layout>
    </widget>
    </widget>
    <widget class="QMenuBar" name="menuBar">
    <property name="geometry">
    <rect>
    <x>0</x>
    <y>0</y>
    <width>600</width>
    <height>24</height>
    </rect>
    </property>
    </widget>
    <widget class="QToolBar" name="mainToolBar">
    <attribute name="toolBarArea">
    <enum>TopToolBarArea</enum>
    </attribute>
    <attribute name="toolBarBreak">
    <bool>false</bool>
    </attribute>
    </widget>
    <widget class="QStatusBar" name="statusBar"/>
    </widget>
    <layoutdefault spacing="6" margin="11"/>
    <resources/>
    <connections/>
    </ui>
    @



  • [SOLVED]
    E zbulova se çka duhet të bëjë.
    Zmadhimi dhe zvogëlimi proporcional i objekteve do të bëhet vetëm nëse MainWindow ka layout "Lay out in a Form Layout" ose "Lay out in a Grid".
    Mundësitë tjera të layout-it janë "Lay out horizontally" dhe "lay out vertically" por nuk do ti zm/zv objektet në atë form (apo dritare).

    //Agroni



  • Pershendetje Agron,

    Sa i perket faqosjeve, mos prito lexoje kete dokument: "Layout Management":http://doc.qt.nokia.com/stable/layout.html

    Kryesisht layout managers i perdor nga C++ apo nga Qt Designer, Qt Designer te gjeneron XML ne .ui skedare, dhe kete XML nuk duhesh me editu me dore.


Log in to reply