Changeset 769 for trunk/examples/widgets


Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/examples/widgets/softkeys/softkeys.cpp

    r651 r769  
    7171    toggleButton->setCheckable(true);
    7272
     73    modeButton = new QPushButton(tr("Loop SK window type"), this);
     74    modeButton->setContextMenuPolicy(Qt::NoContextMenu);
     75
     76    modeLabel = new QLabel(tr("Normal maximized"), this);
     77    modeLabel->setContextMenuPolicy(Qt::NoContextMenu);
     78
    7379    pushButton = new QPushButton(tr("File Dialog"), this);
    7480    pushButton->setContextMenuPolicy(Qt::NoContextMenu);
     
    8894    layout->addWidget(pushButton, 2, 1);
    8995    layout->addWidget(comboBox, 3, 0, 1, 2);
     96    layout->addWidget(modeButton, 4, 0, 1, 2);
     97    layout->addWidget(modeLabel, 5, 0, 1, 2);
    9098    central->setLayout(layout);
    9199
     
    98106    connect(exit, SIGNAL(triggered()), this, SLOT(exitApplication()));
    99107    connect(toggleButton, SIGNAL(clicked()), this, SLOT(setCustomSoftKeys()));
     108    connect(modeButton, SIGNAL(clicked()), this, SLOT(setMode()));
    100109    pushButton->setFocus();
    101110}
     
    134143}
    135144
     145void MainWindow::setMode()
     146{
     147    if(isMaximized()) {
     148        showFullScreen();
     149        modeLabel->setText(tr("Normal Fullscreen"));
     150    } else {
     151        Qt::WindowFlags flags = windowFlags();
     152        if(flags & Qt::WindowSoftkeysRespondHint) {
     153            flags |= Qt::WindowSoftkeysVisibleHint;
     154            flags &= ~Qt::WindowSoftkeysRespondHint;
     155            setWindowFlags(flags); // Hides visible window
     156            showFullScreen();
     157            modeLabel->setText(tr("Fullscreen with softkeys"));
     158        } else if(flags & Qt::WindowSoftkeysVisibleHint) {
     159            flags &= ~Qt::WindowSoftkeysVisibleHint;
     160            flags &= ~Qt::WindowSoftkeysRespondHint;
     161            setWindowFlags(flags); // Hides visible window
     162            showMaximized();
     163            modeLabel->setText(tr("Normal Maximized"));
     164        } else {
     165            flags &= ~Qt::WindowSoftkeysVisibleHint;
     166            flags |= Qt::WindowSoftkeysRespondHint;
     167            setWindowFlags(flags); // Hides visible window
     168            showFullScreen();
     169            modeLabel->setText(tr("Fullscreen with SK respond"));
     170        }
     171    }
     172}
     173
    136174void MainWindow::exitApplication()
    137175{
  • trunk/examples/widgets/softkeys/softkeys.h

    r651 r769  
    5858    void cancelPressed();
    5959    void setCustomSoftKeys();
     60    void setMode();
    6061public:
    6162    MainWindow(QWidget *parent = 0);
     
    6465    QGridLayout *layout;
    6566    QWidget *central;
    66     QTextEdit* textEditor;
     67    QTextEdit *textEditor;
    6768    QLabel *infoLabel;
    68     QPushButton* toggleButton;
    69     QPushButton* pushButton;
    70     QMenu* fileMenu;
    71     QAction* addSoftKeysAct;
    72     QAction* exit;
    73     QAction* ok;
    74     QAction* cancel;
     69    QPushButton *toggleButton;
     70    QPushButton *pushButton;
     71    QPushButton *modeButton;
     72    QLabel *modeLabel;
     73    QMenu *fileMenu;
     74    QAction *addSoftKeysAct;
     75    QAction *exit;
     76    QAction *ok;
     77    QAction *cancel;
    7578};
    7679
  • trunk/examples/widgets/stylesheet/mainwindow.ui

    r561 r769  
    197197       <item row="1" column="2" colspan="2" >
    198198        <widget class="QRadioButton" name="femaleRadioButton" >
    199          <property name="styleSheet" >
     199         <property name="toolTip">
    200200          <string>Check this if you are female</string>
    201201         </property>
  • trunk/examples/widgets/wiggly/dialog.cpp

    r651 r769  
    5757    setLayout(layout);
    5858
     59#ifdef QT_SOFTKEYS_ENABLED
     60    QAction *exitAction = new QAction(tr("Exit"), this);
     61    exitAction->setSoftKeyRole(QAction::NegativeSoftKey);
     62    connect (exitAction, SIGNAL(triggered()),this, SLOT(close()));
     63    addAction (exitAction);
     64
     65    Qt::WindowFlags flags = windowFlags();
     66    flags |= Qt::WindowSoftkeysVisibleHint;
     67    setWindowFlags(flags);
     68#endif
     69
    5970    connect(lineEdit, SIGNAL(textChanged(QString)),
    6071            wigglyWidget, SLOT(setText(QString)));
  • trunk/examples/widgets/windowflags/controllerwindow.cpp

    r651 r769  
    5959    bottomLayout->addWidget(quitButton);
    6060
    61     QVBoxLayout *mainLayout = new QVBoxLayout;
     61    QHBoxLayout *mainLayout = new QHBoxLayout;
    6262    mainLayout->addWidget(typeGroupBox);
    6363    mainLayout->addWidget(hintsGroupBox);
Note: See TracChangeset for help on using the changeset viewer.