Making the status pane disappear, but not the control pane. (softkeys?)
Okay! So I have kind of hit a road bump in my app, I’ve been trying to make the Statuspane disappear, while keeping the control pane. I simply can’t seem to make it work. I’ve been trying to follow and understand this example: http://doc.qt.nokia.com/latest/widgets-softkeys.html but with limited C++ knowledge and even less with the Qt Creator, I have found myself at a bit of a road bump. I have tried various things for hours, but what I’m currently sitting with is:
mainwindow.h:
- #include "mainwindow.h"
- #include <QtGui/QApplication>
- #include <QtGui>
- int main(int argc, char *argv[])
- {
- MainWindow mainWindow;
- mainWindow.setOrientation(MainWindow::ScreenOrientationAuto);
- // mainWindow.showExpanded();
- mainWindow.showMaximized();
- return app.exec();
- }
and in my mainwindow.cpp I’ve added a void like this, nothing else related to what I want:
- #include "mainwindow.h"
- #include "ui_mainwindow.h"
- #include <QtCore/QCoreApplication>
- #include <QtGui>
- #include <Qt>
- #include <QFlags>
- {
- ui->setupUi(this);
- }
- MainWindow::~MainWindow()
- {
- delete ui;
- }
- void MainWindow::setOrientation(ScreenOrientation orientation)
- {
- #if defined(Q_OS_SYMBIAN)
- // If the version of Qt on the device is < 4.7.2, that attribute won't work
- if (orientation != ScreenOrientationAuto) {
- if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) {
- qWarning("Screen orientation locking only supported with Qt 4.7.2 and above");
- return;
- }
- }
- #endif // Q_OS_SYMBIAN
- switch (orientation) {
- #if QT_VERSION < 0x040702
- // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes
- case ScreenOrientationLockPortrait:
- break;
- case ScreenOrientationLockLandscape:
- break;
- default:
- case ScreenOrientationAuto:
- break;
- #else // QT_VERSION < 0x040702
- case ScreenOrientationLockPortrait:
- break;
- case ScreenOrientationLockLandscape:
- break;
- default:
- case ScreenOrientationAuto:
- break;
- #endif // QT_VERSION < 0x040702
- };
- setAttribute(attribute, true);
- }
- void MainWindow::showExpanded()
- {
- #ifdef Q_OS_SYMBIAN
- showFullScreen();
- #elif defined(Q_WS_MAEMO_5)
- showMaximized();
- #else
- show();
- #endif
- }
- void MainWindow::setMode()
- {
- setWindowFlags(flags); // Hides visible window
- showFullScreen();
- }
I’ve tried switching the flags around, I’ve tried switching the second if a bit, but I can’t seem to make it work. All I want is to remove the status pane, while keeping the softkeys, but this is sooo frustrating. I hope someone has had to deal with this before.
Edit: I forgot to mention, this is a Mobile Application, specifically made for Symbian^3, at this stage at least. I have tried endless times to make this work by various means, I have searched the web over and over in an attempt of finding another answer or someone who knew what to do. But it usually comes back to the softkeys example.
1 reply
You must log in to post a reply. Not a member yet? Register here!

