forked from qt-creator/qt-creator
Replace Q_WS_MAC with Q_OS_MAC.
We want to carry over all mac-specific code paths to Qt 5. WS_MAC is no longer set; OS_MAC is. This change is compatible with Qt 4 builds since OS_MAC is set whenever WS_MAC is. (OS_MAC would also be set for the theoretical X11/Mac platform, but that's anyway not a supported configuration for Creator) Change-Id: Ib25d8c4e83e7e27d911124cd48aa17fdb875923f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
committed by
Morten Johan Sørvig
parent
896a7a65e4
commit
b0cd54c1ec
@@ -141,7 +141,7 @@ void ZoomTool::mouseReleaseEvent(QMouseEvent *event)
|
||||
view()->setSceneRect(sceneArea);
|
||||
} else {
|
||||
Qt::KeyboardModifier modifierKey = Qt::ControlModifier;
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
modifierKey = Qt::AltModifier;
|
||||
#endif
|
||||
if (event->modifiers() & modifierKey) {
|
||||
|
||||
@@ -152,7 +152,7 @@ void usage()
|
||||
qWarning(" -I <directory> ........................... prepend to the module import search path,");
|
||||
qWarning(" display path if <directory> is empty");
|
||||
qWarning(" -P <directory> ........................... prepend to the plugin search path");
|
||||
#if defined(Q_WS_MAC)
|
||||
#if defined(Q_OS_MAC)
|
||||
qWarning(" -no-opengl ............................... don't use a QGLWidget for the viewport");
|
||||
#else
|
||||
qWarning(" -opengl .................................. use a QGLWidget for the viewport");
|
||||
@@ -215,7 +215,7 @@ struct ViewerOptions
|
||||
useNativeFileBrowser = false;
|
||||
#endif
|
||||
|
||||
#if defined(Q_WS_MAC)
|
||||
#if defined(Q_OS_MAC)
|
||||
useGL = true;
|
||||
#endif
|
||||
}
|
||||
@@ -375,7 +375,7 @@ static void parseCommandLineOptions(const QStringList &arguments)
|
||||
} else if (arg == "-translation") {
|
||||
if (lastArg) usage();
|
||||
opts.translationFile = arguments.at(++i);
|
||||
#if defined(Q_WS_MAC)
|
||||
#if defined(Q_OS_MAC)
|
||||
} else if (arg == "-no-opengl") {
|
||||
opts.useGL = false;
|
||||
#else
|
||||
@@ -530,7 +530,7 @@ int main(int argc, char ** argv)
|
||||
systemMsgOutput = qInstallMsgHandler(myMessageOutput);
|
||||
#endif
|
||||
|
||||
#if defined (Q_WS_X11) || defined (Q_WS_MAC)
|
||||
#if defined (Q_WS_X11) || defined (Q_OS_MAC)
|
||||
//### default to using raster graphics backend for now
|
||||
bool gsSpecified = false;
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
|
||||
@@ -274,12 +274,12 @@ void QDeclarativeTester::updateCurrentTime(int msec)
|
||||
if (options & QDeclarativeViewer::TestImages) {
|
||||
img.fill(qRgb(255,255,255));
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
bool oldSmooth = qt_applefontsmoothing_enabled;
|
||||
qt_applefontsmoothing_enabled = false;
|
||||
#endif
|
||||
QPainter p(&img);
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
qt_applefontsmoothing_enabled = oldSmooth;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1575,7 +1575,7 @@ void QDeclarativeViewer::setUseGL(bool useGL)
|
||||
#ifdef GL_SUPPORTED
|
||||
if (useGL) {
|
||||
QGLFormat format = QGLFormat::defaultFormat();
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
format.setSampleBuffers(true);
|
||||
#else
|
||||
format.setSampleBuffers(false);
|
||||
|
||||
@@ -66,11 +66,11 @@ void Qt5NodeInstanceServer::initializeView(const QVector<AddImportContainer> &/*
|
||||
Q_ASSERT(!sgView());
|
||||
|
||||
m_sgView = new QSGView;
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
sgView()->setAttribute(Qt::WA_DontShowOnScreen, true);
|
||||
#endif
|
||||
sgView()->show();
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
sgView()->setAttribute(Qt::WA_DontShowOnScreen, true);
|
||||
#endif
|
||||
sgView()->setUpdatesEnabled(false);
|
||||
|
||||
@@ -78,12 +78,12 @@ void Qt4NodeInstanceServer::initializeView(const QVector<AddImportContainer> &/*
|
||||
Q_ASSERT(!declarativeView());
|
||||
|
||||
m_declarativeView = new QDeclarativeView;
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
declarativeView()->setAttribute(Qt::WA_DontShowOnScreen, true);
|
||||
#endif
|
||||
declarativeView()->setViewportUpdateMode(QGraphicsView::NoViewportUpdate);
|
||||
declarativeView()->show();
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
declarativeView()->setAttribute(Qt::WA_DontShowOnScreen, true);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -171,14 +171,14 @@ void DragWidget::protectedMoved()
|
||||
|
||||
void DragWidget::leaveEvent(QEvent *)
|
||||
{
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
unsetCursor();
|
||||
#endif
|
||||
}
|
||||
|
||||
void DragWidget::enterEvent(QEvent *)
|
||||
{
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
setCursor(Qt::ArrowCursor);
|
||||
#endif
|
||||
}
|
||||
@@ -226,7 +226,7 @@ ContextPaneWidget::ContextPaneWidget(QWidget *parent) : DragWidget(parent), m_cu
|
||||
m_disableAction->setCheckable(true);
|
||||
connect(m_disableAction.data(), SIGNAL(toggled(bool)), this, SLOT(onDisable(bool)));
|
||||
m_pinned = false;
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
setCursor(Qt::ArrowCursor);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -182,14 +182,14 @@ void CustomColorDialog::setupWidgets()
|
||||
|
||||
void CustomColorDialog::leaveEvent(QEvent *)
|
||||
{
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
unsetCursor();
|
||||
#endif
|
||||
}
|
||||
|
||||
void CustomColorDialog::enterEvent(QEvent *)
|
||||
{
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
setCursor(Qt::ArrowCursor);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -562,7 +562,7 @@ QSize QStyleItem::sizeFromContents(int width, int height)
|
||||
break;
|
||||
case Header:
|
||||
size = qApp->style()->sizeFromContents(QStyle::CT_HeaderSection, m_styleoption, QSize(width,height), widget());
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
if (style() =="mac")
|
||||
size.setHeight(15);
|
||||
#endif
|
||||
@@ -575,7 +575,7 @@ QSize QStyleItem::sizeFromContents(int width, int height)
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
// ### hack - With even heights, the text baseline is off on mac
|
||||
if (size.height() %2 == 0)
|
||||
size.setHeight(size.height() + 1);
|
||||
@@ -738,7 +738,7 @@ void QStyleItem::setElementType(const QString &str)
|
||||
// Gtk uses qobject cast, hence we need to separate this from menuitem
|
||||
// On mac, we temporarily use the menu item because it has more accurate
|
||||
// palette.
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
static QMenu *combo = new QMenu();
|
||||
#else
|
||||
static QComboBox *combo = new QComboBox();
|
||||
@@ -826,7 +826,7 @@ void QStyleItem::setElementType(const QString &str)
|
||||
m_dummywidget->setAttribute(Qt::WA_QuitOnClose, false); // dont keep app open
|
||||
m_dummywidget->setAttribute(Qt::WA_LayoutUsesWidgetRect);
|
||||
m_dummywidget->winId();
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
m_dummywidget->setGeometry(-1000, 0, 10,10);
|
||||
m_dummywidget->setVisible(visible); // Mac require us to set the visibility before this
|
||||
#endif
|
||||
|
||||
@@ -81,7 +81,7 @@ QSize DetailsButton::sizeHint() const
|
||||
{
|
||||
// TODO: Adjust this when icons become available!
|
||||
const int w = fontMetrics().width(text()) + 32;
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
return QSize(w, 34);
|
||||
#else
|
||||
return QSize(w, 22);
|
||||
@@ -118,7 +118,7 @@ void DetailsButton::paintEvent(QPaintEvent *e)
|
||||
QWidget::paintEvent(e);
|
||||
|
||||
QPainter p(this);
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
// draw hover animation
|
||||
if (!isDown() && m_fader > 0)
|
||||
p.fillRect(rect().adjusted(1, 1, -2, -2), QColor(255, 255, 255, int(m_fader*180)));
|
||||
|
||||
@@ -145,7 +145,7 @@ QPixmap DetailsWidgetPrivate::cacheBackground(const QSize &size, bool expanded)
|
||||
|
||||
QRect topRect(0, 0, size.width(), topHeight);
|
||||
QRect fullRect(0, 0, size.width(), size.height());
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
p.fillRect(fullRect, qApp->palette().window().color());
|
||||
#endif
|
||||
p.fillRect(fullRect, QColor(255, 255, 255, 40));
|
||||
@@ -378,7 +378,7 @@ void DetailsWidget::setToolWidget(Utils::FadingPanel *widget)
|
||||
d->m_toolWidget->adjustSize();
|
||||
d->m_grid->addWidget(d->m_toolWidget, 0, 1, 1, 1, Qt::AlignRight);
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
d->m_toolWidget->setOpacity(1.0);
|
||||
#endif
|
||||
d->changeHoverState(d->m_hovered);
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <QtGui/QHeaderView>
|
||||
#include <QtGui/QFocusEvent>
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
#include <QtGui/QKeyEvent>
|
||||
#endif
|
||||
|
||||
@@ -87,7 +87,7 @@ void NavigationTreeView::resizeEvent(QResizeEvent *event)
|
||||
QTreeView::resizeEvent(event);
|
||||
}
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
void NavigationTreeView::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if ((event->key() == Qt::Key_Return
|
||||
|
||||
@@ -50,7 +50,7 @@ protected:
|
||||
void focusOutEvent(QFocusEvent *event);
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
*/
|
||||
|
||||
/*static*/ const char * const Utils::PathChooser::browseButtonLabel =
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
QT_TRANSLATE_NOOP("Utils::PathChooser", "Choose...");
|
||||
#else
|
||||
QT_TRANSLATE_NOOP("Utils::PathChooser", "Browse...");
|
||||
|
||||
@@ -71,7 +71,7 @@ QColor StyleHelper::mergedColors(const QColor &colorA, const QColor &colorB, int
|
||||
|
||||
qreal StyleHelper::sidebarFontSize()
|
||||
{
|
||||
#if defined(Q_WS_MAC)
|
||||
#if defined(Q_OS_MAC)
|
||||
return 10;
|
||||
#else
|
||||
return 7.5;
|
||||
|
||||
@@ -83,7 +83,7 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
|
||||
m_toggleAction = new QAction(tr("Toggle Bookmark"), this);
|
||||
Core::Command *cmd =
|
||||
am->registerAction(m_toggleAction, BOOKMARKS_TOGGLE_ACTION, textcontext);
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+M")));
|
||||
#else
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Meta+M")));
|
||||
@@ -98,7 +98,7 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
|
||||
//Previous
|
||||
m_prevAction = new QAction(tr("Previous Bookmark"), this);
|
||||
cmd = am->registerAction(m_prevAction, BOOKMARKS_PREV_ACTION, globalcontext);
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+,")));
|
||||
#else
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Meta+,")));
|
||||
@@ -108,7 +108,7 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
|
||||
//Next
|
||||
m_nextAction = new QAction(tr("Next Bookmark"), this);
|
||||
cmd = am->registerAction(m_nextAction, BOOKMARKS_NEXT_ACTION, globalcontext);
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+.")));
|
||||
#else
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Meta+.")));
|
||||
|
||||
@@ -451,7 +451,7 @@ static QString msgActionWarning(QAction *newAction, int k, QAction *oldAction)
|
||||
|
||||
void Action::addOverrideAction(QAction *action, const Core::Context &context, bool scriptable)
|
||||
{
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
action->setIconVisibleInMenu(false);
|
||||
#endif
|
||||
if (isEmpty())
|
||||
|
||||
@@ -103,7 +103,7 @@ const char OPTIONS[] = "QtCreator.Options";
|
||||
const char TOGGLE_SIDEBAR[] = "QtCreator.ToggleSidebar";
|
||||
const char TOGGLE_FULLSCREEN[] = "QtCreator.ToggleFullScreen";
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
const char MINIMIZE_WINDOW[] = "QtCreator.MinimizeWindow";
|
||||
const char ZOOM_WINDOW[] = "QtCreator.ZoomWindow";
|
||||
#endif
|
||||
|
||||
@@ -369,7 +369,7 @@ EditorManager::EditorManager(QWidget *parent) :
|
||||
|
||||
// Goto Previous In History Action
|
||||
cmd = am->registerAction(d->m_gotoPreviousDocHistoryAction, Constants::GOTOPREVINHISTORY, editDesignContext);
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Alt+Tab")));
|
||||
#else
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Tab")));
|
||||
@@ -379,7 +379,7 @@ EditorManager::EditorManager(QWidget *parent) :
|
||||
|
||||
// Goto Next In History Action
|
||||
cmd = am->registerAction(d->m_gotoNextDocHistoryAction, Constants::GOTONEXTINHISTORY, editDesignContext);
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Alt+Shift+Tab")));
|
||||
#else
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+Tab")));
|
||||
@@ -389,7 +389,7 @@ EditorManager::EditorManager(QWidget *parent) :
|
||||
|
||||
// Go back in navigation history
|
||||
cmd = am->registerAction(d->m_goBackAction, Constants::GO_BACK, editDesignContext);
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+Left")));
|
||||
#else
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Alt+Left")));
|
||||
@@ -399,7 +399,7 @@ EditorManager::EditorManager(QWidget *parent) :
|
||||
|
||||
// Go forward in navigation history
|
||||
cmd = am->registerAction(d->m_goForwardAction, Constants::GO_FORWARD, editDesignContext);
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+Right")));
|
||||
#else
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Alt+Right")));
|
||||
@@ -407,7 +407,7 @@ EditorManager::EditorManager(QWidget *parent) :
|
||||
mwindow->addAction(cmd, Constants::G_WINDOW_NAVIGATE);
|
||||
connect(d->m_goForwardAction, SIGNAL(triggered()), this, SLOT(goForwardInNavigationHistory()));
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
QString prefix = tr("Meta+E");
|
||||
#else
|
||||
QString prefix = tr("Ctrl+E");
|
||||
@@ -1712,7 +1712,7 @@ void EditorManager::updateActions()
|
||||
fName = curEditor->displayName();
|
||||
}
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
window()->setWindowModified(curEditor->file()->isModified());
|
||||
#endif
|
||||
bool ww = curEditor->file()->isModified() && curEditor->file()->isReadOnly();
|
||||
@@ -1751,7 +1751,7 @@ void EditorManager::updateActions()
|
||||
curEditor->file()->infoBar()->removeInfo(QLatin1String("Core.EditorManager.MakeWritable"));
|
||||
}
|
||||
}
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
} else { // curEditor
|
||||
window()->setWindowModified(false);
|
||||
#endif
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
#include <QtGui/QSplitter>
|
||||
#include <QtGui/QStackedLayout>
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
#include <qmacstyle_mac.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <QtGui/QStyleOption>
|
||||
#include <QtGui/QHeaderView>
|
||||
#include <QtGui/QKeyEvent>
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
#include <qmacstyle_mac.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -63,14 +63,14 @@ OpenEditorsWindow::OpenEditorsWindow(QWidget *parent) :
|
||||
m_editorList->setIndentation(0);
|
||||
m_editorList->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
m_editorList->setTextElideMode(Qt::ElideMiddle);
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
m_editorList->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
|
||||
#endif
|
||||
m_editorList->installEventFilter(this);
|
||||
|
||||
// We disable the frame on this list view and use a QFrame around it instead.
|
||||
// This improves the look with QGTKStyle.
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
setFrameStyle(m_editorList->frameStyle());
|
||||
#endif
|
||||
m_editorList->setFrameStyle(QFrame::NoFrame);
|
||||
|
||||
@@ -157,7 +157,7 @@ EditorToolBar::EditorToolBar(QWidget *parent) :
|
||||
d->m_forwardButton= new QToolButton(this);
|
||||
d->m_forwardButton->setDefaultAction(d->m_goForwardAction);
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
d->m_horizontalSplitAction->setIconVisibleInMenu(false);
|
||||
d->m_verticalSplitAction->setIconVisibleInMenu(false);
|
||||
#endif
|
||||
|
||||
@@ -148,7 +148,7 @@ void FancyToolButton::paintEvent(QPaintEvent *event)
|
||||
// draw borders
|
||||
bool isTitledAction = defaultAction()->property("titledAction").toBool();
|
||||
|
||||
#ifndef Q_WS_MAC // Mac UIs usually don't hover
|
||||
#ifndef Q_OS_MAC // Mac UIs usually don't hover
|
||||
if (m_fader > 0 && isEnabled() && !isDown() && !isChecked()) {
|
||||
painter.save();
|
||||
int fader = int(40 * m_fader);
|
||||
|
||||
@@ -291,7 +291,7 @@ void FancyTabBar::paintTab(QPainter *painter, int tabIndex) const
|
||||
} else {
|
||||
painter->setPen(selected ? Utils::StyleHelper::panelTextColor() : QColor(255, 255, 255, 120));
|
||||
}
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
if (!selected && enabled) {
|
||||
painter->save();
|
||||
int fader = int(m_tabs[tabIndex]->fader());
|
||||
|
||||
@@ -141,7 +141,7 @@ QIcon FileIconProvider::icon(const QFileInfo &fileInfo) const
|
||||
}
|
||||
}
|
||||
// Get icon from OS.
|
||||
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
|
||||
#if defined(Q_WS_WIN) || defined(Q_OS_MAC)
|
||||
return QFileIconProvider::icon(fileInfo);
|
||||
#else
|
||||
// File icons are unknown on linux systems.
|
||||
|
||||
@@ -127,7 +127,7 @@ void FileUtils::openTerminal(const QString &path)
|
||||
#ifdef Q_OS_WIN
|
||||
const QString terminalEmulator = QString::fromLocal8Bit(qgetenv("COMSPEC"));
|
||||
const QStringList args; // none
|
||||
#elif defined(Q_WS_MAC)
|
||||
#elif defined(Q_OS_MAC)
|
||||
const QString terminalEmulator = Core::ICore::resourcePath()
|
||||
+ QLatin1String("/scripts/openTerminal.command");
|
||||
QStringList args;
|
||||
|
||||
@@ -164,7 +164,7 @@ MainWindow::MainWindow() :
|
||||
m_optionsAction(0),
|
||||
m_toggleSideBarAction(0),
|
||||
m_toggleFullScreenAction(0),
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
m_minimizeAction(0),
|
||||
m_zoomAction(0),
|
||||
#endif
|
||||
@@ -174,7 +174,7 @@ MainWindow::MainWindow() :
|
||||
OutputPaneManager::create();
|
||||
|
||||
setWindowTitle(tr("Qt Creator"));
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
QApplication::setWindowIcon(QIcon(QLatin1String(Constants::ICON_QTLOGO_128)));
|
||||
#endif
|
||||
QCoreApplication::setApplicationName(QLatin1String("QtCreator"));
|
||||
@@ -476,7 +476,7 @@ void MainWindow::registerDefaultContainers()
|
||||
|
||||
ActionContainer *menubar = am->createMenuBar(Constants::MENU_BAR);
|
||||
|
||||
#ifndef Q_WS_MAC // System menu bar on Mac
|
||||
#ifndef Q_OS_MAC // System menu bar on Mac
|
||||
setMenuBar(menubar->menuBar());
|
||||
#endif
|
||||
menubar->appendGroup(Constants::G_FILE);
|
||||
@@ -632,7 +632,7 @@ void MainWindow::registerDefaultActions()
|
||||
tmpaction = new QAction(icon, tr("Save &As..."), this);
|
||||
tmpaction->setEnabled(false);
|
||||
cmd = am->registerAction(tmpaction, Constants::SAVEAS, globalContext);
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+S")));
|
||||
#endif
|
||||
cmd->setAttribute(Command::CA_UpdateText);
|
||||
@@ -642,7 +642,7 @@ void MainWindow::registerDefaultActions()
|
||||
// SaveAll Action
|
||||
m_saveAllAction = new QAction(tr("Save A&ll"), this);
|
||||
cmd = am->registerAction(m_saveAllAction, Constants::SAVEALL, globalContext);
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+S")));
|
||||
#endif
|
||||
mfile->addAction(cmd, Constants::G_FILE_SAVE);
|
||||
@@ -730,14 +730,14 @@ void MainWindow::registerDefaultActions()
|
||||
mtools->addAction(cmd, Constants::G_TOOLS_OPTIONS);
|
||||
m_optionsAction = new QAction(tr("&Options..."), this);
|
||||
cmd = am->registerAction(m_optionsAction, Constants::OPTIONS, globalContext);
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+,")));
|
||||
cmd->action()->setMenuRole(QAction::PreferencesRole);
|
||||
#endif
|
||||
mtools->addAction(cmd, Constants::G_TOOLS_OPTIONS);
|
||||
connect(m_optionsAction, SIGNAL(triggered()), this, SLOT(showOptionsDialog()));
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
// Minimize Action
|
||||
m_minimizeAction = new QAction(tr("Minimize"), this);
|
||||
cmd = am->registerAction(m_minimizeAction, Constants::MINIMIZE_WINDOW, globalContext);
|
||||
@@ -762,7 +762,7 @@ void MainWindow::registerDefaultActions()
|
||||
m_toggleSideBarAction->setCheckable(true);
|
||||
cmd = am->registerAction(m_toggleSideBarAction, Constants::TOGGLE_SIDEBAR, globalContext);
|
||||
cmd->setAttribute(Command::CA_UpdateText);
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+0")));
|
||||
#else
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Alt+0")));
|
||||
@@ -772,7 +772,7 @@ void MainWindow::registerDefaultActions()
|
||||
mwindow->addAction(cmd, Constants::G_WINDOW_VIEWS);
|
||||
m_toggleSideBarAction->setEnabled(false);
|
||||
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
// Full Screen Action
|
||||
m_toggleFullScreenAction = new QAction(tr("Full Screen"), this);
|
||||
m_toggleFullScreenAction->setCheckable(true);
|
||||
@@ -789,7 +789,7 @@ void MainWindow::registerDefaultActions()
|
||||
|
||||
// About IDE Action
|
||||
icon = QIcon::fromTheme(QLatin1String("help-about"));
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
tmpaction = new QAction(icon, tr("About &Qt Creator"), this); // it's convention not to add dots to the about menu
|
||||
#else
|
||||
tmpaction = new QAction(icon, tr("About &Qt Creator..."), this);
|
||||
@@ -797,7 +797,7 @@ void MainWindow::registerDefaultActions()
|
||||
cmd = am->registerAction(tmpaction, Constants::ABOUT_QTCREATOR, globalContext);
|
||||
mhelp->addAction(cmd, Constants::G_HELP_ABOUT);
|
||||
tmpaction->setEnabled(true);
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
cmd->action()->setMenuRole(QAction::ApplicationSpecificRole);
|
||||
#endif
|
||||
connect(tmpaction, SIGNAL(triggered()), this, SLOT(aboutQtCreator()));
|
||||
@@ -807,7 +807,7 @@ void MainWindow::registerDefaultActions()
|
||||
cmd = am->registerAction(tmpaction, Constants::ABOUT_PLUGINS, globalContext);
|
||||
mhelp->addAction(cmd, Constants::G_HELP_ABOUT);
|
||||
tmpaction->setEnabled(true);
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
cmd->action()->setMenuRole(QAction::ApplicationSpecificRole);
|
||||
#endif
|
||||
connect(tmpaction, SIGNAL(triggered()), this, SLOT(aboutPlugins()));
|
||||
@@ -818,7 +818,7 @@ void MainWindow::registerDefaultActions()
|
||||
// tmpaction->setEnabled(true);
|
||||
// connect(tmpaction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
|
||||
// About sep
|
||||
#ifndef Q_WS_MAC // doesn't have the "About" actions in the Help menu
|
||||
#ifndef Q_OS_MAC // doesn't have the "About" actions in the Help menu
|
||||
tmpaction = new QAction(this);
|
||||
tmpaction->setSeparator(true);
|
||||
cmd = am->registerAction(tmpaction, "QtCreator.Help.Sep.About", globalContext);
|
||||
@@ -1125,7 +1125,7 @@ void MainWindow::changeEvent(QEvent *e)
|
||||
emit windowActivated();
|
||||
}
|
||||
} else if (e->type() == QEvent::WindowStateChange) {
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
bool minimized = isMinimized();
|
||||
if (debugMainWindow)
|
||||
qDebug() << "main window state changed to minimized=" << minimized;
|
||||
|
||||
@@ -223,7 +223,7 @@ private:
|
||||
QAction *m_optionsAction;
|
||||
QAction *m_toggleSideBarAction;
|
||||
QAction *m_toggleFullScreenAction;
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
QAction *m_minimizeAction;
|
||||
QAction *m_zoomAction;
|
||||
#endif
|
||||
|
||||
@@ -895,7 +895,7 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
|
||||
QColor shade(0, 0, 0, 50);
|
||||
painter->fillRect(tool.rect.adjusted(0, -1, 1, 1), shade);
|
||||
}
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
else if (mflags & (State_MouseOver)) {
|
||||
QColor shade(255, 255, 255, 50);
|
||||
painter->fillRect(tool.rect.adjusted(0, -1, 1, 1), shade);
|
||||
|
||||
@@ -217,7 +217,7 @@ void ModeManager::objectAdded(QObject *obj)
|
||||
// and still expect the current shortcut to change with it
|
||||
bool currentlyHasDefaultSequence = (currentCmd->keySequence()
|
||||
== currentCmd->defaultKeySequence());
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
currentCmd->setDefaultKeySequence(QKeySequence(QString::fromLatin1("Meta+%1").arg(i+1)));
|
||||
#else
|
||||
currentCmd->setDefaultKeySequence(QKeySequence(QString::fromLatin1("Ctrl+%1").arg(i+1)));
|
||||
|
||||
@@ -184,7 +184,7 @@ QWidget *OutputPaneManager::buttonsWidget()
|
||||
// Return shortcut as Ctrl+<number>
|
||||
static inline int paneShortCut(int number)
|
||||
{
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
int modifier = Qt::CTRL;
|
||||
#else
|
||||
int modifier = Qt::ALT;
|
||||
@@ -222,7 +222,7 @@ void OutputPaneManager::init()
|
||||
mpanes->addAction(cmd, "Coreplugin.OutputPane.ActionsGroup");
|
||||
|
||||
cmd = am->registerAction(m_minMaxAction, "Coreplugin.OutputPane.minmax", globalcontext);
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+9")));
|
||||
#else
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Alt+9")));
|
||||
@@ -538,7 +538,7 @@ OutputPaneToggleButton::OutputPaneToggleButton(int number, const QString &text,
|
||||
" border-width: 2px 2px 2px 19px; padding-left: -17; padding-right: 4 } "
|
||||
"QToolButton:checked { border-image: url(:/core/images/panel_button_checked.png) 2 2 2 19 } "
|
||||
"QToolButton::menu-indicator { width:0; height:0 }"
|
||||
#ifndef Q_WS_MAC // Mac UIs usually don't hover
|
||||
#ifndef Q_OS_MAC // Mac UIs usually don't hover
|
||||
"QToolButton:checked:hover { border-image: url(:/core/images/panel_button_checked_hover.png) 2 2 2 19 } "
|
||||
"QToolButton:pressed:hover { border-image: url(:/core/images/panel_button_pressed.png) 2 2 2 19 } "
|
||||
"QToolButton:hover { border-image: url(:/core/images/panel_button_hover.png) 2 2 2 19 } "
|
||||
|
||||
@@ -58,9 +58,9 @@ PasteSelectDialog::PasteSelectDialog(const QList<Protocol*> &protocols,
|
||||
connect(m_refreshButton, SIGNAL(clicked()), this, SLOT(list()));
|
||||
|
||||
m_ui.listWidget->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
#ifndef Q_WS_MACX
|
||||
#ifndef Q_OS_MACX
|
||||
m_ui.listWidget->setFrameStyle(QFrame::NoFrame);
|
||||
#endif // Q_WS_MACX
|
||||
#endif // Q_OS_MACX
|
||||
// Proportional formatting of columns for CodePaster
|
||||
QFont listFont = m_ui.listWidget->font();
|
||||
listFont.setFamily(QLatin1String("Courier"));
|
||||
|
||||
@@ -86,7 +86,7 @@ CppEditorFactory::CppEditorFactory(CppPlugin *owner) :
|
||||
<< QLatin1String(CppEditor::Constants::CPP_SOURCE_MIMETYPE)
|
||||
<< QLatin1String(CppEditor::Constants::CPP_HEADER_MIMETYPE);
|
||||
|
||||
#if !defined(Q_WS_MAC) && !defined(Q_WS_WIN)
|
||||
#if !defined(Q_OS_MAC) && !defined(Q_WS_WIN)
|
||||
Core::FileIconProvider *iconProvider = Core::FileIconProvider::instance();
|
||||
Core::MimeDatabase *mimeDatabase = Core::ICore::mimeDatabase();
|
||||
iconProvider->registerIconOverlayForMimeType(QIcon(QLatin1String(":/cppeditor/images/qt_cpp.png")),
|
||||
|
||||
@@ -380,7 +380,7 @@ namespace PE = ProjectExplorer::Constants;
|
||||
namespace Debugger {
|
||||
namespace Constants {
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
const char STOP_KEY[] = "Shift+Ctrl+Y";
|
||||
const char RESET_KEY[] = "Ctrl+Shift+F5";
|
||||
const char STEP_KEY[] = "Ctrl+Shift+I";
|
||||
|
||||
@@ -129,7 +129,7 @@ namespace Internal {
|
||||
#define EDITOR(s) (m_textedit ? m_textedit->s : m_plaintextedit->s)
|
||||
|
||||
enum {
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
RealControlModifier = Qt::MetaModifier
|
||||
#else
|
||||
RealControlModifier = Qt::ControlModifier
|
||||
|
||||
@@ -279,7 +279,7 @@ bool FindToolBar::eventFilter(QObject *obj, QEvent *event)
|
||||
if ((obj == m_ui.findEdit || obj == m_findCompleter->popup())
|
||||
&& event->type() == QEvent::KeyPress) {
|
||||
QKeyEvent *ke = static_cast<QKeyEvent *>(event);
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
if (ke->key() == Qt::Key_Space && (ke->modifiers() & Qt::MetaModifier)) {
|
||||
#else
|
||||
if (ke->key() == Qt::Key_Space && (ke->modifiers() & Qt::ControlModifier)) {
|
||||
@@ -300,7 +300,7 @@ bool FindToolBar::eventFilter(QObject *obj, QEvent *event)
|
||||
event->accept();
|
||||
return true;
|
||||
}
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
} else if (ke->key() == Qt::Key_Space && (ke->modifiers() & Qt::MetaModifier)) {
|
||||
#else
|
||||
} else if (ke->key() == Qt::Key_Space && (ke->modifiers() & Qt::ControlModifier)) {
|
||||
|
||||
@@ -145,7 +145,7 @@ ExternalHelpWindow::ExternalHelpWindow(QWidget *parent)
|
||||
tr("Show Sidebar"), this);
|
||||
connect(action, SIGNAL(triggered()), this, SIGNAL(showHideSidebar()));
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
reset->setShortcut(QKeySequence(Qt::ALT + Qt::Key_0));
|
||||
action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_0));
|
||||
ctrlTab->setShortcut(QKeySequence(Qt::ALT + Qt::Key_Tab));
|
||||
|
||||
@@ -247,7 +247,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
cmd->setDefaultKeySequence(QKeySequence(Qt::Key_F1));
|
||||
connect(action, SIGNAL(triggered()), this, SLOT(activateContext()));
|
||||
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
action = new QAction(this);
|
||||
action->setSeparator(true);
|
||||
cmd = am->registerAction(action, Core::Id("Help.Separator"), globalcontext);
|
||||
@@ -264,7 +264,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
am->actionContainer(Core::Constants::M_HELP)->addAction(cmd, Core::Constants::G_HELP_HELP);
|
||||
connect(action, SIGNAL(triggered()), this, SLOT(slotReportBug()));
|
||||
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
action = new QAction(this);
|
||||
action->setSeparator(true);
|
||||
cmd = am->registerAction(action, Core::Id("Help.Separator2"), globalcontext);
|
||||
|
||||
@@ -56,7 +56,7 @@ OpenPagesSwitcher::OpenPagesSwitcher(OpenPagesModel *model)
|
||||
|
||||
// We disable the frame on this list view and use a QFrame around it instead.
|
||||
// This improves the look with QGTKStyle.
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
setFrameStyle(m_openPagesWidget->frameStyle());
|
||||
#endif
|
||||
m_openPagesWidget->setFrameStyle(QFrame::NoFrame);
|
||||
@@ -127,7 +127,7 @@ bool OpenPagesSwitcher::eventFilter(QObject *object, QEvent *event)
|
||||
emit setCurrentPage(m_openPagesWidget->currentIndex());
|
||||
return true;
|
||||
}
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
const Qt::KeyboardModifier modifier = Qt::AltModifier;
|
||||
#else
|
||||
const Qt::KeyboardModifier modifier = Qt::ControlModifier;
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QMenu>
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
#include <qmacstyle_mac.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ CompletionList::CompletionList(QWidget *parent)
|
||||
// This is too slow when done on all results
|
||||
//header()->setResizeMode(QHeaderView::ResizeToContents);
|
||||
setWindowFlags(Qt::ToolTip);
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
if (horizontalScrollBar())
|
||||
horizontalScrollBar()->setAttribute(Qt::WA_MacMiniSize);
|
||||
if (verticalScrollBar())
|
||||
|
||||
@@ -88,7 +88,7 @@ bool MacrosPlugin::initialize(const QStringList &arguments, QString *errorMessag
|
||||
|
||||
QAction *startMacro = new QAction(tr("Record Macro"), this);
|
||||
Core::Command *command = am->registerAction(startMacro, Constants::START_MACRO, textContext);
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+(")));
|
||||
#else
|
||||
command->setDefaultKeySequence(QKeySequence(tr("Alt+(")));
|
||||
@@ -99,7 +99,7 @@ bool MacrosPlugin::initialize(const QStringList &arguments, QString *errorMessag
|
||||
QAction *endMacro = new QAction(tr("Stop Recording Macro"), this);
|
||||
endMacro->setEnabled(false);
|
||||
command = am->registerAction(endMacro, Constants::END_MACRO, globalcontext);
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+)")));
|
||||
#else
|
||||
command->setDefaultKeySequence(QKeySequence(tr("Alt+)")));
|
||||
|
||||
@@ -67,7 +67,7 @@ BuildStepsWidgetData::BuildStepsWidgetData(BuildStep *s) :
|
||||
detailsWidget->setWidget(widget);
|
||||
|
||||
Utils::FadingPanel *toolWidget = new Utils::FadingPanel(detailsWidget);
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
QSize buttonSize(20, 20);
|
||||
#else
|
||||
QSize buttonSize(20, 26);
|
||||
|
||||
@@ -576,7 +576,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
// open action
|
||||
d->m_loadAction = new QAction(tr("Load Project..."), this);
|
||||
cmd = am->registerAction(d->m_loadAction, Constants::LOAD, globalcontext);
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+O")));
|
||||
#endif
|
||||
msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES);
|
||||
|
||||
@@ -59,21 +59,21 @@ void XUIFileDialog::runSaveFileDialog(const QString& path, QWidget* parent, QObj
|
||||
if (dir.isNull())
|
||||
dir = XUIFileDialog::defaultFolder();
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
QFileDialog *dialog = new QFileDialog(parent, Qt::Sheet);
|
||||
dialog->setFileMode(QFileDialog::AnyFile);
|
||||
dialog->setAcceptMode(QFileDialog::AcceptSave);
|
||||
dialog->setNameFilters(XUIFileDialog::fileNameFilters());
|
||||
dialog->setDirectory(dir);
|
||||
dialog->open(receiver, member);
|
||||
#else // !Q_WS_MAC
|
||||
#else // !Q_OS_MAC
|
||||
QString caption = QCoreApplication::translate("QmlDesigner::XUIFileDialog", "Save File");
|
||||
QString fileName = QFileDialog::getSaveFileName(parent, caption, dir, XUIFileDialog::fileNameFilters().join(";;"));
|
||||
|
||||
QmlDesigner::Internal::SignalEmitter emitter;
|
||||
QObject::connect(&emitter, SIGNAL(fileNameSelected(QString)), receiver, member);
|
||||
emitter.emitFileNameSelected(fileName);
|
||||
#endif // Q_WS_MAC
|
||||
#endif // Q_OS_MAC
|
||||
}
|
||||
|
||||
QStringList XUIFileDialog::fileNameFilters()
|
||||
|
||||
@@ -214,7 +214,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
|
||||
|
||||
QAction *showQuickToolbar = new QAction(tr("Show Qt Quick Toolbar"), this);
|
||||
cmd = am->registerAction(showQuickToolbar, Constants::SHOW_QT_QUICK_HELPER, context);
|
||||
#ifdef Q_WS_MACX
|
||||
#ifdef Q_OS_MACX
|
||||
cmd->setDefaultKeySequence(QKeySequence(Qt::META + Qt::ALT + Qt::Key_Space));
|
||||
#else
|
||||
cmd->setDefaultKeySequence(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Space));
|
||||
|
||||
@@ -577,7 +577,7 @@ Qt4DefaultTargetSetupWidget::Qt4DefaultTargetSetupWidget(Qt4BaseTargetFactory *f
|
||||
w = new QWidget;
|
||||
m_newBuildsLayout = new QGridLayout;
|
||||
m_newBuildsLayout->setMargin(0);
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
m_newBuildsLayout->setSpacing(0);
|
||||
#endif
|
||||
w->setLayout(m_newBuildsLayout);
|
||||
|
||||
@@ -580,7 +580,7 @@ static QString filterForQmakeFileDialog()
|
||||
{
|
||||
QString filter = QLatin1String("qmake (");
|
||||
foreach (const QString &s, Utils::BuildableHelperLibrary::possibleQMakeCommands()) {
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
// work around QTBUG-7739 that prohibits filters that don't start with *
|
||||
filter += QLatin1Char('*');
|
||||
#endif
|
||||
|
||||
@@ -1760,7 +1760,7 @@ void BaseTextEditorWidget::keyPressEvent(QKeyEvent *e)
|
||||
// fall through
|
||||
case Qt::Key_Right:
|
||||
case Qt::Key_Left:
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
if ((e->modifiers()
|
||||
& (Qt::AltModifier | Qt::ShiftModifier)) == (Qt::AltModifier | Qt::ShiftModifier)) {
|
||||
int diff_row = 0;
|
||||
@@ -3392,7 +3392,7 @@ void BaseTextEditorWidget::paintEvent(QPaintEvent *e)
|
||||
cursor_pen = painter.pen();
|
||||
}
|
||||
|
||||
#ifndef Q_WS_MAC // no visible cursor on mac
|
||||
#ifndef Q_OS_MAC // no visible cursor on mac
|
||||
if (blockSelectionCursorRect.isValid())
|
||||
painter.fillRect(blockSelectionCursorRect, palette().text());
|
||||
#endif
|
||||
|
||||
@@ -290,7 +290,7 @@ void FunctionHintProposalWidget::updateContent()
|
||||
void FunctionHintProposalWidget::updatePosition()
|
||||
{
|
||||
const QDesktopWidget *desktop = QApplication::desktop();
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
const QRect &screen = desktop->availableGeometry(desktop->screenNumber(d->m_underlyingWidget));
|
||||
#else
|
||||
const QRect &screen = desktop->screenGeometry(desktop->screenNumber(d->m_underlyingWidget));
|
||||
|
||||
@@ -306,7 +306,7 @@ void GenericProposalWidgetPrivate::maybeShowInfoTip()
|
||||
GenericProposalWidget::GenericProposalWidget()
|
||||
: d(new GenericProposalWidgetPrivate(this))
|
||||
{
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
if (d->m_completionListView->horizontalScrollBar())
|
||||
d->m_completionListView->horizontalScrollBar()->setAttribute(Qt::WA_MacMiniSize);
|
||||
if (d->m_completionListView->verticalScrollBar())
|
||||
@@ -493,7 +493,7 @@ void GenericProposalWidget::updatePositionAndSize()
|
||||
|
||||
// Determine the position, keeping the popup on the screen
|
||||
const QDesktopWidget *desktop = QApplication::desktop();
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
const QRect screen = desktop->availableGeometry(desktop->screenNumber(d->m_underlyingWidget));
|
||||
#else
|
||||
const QRect screen = desktop->screenGeometry(desktop->screenNumber(d->m_underlyingWidget));
|
||||
|
||||
@@ -53,7 +53,7 @@ static const char schemeFileNameKey[] = "ColorScheme";
|
||||
namespace {
|
||||
static const bool DEFAULT_ANTIALIAS = true;
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
enum { DEFAULT_FONT_SIZE = 12 };
|
||||
static const char *DEFAULT_FONT_FAMILY = "Monaco";
|
||||
#else
|
||||
|
||||
@@ -165,7 +165,7 @@ void TextEditorActionHandler::createActions()
|
||||
advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT);
|
||||
connect(m_formatAction, SIGNAL(triggered(bool)), this, SLOT(formatAction()));
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
QString modifier = tr("Meta");
|
||||
#else
|
||||
QString modifier = tr("Ctrl");
|
||||
@@ -277,7 +277,7 @@ void TextEditorActionHandler::createActions()
|
||||
|
||||
m_resetFontSizeAction = new QAction(tr("Reset Font Size"), this);
|
||||
command = am->registerAction(m_resetFontSizeAction, Constants::RESET_FONT_SIZE, m_contextId);
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+0")));
|
||||
#endif
|
||||
connect(m_resetFontSizeAction, SIGNAL(triggered()), this, SLOT(resetFontSize()));
|
||||
|
||||
@@ -137,7 +137,7 @@ bool TextEditorPlugin::initialize(const QStringList &arguments, QString *errorMe
|
||||
// Make sure the shortcut still works when the completion widget is active
|
||||
completionShortcut->setContext(Qt::ApplicationShortcut);
|
||||
Core::Command *command = am->registerShortcut(completionShortcut, Constants::COMPLETE_THIS, context);
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Space")));
|
||||
#else
|
||||
command->setDefaultKeySequence(QKeySequence(tr("Meta+Space")));
|
||||
|
||||
@@ -52,7 +52,7 @@ inline int screenNumber(const QPoint &pos, QWidget *w)
|
||||
|
||||
inline QRect screenGeometry(const QPoint &pos, QWidget *w)
|
||||
{
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
return QApplication::desktop()->availableGeometry(screenNumber(pos, w));
|
||||
#else
|
||||
return QApplication::desktop()->screenGeometry(screenNumber(pos, w));
|
||||
|
||||
@@ -107,7 +107,7 @@ bool ToolTip::acceptShow(const TipContent &content,
|
||||
}
|
||||
hideTipImmediately();
|
||||
}
|
||||
#if !defined(QT_NO_EFFECTS) && !defined(Q_WS_MAC)
|
||||
#if !defined(QT_NO_EFFECTS) && !defined(Q_OS_MAC)
|
||||
// While the effect takes places it might be that although the widget is actually on
|
||||
// screen the isVisible method doesn't return true.
|
||||
else if (m_tip
|
||||
@@ -168,7 +168,7 @@ bool ToolTip::isVisible() const
|
||||
|
||||
void ToolTip::showTip()
|
||||
{
|
||||
#if !defined(QT_NO_EFFECTS) && !defined(Q_WS_MAC)
|
||||
#if !defined(QT_NO_EFFECTS) && !defined(Q_OS_MAC)
|
||||
if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip))
|
||||
qFadeEffect(m_tip);
|
||||
else if (QApplication::isEffectEnabled(Qt::UI_AnimateTooltip))
|
||||
@@ -237,7 +237,7 @@ bool ToolTip::eventFilter(QObject *o, QEvent *event)
|
||||
return false;
|
||||
|
||||
switch (event->type()) {
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
case QEvent::KeyPress:
|
||||
case QEvent::KeyRelease: {
|
||||
int key = static_cast<QKeyEvent *>(event)->key();
|
||||
|
||||
@@ -167,7 +167,7 @@ bool IndexWindow::eventFilter(QObject *obj, QEvent *e)
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
else if (obj == m_indexWidget && e->type() == QEvent::KeyPress) {
|
||||
QKeyEvent *ke = static_cast<QKeyEvent*>(e);
|
||||
if (ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Enter)
|
||||
|
||||
Reference in New Issue
Block a user