diff options
author | Jason Barron <jbarron@trolltech.com> | 2009-07-24 09:45:33 (GMT) |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2009-07-27 13:04:30 (GMT) |
commit | 3643028959f0b38350e57e60ba4000435b75e592 (patch) | |
tree | c129e4dee11487abd437ab8ebd993ba261e06fa6 /examples/mainwindows | |
parent | cf66c667a97c0079141eb3f2d9e997b7378ae792 (diff) | |
parent | c36139c665e61866aff4bf8572890a735167a7d0 (diff) | |
download | Qt-3643028959f0b38350e57e60ba4000435b75e592.zip Qt-3643028959f0b38350e57e60ba4000435b75e592.tar.gz Qt-3643028959f0b38350e57e60ba4000435b75e592.tar.bz2 |
Merge commit 'qt/master-stable'
Conflicts:
configure.exe
qmake/Makefile.unix
qmake/generators/makefile.cpp
src/corelib/global/qglobal.h
src/corelib/kernel/kernel.pri
src/corelib/kernel/qcoreevent.cpp
src/corelib/kernel/qsharedmemory_unix.cpp
src/gui/graphicsview/qgraphicsscene.cpp
src/gui/kernel/qaction.cpp
src/gui/kernel/qaction.h
src/gui/kernel/qaction_p.h
src/gui/kernel/qapplication.cpp
src/gui/kernel/qapplication.h
src/gui/kernel/qwidget.cpp
src/gui/kernel/qwidget.h
src/gui/kernel/qwidget_mac.mm
src/gui/painting/qgraphicssystemfactory.cpp
src/gui/styles/qwindowsstyle.cpp
src/gui/text/qfontengine_qpf.cpp
src/gui/widgets/qabstractscrollarea_p.h
src/network/access/qnetworkaccessdebugpipebackend.cpp
src/network/socket/qlocalsocket_unix.cpp
src/network/socket/qnativesocketengine_p.h
src/network/socket/qnativesocketengine_unix.cpp
src/openvg/qpaintengine_vg.cpp
tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp
tests/auto/qcssparser/qcssparser.pro
tests/auto/qdir/tst_qdir.cpp
tests/auto/qfile/tst_qfile.cpp
tests/auto/qobject/tst_qobject.cpp
tests/auto/qpathclipper/qpathclipper.pro
tests/auto/qprocess/tst_qprocess.cpp
tests/auto/qsettings/tst_qsettings.cpp
tests/auto/qsharedpointer/qsharedpointer.pro
tests/auto/qsqlquerymodel/qsqlquerymodel.pro
tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro
tests/auto/qsqltablemodel/qsqltablemodel.pro
tests/auto/qsqlthread/qsqlthread.pro
tests/auto/qwidget/tst_qwidget.cpp
Diffstat (limited to 'examples/mainwindows')
-rw-r--r-- | examples/mainwindows/application/main.cpp | 2 | ||||
-rw-r--r-- | examples/mainwindows/application/mainwindow.cpp | 7 | ||||
-rw-r--r-- | examples/mainwindows/mdi/mainwindow.cpp | 1 | ||||
-rw-r--r-- | examples/mainwindows/recentfiles/main.cpp | 2 | ||||
-rw-r--r-- | examples/mainwindows/recentfiles/mainwindow.cpp | 12 | ||||
-rw-r--r-- | examples/mainwindows/sdi/main.cpp | 2 | ||||
-rw-r--r-- | examples/mainwindows/sdi/mainwindow.cpp | 8 |
7 files changed, 15 insertions, 19 deletions
diff --git a/examples/mainwindows/application/main.cpp b/examples/mainwindows/application/main.cpp index f83e709..2fe6d5f 100644 --- a/examples/mainwindows/application/main.cpp +++ b/examples/mainwindows/application/main.cpp @@ -49,6 +49,8 @@ int main(int argc, char *argv[]) Q_INIT_RESOURCE(application); QApplication app(argc, argv); + app.setOrganizationName("Trolltech"); + app.setApplicationName("Application Example"); MainWindow mainWin; mainWin.show(); return app.exec(); diff --git a/examples/mainwindows/application/mainwindow.cpp b/examples/mainwindows/application/mainwindow.cpp index 68c7287..43dfe14 100644 --- a/examples/mainwindows/application/mainwindow.cpp +++ b/examples/mainwindows/application/mainwindow.cpp @@ -377,13 +377,10 @@ void MainWindow::setCurrentFile(const QString &fileName) textEdit->document()->setModified(false); setWindowModified(false); - QString shownName; + QString shownName = curFile; if (curFile.isEmpty()) shownName = "untitled.txt"; - else - shownName = strippedName(curFile); - - setWindowTitle(tr("%1[*] - %2").arg(shownName).arg(tr("Application"))); + setWindowFilePath(shownName); } //! [47] diff --git a/examples/mainwindows/mdi/mainwindow.cpp b/examples/mainwindows/mdi/mainwindow.cpp index 3cb54f1..9ef2cae 100644 --- a/examples/mainwindows/mdi/mainwindow.cpp +++ b/examples/mainwindows/mdi/mainwindow.cpp @@ -259,7 +259,6 @@ void MainWindow::createActions() connect(pasteAct, SIGNAL(triggered()), this, SLOT(paste())); closeAct = new QAction(tr("Cl&ose"), this); - closeAct->setShortcut(tr("Ctrl+F4")); closeAct->setStatusTip(tr("Close the active window")); connect(closeAct, SIGNAL(triggered()), mdiArea, SLOT(closeActiveSubWindow())); diff --git a/examples/mainwindows/recentfiles/main.cpp b/examples/mainwindows/recentfiles/main.cpp index 5417429..1dd3c1b 100644 --- a/examples/mainwindows/recentfiles/main.cpp +++ b/examples/mainwindows/recentfiles/main.cpp @@ -46,6 +46,8 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); + app.setOrganizationName("Trolltech"); + app.setApplicationName("Recent Files Example"); MainWindow *mainWin = new MainWindow; mainWin->show(); return app.exec(); diff --git a/examples/mainwindows/recentfiles/mainwindow.cpp b/examples/mainwindows/recentfiles/mainwindow.cpp index 1671f53..53d0d0e 100644 --- a/examples/mainwindows/recentfiles/mainwindow.cpp +++ b/examples/mainwindows/recentfiles/mainwindow.cpp @@ -54,7 +54,7 @@ MainWindow::MainWindow() createMenus(); (void)statusBar(); - setWindowTitle(tr("Recent Files")); + setWindowFilePath(QString()); resize(400, 300); } @@ -209,13 +209,9 @@ void MainWindow::saveFile(const QString &fileName) void MainWindow::setCurrentFile(const QString &fileName) { curFile = fileName; - if (curFile.isEmpty()) - setWindowTitle(tr("Recent Files")); - else - setWindowTitle(tr("%1 - %2").arg(strippedName(curFile)) - .arg(tr("Recent Files"))); + setWindowFilePath(curFile); - QSettings settings("Trolltech", "Recent Files Example"); + QSettings settings; QStringList files = settings.value("recentFileList").toStringList(); files.removeAll(fileName); files.prepend(fileName); @@ -233,7 +229,7 @@ void MainWindow::setCurrentFile(const QString &fileName) void MainWindow::updateRecentFileActions() { - QSettings settings("Trolltech", "Recent Files Example"); + QSettings settings; QStringList files = settings.value("recentFileList").toStringList(); int numRecentFiles = qMin(files.size(), (int)MaxRecentFiles); diff --git a/examples/mainwindows/sdi/main.cpp b/examples/mainwindows/sdi/main.cpp index a7e20d8..055d761 100644 --- a/examples/mainwindows/sdi/main.cpp +++ b/examples/mainwindows/sdi/main.cpp @@ -47,6 +47,8 @@ int main(int argc, char *argv[]) { Q_INIT_RESOURCE(sdi); QApplication app(argc, argv); + app.setApplicationName("SDI Example"); + app.setOrganizationName("Trolltech"); MainWindow *mainWin = new MainWindow; mainWin->show(); return app.exec(); diff --git a/examples/mainwindows/sdi/mainwindow.cpp b/examples/mainwindows/sdi/mainwindow.cpp index 8710105..1e7f2c0 100644 --- a/examples/mainwindows/sdi/mainwindow.cpp +++ b/examples/mainwindows/sdi/mainwindow.cpp @@ -266,7 +266,7 @@ void MainWindow::createStatusBar() void MainWindow::readSettings() { - QSettings settings("Trolltech", "SDI Example"); + QSettings settings; QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint(); QSize size = settings.value("size", QSize(400, 400)).toSize(); move(pos); @@ -275,7 +275,7 @@ void MainWindow::readSettings() void MainWindow::writeSettings() { - QSettings settings("Trolltech", "SDI Example"); + QSettings settings; settings.setValue("pos", pos()); settings.setValue("size", size()); } @@ -352,9 +352,7 @@ void MainWindow::setCurrentFile(const QString &fileName) textEdit->document()->setModified(false); setWindowModified(false); - - setWindowTitle(tr("%1[*] - %2").arg(strippedName(curFile)) - .arg(tr("SDI"))); + setWindowFilePath(curFile); } QString MainWindow::strippedName(const QString &fullFileName) |