IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Qt Discussion :

QTCreator - Stretch


Sujet :

Qt

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Décembre 2003
    Messages
    20
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2003
    Messages : 20
    Par défaut QTCreator - Stretch
    Bonjour,

    Je n'arrive pas à comprendre comment utiliser stretch pour que mes éléments se redimentionnent en même temps que ma fenêtre.
    Par Exemple, j'ai un QDialog, avec un QLineEdit à l'interieur.
    L'attribut sizePolicy est à Horizontal : Expanding, Vertical : Fixed.

    Pourtant, ca ne fonctionne pas.

    Est ce que j'oublie qqchose?

  2. #2
    yan
    yan est déconnecté
    Rédacteur
    Avatar de yan
    Homme Profil pro
    Ingénieur expert
    Inscrit en
    Mars 2004
    Messages
    10 035
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Ingénieur expert
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mars 2004
    Messages : 10 035
    Par défaut
    As tu un layout?

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Décembre 2003
    Messages
    20
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2003
    Messages : 20
    Par défaut
    Oui, j'oubliais de mentionner, un QHBoxLayout

  4. #4
    yan
    yan est déconnecté
    Rédacteur
    Avatar de yan
    Homme Profil pro
    Ingénieur expert
    Inscrit en
    Mars 2004
    Messages
    10 035
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Ingénieur expert
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mars 2004
    Messages : 10 035
    Par défaut
    Peut tu mettre un peu de code?

  5. #5
    Membre averti
    Profil pro
    Inscrit en
    Décembre 2003
    Messages
    20
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2003
    Messages : 20
    Par défaut
    Voilà le code généré par QTCreator

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
     
    class Ui_DialogEditGlobal
    {
    public:
        QDialogButtonBox *buttonBox;
        QWidget *horizontalLayoutWidget;
        QHBoxLayout *horizontalLayout;
        QLineEdit *lineEdit;
     
        void setupUi(QDialog *DialogEditGlobal)
        {
            if (DialogEditGlobal->objectName().isEmpty())
                DialogEditGlobal->setObjectName(QString::fromUtf8("DialogEditGlobal"));
            DialogEditGlobal->resize(400, 300);
            buttonBox = new QDialogButtonBox(DialogEditGlobal);
            buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
            buttonBox->setGeometry(QRect(30, 240, 341, 32));
            buttonBox->setOrientation(Qt::Horizontal);
            buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
            horizontalLayoutWidget = new QWidget(DialogEditGlobal);
            horizontalLayoutWidget->setObjectName(QString::fromUtf8("horizontalLayoutWidget"));
            horizontalLayoutWidget->setGeometry(QRect(29, 19, 331, 181));
            horizontalLayout = new QHBoxLayout(horizontalLayoutWidget);
            horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
            horizontalLayout->setContentsMargins(0, 0, 0, 0);
            lineEdit = new QLineEdit(horizontalLayoutWidget);
            lineEdit->setObjectName(QString::fromUtf8("lineEdit"));
     
            horizontalLayout->addWidget(lineEdit);
     
     
            retranslateUi(DialogEditGlobal);
            QObject::connect(buttonBox, SIGNAL(accepted()), DialogEditGlobal, SLOT(accept()));
            QObject::connect(buttonBox, SIGNAL(rejected()), DialogEditGlobal, SLOT(reject()));
     
            QMetaObject::connectSlotsByName(DialogEditGlobal);
        } // setupUi
     
        void retranslateUi(QDialog *DialogEditGlobal)
        {
            DialogEditGlobal->setWindowTitle(QApplication::translate("DialogEditGlobal", "Dialog", 0, QApplication::UnicodeUTF8));
            Q_UNUSED(DialogEditGlobal);
        } // retranslateUi
     
    };

Discussions similaires

  1. [Lazarus] Problème d'affichage d'images avec stretch
    Par Bernard B dans le forum Lazarus
    Réponses: 1
    Dernier message: 05/09/2006, 18h21
  2. [iReport 1.1.1]Stretch et son utilisation
    Par Oblivion dans le forum iReport
    Réponses: 1
    Dernier message: 14/08/2006, 20h02
  3. [DELPHI6] et TImage et Stretch
    Par Desraux dans le forum Delphi
    Réponses: 4
    Dernier message: 15/05/2006, 09h46
  4. une nouvelle image dans un Timage stretch
    Par copeau31 dans le forum Composants VCL
    Réponses: 5
    Dernier message: 26/01/2006, 15h00
  5. Problème avec la fonction Stretch de TImage
    Par laventure dans le forum Composants VCL
    Réponses: 5
    Dernier message: 09/08/2005, 13h06

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo