mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-05 21:13:55 -07:00
Drop Qt4, libgcrypt, qtmobility dependencies
This commit is contained in:
parent
e3fb308ea1
commit
bb5292aa8d
54 changed files with 96 additions and 818 deletions
|
|
@ -12,11 +12,7 @@
|
|||
AbstractCounter::AbstractCounter(Player *_player, int _id, const QString &_name, bool _shownInCounterArea, int _value, QGraphicsItem *parent)
|
||||
: QGraphicsItem(parent), player(_player), id(_id), name(_name), value(_value), hovered(false), aDec(0), aInc(0), dialogSemaphore(false), deleteAfterDialog(false), shownInCounterArea(_shownInCounterArea)
|
||||
{
|
||||
#if QT_VERSION < 0x050000
|
||||
setAcceptsHoverEvents(true);
|
||||
#else
|
||||
setAcceptHoverEvents(true);
|
||||
#endif
|
||||
|
||||
shortcutActive = false;
|
||||
|
||||
|
|
@ -149,12 +145,7 @@ void AbstractCounter::setCounter()
|
|||
bool ok;
|
||||
dialogSemaphore = true;
|
||||
int newValue =
|
||||
#if QT_VERSION < 0x050000
|
||||
QInputDialog::getInteger(
|
||||
#else
|
||||
QInputDialog::getInt(
|
||||
#endif
|
||||
0, tr("Set counter"), tr("New value for counter '%1':").arg(name), value, -2000000000, 2000000000, 1, &ok);
|
||||
QInputDialog::getInt(0, tr("Set counter"), tr("New value for counter '%1':").arg(name), value, -2000000000, 2000000000, 1, &ok);
|
||||
if (deleteAfterDialog) {
|
||||
deleteLater();
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -6,10 +6,7 @@
|
|||
#include <QRegExp>
|
||||
#include <QMessageBox>
|
||||
#include <QDesktopServices>
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include <QUrlQuery>
|
||||
#endif
|
||||
|
||||
DeckStatsInterface::DeckStatsInterface(
|
||||
CardDatabase &_cardDatabase,
|
||||
|
|
@ -50,19 +47,12 @@ void DeckStatsInterface::getAnalyzeRequestData(DeckList *deck, QByteArray *data)
|
|||
DeckList deckWithoutTokens;
|
||||
copyDeckWithoutTokens(*deck, deckWithoutTokens);
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
QUrl params;
|
||||
params.addQueryItem("deck", deckWithoutTokens.writeToString_Plain());
|
||||
params.addQueryItem("decktitle", deck->getName());
|
||||
data->append(params.encodedQuery());
|
||||
#else
|
||||
QUrl params;
|
||||
QUrlQuery urlQuery;
|
||||
urlQuery.addQueryItem("deck", deckWithoutTokens.writeToString_Plain());
|
||||
urlQuery.addQueryItem("decktitle", deck->getName());
|
||||
params.setQuery(urlQuery);
|
||||
data->append(params.query(QUrl::EncodeReserved));
|
||||
#endif
|
||||
}
|
||||
|
||||
void DeckStatsInterface::analyzeDeck(DeckList *deck)
|
||||
|
|
|
|||
|
|
@ -65,11 +65,7 @@ void DeckViewCardDragItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
DeckViewCard::DeckViewCard(const QString &_name, const QString &_originZone, QGraphicsItem *parent)
|
||||
: AbstractCardItem(_name, 0, -1, parent), originZone(_originZone), dragItem(0)
|
||||
{
|
||||
#if QT_VERSION < 0x050000
|
||||
setAcceptsHoverEvents(true);
|
||||
#else
|
||||
setAcceptHoverEvents(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
DeckViewCard::~DeckViewCard()
|
||||
|
|
|
|||
|
|
@ -83,11 +83,8 @@ DlgCreateToken::DlgCreateToken(const QStringList &_predefinedTokens, QWidget *pa
|
|||
chooseTokenView->setWordWrap(true);
|
||||
chooseTokenView->setColumnWidth(0, 130);
|
||||
chooseTokenView->setColumnWidth(3, 178);
|
||||
#if QT_VERSION < 0x050000
|
||||
chooseTokenView->header()->setResizeMode(4, QHeaderView::ResizeToContents);
|
||||
#else
|
||||
chooseTokenView->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents);
|
||||
#endif
|
||||
|
||||
connect(chooseTokenView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex, QModelIndex)), this, SLOT(tokenSelectionChanged(QModelIndex, QModelIndex)));
|
||||
|
||||
if (predefinedTokens.isEmpty())
|
||||
|
|
|
|||
|
|
@ -77,13 +77,9 @@ DlgEditTokens::DlgEditTokens(QWidget *parent)
|
|||
chooseTokenView->header()->setStretchLastSection(false);
|
||||
chooseTokenView->header()->hideSection(1);
|
||||
chooseTokenView->header()->hideSection(2);
|
||||
#if QT_VERSION < 0x050000
|
||||
chooseTokenView->header()->setResizeMode(3, QHeaderView::ResizeToContents);
|
||||
chooseTokenView->header()->setResizeMode(4, QHeaderView::ResizeToContents);
|
||||
#else
|
||||
chooseTokenView->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents);
|
||||
chooseTokenView->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents);
|
||||
#endif
|
||||
|
||||
connect(chooseTokenView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex, QModelIndex)), this, SLOT(tokenSelectionChanged(QModelIndex, QModelIndex)));
|
||||
|
||||
QAction *aAddToken = new QAction(tr("Add token"), this);
|
||||
|
|
|
|||
|
|
@ -697,11 +697,6 @@ SoundSettingsPage::SoundSettingsPage()
|
|||
connect(masterVolumeSlider, SIGNAL(valueChanged(int)), masterVolumeSpinBox, SLOT(setValue(int)));
|
||||
connect(masterVolumeSpinBox, SIGNAL(valueChanged(int)), masterVolumeSlider, SLOT(setValue(int)));
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
masterVolumeSlider->setEnabled(false);
|
||||
masterVolumeSpinBox->setEnabled(false);
|
||||
#endif
|
||||
|
||||
QGridLayout *soundGrid = new QGridLayout;
|
||||
soundGrid->addWidget(&soundEnabledCheckBox, 0, 0, 1, 3);
|
||||
soundGrid->addWidget(&masterVolumeLabel, 1, 0);
|
||||
|
|
@ -736,12 +731,7 @@ void SoundSettingsPage::retranslateUi() {
|
|||
themeLabel.setText(tr("Current sounds theme:"));
|
||||
soundTestButton.setText(tr("Test system sound engine"));
|
||||
soundGroupBox->setTitle(tr("Sound settings"));
|
||||
#if QT_VERSION < 0x050000
|
||||
masterVolumeLabel.setText(tr("Master volume requires QT5"));
|
||||
#else
|
||||
masterVolumeLabel.setText(tr("Master volume"));
|
||||
#endif
|
||||
|
||||
masterVolumeLabel.setText(tr("Master volume"));
|
||||
}
|
||||
|
||||
DlgSettings::DlgSettings(QWidget *parent)
|
||||
|
|
|
|||
|
|
@ -54,11 +54,8 @@ GameSelector::GameSelector(AbstractClient *_client, const TabSupervisor *_tabSup
|
|||
if (showfilters && restoresettings)
|
||||
gameListProxyModel->loadFilterParameters(gameTypeMap);
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
gameListView->header()->setResizeMode(0, QHeaderView::ResizeToContents);
|
||||
#else
|
||||
gameListView->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
|
||||
#endif
|
||||
|
||||
filterButton = new QPushButton;
|
||||
filterButton->setIcon(QPixmap("theme:icons/search"));
|
||||
connect(filterButton, SIGNAL(clicked()), this, SLOT(actSetFilter()));
|
||||
|
|
|
|||
|
|
@ -30,11 +30,7 @@ void HandCounter::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*op
|
|||
painter->save();
|
||||
QSize translatedSize = painter->combinedTransform().mapRect(boundingRect()).size().toSize();
|
||||
QPixmap cachedPixmap;
|
||||
#if QT_VERSION >= 0x040600
|
||||
if (!QPixmapCache::find("handCounter" + QString::number(translatedSize.width()), &cachedPixmap)) {
|
||||
#else
|
||||
if (!QPixmapCache::find("handCounter" + QString::number(translatedSize.width()), cachedPixmap)) {
|
||||
#endif
|
||||
cachedPixmap = QPixmap("theme:hand").scaled(translatedSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
QPixmapCache::insert("handCounter" + QString::number(translatedSize.width()), cachedPixmap);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,16 +55,6 @@ ThemeManager *themeManager;
|
|||
const QString translationPrefix = "cockatrice";
|
||||
QString translationPath;
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
static void myMessageOutput(QtMsgType /*type*/, const char *msg)
|
||||
{
|
||||
QFile file("qdebug.txt");
|
||||
file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text);
|
||||
QTextStream out(&file);
|
||||
out << msg << endl;
|
||||
file.close();
|
||||
}
|
||||
#else
|
||||
static void myMessageOutput(QtMsgType /*type*/, const QMessageLogContext &, const QString &msg)
|
||||
{
|
||||
QFile file("qdebug.txt");
|
||||
|
|
@ -73,7 +63,6 @@ static void myMessageOutput(QtMsgType /*type*/, const QMessageLogContext &, cons
|
|||
out << msg << endl;
|
||||
file.close();
|
||||
}
|
||||
#endif
|
||||
|
||||
void installNewTranslator()
|
||||
{
|
||||
|
|
@ -103,22 +92,12 @@ int main(int argc, char *argv[])
|
|||
QApplication app(argc, argv);
|
||||
|
||||
if (app.arguments().contains("--debug-output"))
|
||||
{
|
||||
#if QT_VERSION < 0x050000
|
||||
qInstallMsgHandler(myMessageOutput);
|
||||
#else
|
||||
qInstallMessageHandler(myMessageOutput);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
app.addLibraryPath(app.applicationDirPath() + "/plugins");
|
||||
#endif
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
// gone in Qt5, all source files _MUST_ be utf8-encoded
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
#endif
|
||||
|
||||
QCoreApplication::setOrganizationName("Cockatrice");
|
||||
QCoreApplication::setOrganizationDomain("cockatrice.de");
|
||||
QCoreApplication::setApplicationName("Cockatrice");
|
||||
|
|
@ -158,9 +137,8 @@ int main(int argc, char *argv[])
|
|||
|
||||
ui.show();
|
||||
qDebug("main(): ui.show() finished");
|
||||
#if QT_VERSION > 0x050000
|
||||
|
||||
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
#endif
|
||||
app.exec();
|
||||
|
||||
qDebug("Event loop finished, terminating...");
|
||||
|
|
|
|||
|
|
@ -13,11 +13,7 @@ PileZone::PileZone(Player *_p, const QString &_name, bool _isShufflable, bool _c
|
|||
: CardZone(_p, _name, false, _isShufflable, _contentsKnown, parent)
|
||||
{
|
||||
setCacheMode(DeviceCoordinateCache); // Do not move this line to the parent constructor!
|
||||
#if QT_VERSION < 0x050000
|
||||
setAcceptsHoverEvents(true);
|
||||
#else
|
||||
setAcceptHoverEvents(true);
|
||||
#endif
|
||||
setCursor(Qt::OpenHandCursor);
|
||||
|
||||
setTransform(QTransform().translate((float) CARD_WIDTH / 2, (float) CARD_HEIGHT / 2).rotate(90).translate((float) -CARD_WIDTH / 2, (float) -CARD_HEIGHT / 2));
|
||||
|
|
|
|||
|
|
@ -516,13 +516,7 @@ void Player::playerListActionTriggered()
|
|||
} else if (menu == mRevealTopCard) {
|
||||
int decksize = zones.value("deck")->getCards().size();
|
||||
bool ok;
|
||||
int number =
|
||||
#if QT_VERSION < 0x050000
|
||||
QInputDialog::getInteger(
|
||||
#else
|
||||
QInputDialog::getInt(
|
||||
#endif
|
||||
0, tr("Reveal top cards of library"), tr("Number of cards: (max. %1)").arg(decksize), defaultNumberTopCards, 1, decksize, 1, &ok);
|
||||
int number = QInputDialog::getInt(0, tr("Reveal top cards of library"), tr("Number of cards: (max. %1)").arg(decksize), defaultNumberTopCards, 1, decksize, 1, &ok);
|
||||
if (ok) {
|
||||
cmd.set_zone_name("deck");
|
||||
cmd.set_top_cards(number);
|
||||
|
|
@ -867,13 +861,7 @@ void Player::actViewLibrary()
|
|||
void Player::actViewTopCards()
|
||||
{
|
||||
bool ok;
|
||||
int number =
|
||||
#if QT_VERSION < 0x050000
|
||||
QInputDialog::getInteger(
|
||||
#else
|
||||
QInputDialog::getInt(
|
||||
#endif
|
||||
0, tr("View top cards of library"), tr("Number of cards:"), defaultNumberTopCards, 1, 2000000000, 1, &ok);
|
||||
int number = QInputDialog::getInt(0, tr("View top cards of library"), tr("Number of cards:"), defaultNumberTopCards, 1, 2000000000, 1, &ok);
|
||||
if (ok) {
|
||||
defaultNumberTopCards = number;
|
||||
static_cast<GameScene *>(scene())->toggleZoneView(this, "deck", number);
|
||||
|
|
@ -928,14 +916,8 @@ void Player::actMulligan()
|
|||
|
||||
void Player::actDrawCards()
|
||||
{
|
||||
int number =
|
||||
#if QT_VERSION < 0x050000
|
||||
QInputDialog::getInteger(
|
||||
#else
|
||||
QInputDialog::getInt(
|
||||
#endif
|
||||
0, tr("Draw cards"), tr("Number:"));
|
||||
if (number) {
|
||||
int number = QInputDialog::getInt(0, tr("Draw cards"), tr("Number:"));
|
||||
if (number) {
|
||||
Command_DrawCards cmd;
|
||||
cmd.set_number(number);
|
||||
sendGameCommand(cmd);
|
||||
|
|
@ -949,13 +931,7 @@ void Player::actUndoDraw()
|
|||
|
||||
void Player::actMoveTopCardsToGrave()
|
||||
{
|
||||
int number =
|
||||
#if QT_VERSION < 0x050000
|
||||
QInputDialog::getInteger(
|
||||
#else
|
||||
QInputDialog::getInt(
|
||||
#endif
|
||||
0, tr("Move top cards to grave"), tr("Number:"));
|
||||
int number = QInputDialog::getInt(0, tr("Move top cards to grave"), tr("Number:"));
|
||||
if (!number)
|
||||
return;
|
||||
|
||||
|
|
@ -978,13 +954,7 @@ void Player::actMoveTopCardsToGrave()
|
|||
|
||||
void Player::actMoveTopCardsToExile()
|
||||
{
|
||||
int number =
|
||||
#if QT_VERSION < 0x050000
|
||||
QInputDialog::getInteger(
|
||||
#else
|
||||
QInputDialog::getInt(
|
||||
#endif
|
||||
0, tr("Move top cards to exile"), tr("Number:"));
|
||||
int number = QInputDialog::getInt(0, tr("Move top cards to exile"), tr("Number:"));
|
||||
if (!number)
|
||||
return;
|
||||
|
||||
|
|
@ -1059,13 +1029,7 @@ void Player::actUntapAll()
|
|||
void Player::actRollDie()
|
||||
{
|
||||
bool ok;
|
||||
int sides =
|
||||
#if QT_VERSION < 0x050000
|
||||
QInputDialog::getInteger(
|
||||
#else
|
||||
QInputDialog::getInt(
|
||||
#endif
|
||||
static_cast<QWidget *>(parent()), tr("Roll die"), tr("Number of sides:"), 20, 2, 1000, 1, &ok);
|
||||
int sides = QInputDialog::getInt(static_cast<QWidget *>(parent()), tr("Roll die"), tr("Number of sides:"), 20, 2, 1000, 1, &ok);
|
||||
if (ok) {
|
||||
Command_RollDie cmd;
|
||||
cmd.set_sides(sides);
|
||||
|
|
@ -2269,13 +2233,7 @@ void Player::actCardCounterTrigger()
|
|||
case 11: {
|
||||
bool ok;
|
||||
dialogSemaphore = true;
|
||||
int number =
|
||||
#if QT_VERSION < 0x050000
|
||||
QInputDialog::getInteger(
|
||||
#else
|
||||
QInputDialog::getInt(
|
||||
#endif
|
||||
0, tr("Set counters"), tr("Number:"), 0, 0, MAX_COUNTERS_ON_CARD, 1, &ok);
|
||||
int number = QInputDialog::getInt(0, tr("Set counters"), tr("Number:"), 0, 0, MAX_COUNTERS_ON_CARD, 1, &ok);
|
||||
dialogSemaphore = false;
|
||||
if (clearCardsToDelete())
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -81,11 +81,7 @@ void PlayerTarget::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*o
|
|||
QSize translatedSize = translatedRect.size().toSize();
|
||||
QPixmap cachedPixmap;
|
||||
const QString cacheKey = "avatar" + QString::number(translatedSize.width()) + "_" + QString::number(info->user_level()) + "_" + QString::number(fullPixmap.cacheKey());
|
||||
#if QT_VERSION >= 0x040600
|
||||
if (!QPixmapCache::find(cacheKey, &cachedPixmap)) {
|
||||
#else
|
||||
if (!QPixmapCache::find(cacheKey, cachedPixmap)) {
|
||||
#endif
|
||||
cachedPixmap = QPixmap(translatedSize.width(), translatedSize.height());
|
||||
|
||||
QPainter tempPainter(&cachedPixmap);
|
||||
|
|
|
|||
|
|
@ -12,11 +12,6 @@
|
|||
#include "main.h"
|
||||
#include "carddatabase.h"
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
// for Qt::escape()
|
||||
#include <QtGui/qtextdocument.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
|
@ -137,12 +132,7 @@ void DBPriceUpdater::downloadFinished()
|
|||
if(resultMap.contains("errors"))
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), tr("A problem has occured while fetching card prices:") +
|
||||
"<br/>" +
|
||||
#if QT_VERSION < 0x050000
|
||||
Qt::escape(resultMap["errors"].toList().first().toString())
|
||||
#else
|
||||
resultMap["errors"].toList().first().toString().toHtmlEscaped()
|
||||
#endif
|
||||
"<br/>" + resultMap["errors"].toList().first().toString().toHtmlEscaped()
|
||||
);
|
||||
reply->deleteLater();
|
||||
if(urls.isEmpty())
|
||||
|
|
|
|||
|
|
@ -283,11 +283,7 @@ RemoteDeckList_TreeWidget::RemoteDeckList_TreeWidget(AbstractClient *_client, QW
|
|||
setModel(proxyModel);
|
||||
connect(treeModel, SIGNAL(treeRefreshed()), this, SLOT(expandAll()));
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
header()->setResizeMode(QHeaderView::ResizeToContents);
|
||||
#else
|
||||
header()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
#endif
|
||||
setUniformRowHeights(true);
|
||||
setSortingEnabled(true);
|
||||
proxyModel->sort(0, Qt::AscendingOrder);
|
||||
|
|
|
|||
|
|
@ -278,11 +278,7 @@ RemoteReplayList_TreeWidget::RemoteReplayList_TreeWidget(AbstractClient *_client
|
|||
proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||
setModel(proxyModel);
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
header()->setResizeMode(QHeaderView::ResizeToContents);
|
||||
#else
|
||||
header()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
#endif
|
||||
header()->setStretchLastSection(false);
|
||||
setUniformRowHeights(true);
|
||||
setSortingEnabled(true);
|
||||
|
|
|
|||
|
|
@ -4,22 +4,15 @@
|
|||
#include <QDir>
|
||||
#include <QDebug>
|
||||
#include <QApplication>
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include <QStandardPaths>
|
||||
#else
|
||||
#include <QDesktopServices>
|
||||
#endif
|
||||
#include <QStandardPaths>
|
||||
|
||||
QString SettingsCache::getDataPath()
|
||||
{
|
||||
return
|
||||
#ifdef PORTABLE_BUILD
|
||||
qApp->applicationDirPath() + "/data/";
|
||||
#elif QT_VERSION >= 0x050000
|
||||
QStandardPaths::writableLocation(QStandardPaths::DataLocation);
|
||||
#else
|
||||
QDesktopServices::storageLocation(QDesktopServices::DataLocation);
|
||||
QStandardPaths::writableLocation(QStandardPaths::DataLocation);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,11 +7,7 @@
|
|||
#include <QDebug>
|
||||
#include <QFileInfo>
|
||||
#include <QLibraryInfo>
|
||||
#if QT_VERSION < 0x050000
|
||||
#include <QDesktopServices>
|
||||
#else
|
||||
#include <QStandardPaths>
|
||||
#endif
|
||||
#include <QStandardPaths>
|
||||
|
||||
#define DEFAULT_THEME_NAME "Default"
|
||||
#define TEST_SOUND_FILENAME "player_join"
|
||||
|
|
@ -47,13 +43,8 @@ void SoundEngine::soundEnabledChanged()
|
|||
if(!player)
|
||||
{
|
||||
QAudioFormat format;
|
||||
#if QT_VERSION < 0x050000
|
||||
format.setFrequency(44100);
|
||||
format.setChannels(1);
|
||||
#else
|
||||
format.setSampleRate(44100);
|
||||
format.setChannelCount(1);
|
||||
#endif
|
||||
format.setSampleSize(16);
|
||||
format.setCodec("audio/pcm");
|
||||
format.setByteOrder(QAudioFormat::LittleEndian);
|
||||
|
|
@ -88,9 +79,8 @@ void SoundEngine::playSound(QString fileName)
|
|||
inputBuffer->close();
|
||||
inputBuffer->setData(audioData[fileName]);
|
||||
inputBuffer->open(QIODevice::ReadOnly);
|
||||
#if QT_VERSION >= 0x050000
|
||||
|
||||
player->setVolume(settingsCache->getMasterVolume() / 100.0);
|
||||
#endif
|
||||
player->stop();
|
||||
player->start(inputBuffer);
|
||||
}
|
||||
|
|
@ -119,8 +109,6 @@ QStringMap & SoundEngine::getAvailableThemes()
|
|||
dir =
|
||||
#ifdef PORTABLE_BUILD
|
||||
qApp->applicationDirPath() +
|
||||
#elif QT_VERSION < 0x050000
|
||||
QDesktopServices::storageLocation(QDesktopServices::DataLocation) +
|
||||
#else
|
||||
QStandardPaths::standardLocations(QStandardPaths::DataLocation).first() +
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -60,11 +60,7 @@ void TabDeckEditor::createDeckDock()
|
|||
deckView->setUniformRowHeights(true);
|
||||
deckView->setSortingEnabled(true);
|
||||
deckView->sortByColumn(1, Qt::AscendingOrder);
|
||||
#if QT_VERSION < 0x050000
|
||||
deckView->header()->setResizeMode(QHeaderView::ResizeToContents);
|
||||
#else
|
||||
deckView->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
#endif
|
||||
deckView->installEventFilter(&deckViewKeySignals);
|
||||
connect(deckView->selectionModel(), SIGNAL(currentRowChanged(const QModelIndex &, const QModelIndex &)), this, SLOT(updateCardInfoRight(const QModelIndex &, const QModelIndex &)));
|
||||
connect(deckView, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(actSwapCard()));
|
||||
|
|
|
|||
|
|
@ -38,11 +38,7 @@ TabDeckStorage::TabDeckStorage(TabSupervisor *_tabSupervisor, AbstractClient *_c
|
|||
localDirView->setColumnHidden(1, true);
|
||||
localDirView->setRootIndex(localDirModel->index(localDirModel->rootPath(), 0));
|
||||
localDirView->setSortingEnabled(true);
|
||||
#if QT_VERSION < 0x050000
|
||||
localDirView->header()->setResizeMode(QHeaderView::ResizeToContents);
|
||||
#else
|
||||
localDirView->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
#endif
|
||||
localDirView->header()->setSortIndicator(0, Qt::AscendingOrder);
|
||||
|
||||
leftToolBar = new QToolBar;
|
||||
|
|
|
|||
|
|
@ -1581,10 +1581,7 @@ void TabGame::createMessageDock(bool bReplay)
|
|||
completer = new QCompleter(autocompleteUserList, sayEdit);
|
||||
completer->setCaseSensitivity(Qt::CaseInsensitive);
|
||||
completer->setMaxVisibleItems(5);
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
completer->setFilterMode(Qt::MatchStartsWith);
|
||||
#endif
|
||||
|
||||
sayEdit->setCompleter(completer);
|
||||
actCompleterChanged();
|
||||
|
|
|
|||
|
|
@ -17,9 +17,7 @@
|
|||
#include "pb/response_viewlog_history.pb.h"
|
||||
|
||||
#include <QtGui>
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include <QtWidgets>
|
||||
#endif
|
||||
|
||||
TabLog::TabLog(TabSupervisor *_tabSupervisor, AbstractClient *_client, QWidget *parent)
|
||||
: Tab(_tabSupervisor, parent), client(_client)
|
||||
|
|
|
|||
|
|
@ -36,11 +36,7 @@ TabReplays::TabReplays(TabSupervisor *_tabSupervisor, AbstractClient *_client)
|
|||
localDirView->setColumnHidden(1, true);
|
||||
localDirView->setRootIndex(localDirModel->index(localDirModel->rootPath(), 0));
|
||||
localDirView->setSortingEnabled(true);
|
||||
#if QT_VERSION < 0x050000
|
||||
localDirView->header()->setResizeMode(QHeaderView::ResizeToContents);
|
||||
#else
|
||||
localDirView->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
#endif
|
||||
localDirView->header()->setSortIndicator(0, Qt::AscendingOrder);
|
||||
|
||||
leftToolBar = new QToolBar;
|
||||
|
|
|
|||
|
|
@ -118,10 +118,7 @@ TabRoom::TabRoom(TabSupervisor *_tabSupervisor, AbstractClient *_client, ServerI
|
|||
completer = new QCompleter(autocompleteUserList, sayEdit);
|
||||
completer->setCaseSensitivity(Qt::CaseInsensitive);
|
||||
completer->setMaxVisibleItems(5);
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
completer->setFilterMode(Qt::MatchStartsWith);
|
||||
#endif
|
||||
completer->setFilterMode(Qt::MatchStartsWith);
|
||||
|
||||
sayEdit->setCompleter(completer);
|
||||
actCompleterChanged();
|
||||
|
|
|
|||
|
|
@ -28,17 +28,11 @@ RoomSelector::RoomSelector(AbstractClient *_client, QWidget *parent)
|
|||
roomList->setRootIsDecorated(false);
|
||||
roomList->setColumnCount(5);
|
||||
roomList->header()->setStretchLastSection(false);
|
||||
#if QT_VERSION < 0x050000
|
||||
roomList->header()->setResizeMode(0, QHeaderView::ResizeToContents);
|
||||
roomList->header()->setResizeMode(1, QHeaderView::Stretch);
|
||||
roomList->header()->setResizeMode(2, QHeaderView::ResizeToContents);
|
||||
roomList->header()->setResizeMode(3, QHeaderView::ResizeToContents);
|
||||
#else
|
||||
roomList->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
|
||||
roomList->header()->setSectionResizeMode(1, QHeaderView::Stretch);
|
||||
roomList->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
|
||||
roomList->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents);
|
||||
#endif
|
||||
|
||||
joinButton = new QPushButton;
|
||||
connect(joinButton, SIGNAL(clicked()), this, SLOT(joinClicked()));
|
||||
QHBoxLayout *buttonLayout = new QHBoxLayout;
|
||||
|
|
|
|||
|
|
@ -35,11 +35,7 @@ TableZone::TableZone(Player *_p, QGraphicsItem *parent)
|
|||
currentMinimumWidth = width;
|
||||
|
||||
setCacheMode(DeviceCoordinateCache);
|
||||
#if QT_VERSION < 0x050000
|
||||
setAcceptsHoverEvents(true);
|
||||
#else
|
||||
setAcceptHoverEvents(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,11 +5,7 @@
|
|||
#include <QColor>
|
||||
#include <QPixmapCache>
|
||||
#include <QLibraryInfo>
|
||||
#if QT_VERSION < 0x050000
|
||||
#include <QDesktopServices>
|
||||
#else
|
||||
#include <QStandardPaths>
|
||||
#endif
|
||||
#include <QStandardPaths>
|
||||
|
||||
#define DEFAULT_THEME_NAME "Default"
|
||||
#define STYLE_CSS_NAME "style.css"
|
||||
|
|
@ -45,8 +41,6 @@ QStringMap & ThemeManager::getAvailableThemes()
|
|||
dir =
|
||||
#ifdef PORTABLE_BUILD
|
||||
qApp->applicationDirPath() +
|
||||
#elif QT_VERSION < 0x050000
|
||||
QDesktopServices::storageLocation(QDesktopServices::DataLocation) +
|
||||
#else
|
||||
QStandardPaths::standardLocations(QStandardPaths::DataLocation).first() +
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -12,10 +12,8 @@
|
|||
#include "pending_command.h"
|
||||
|
||||
#include <QtGui>
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include <QtWidgets>
|
||||
#include <QSignalMapper>
|
||||
#endif
|
||||
|
||||
#include "pb/commands.pb.h"
|
||||
#include "pb/session_commands.pb.h"
|
||||
|
|
|
|||
|
|
@ -311,11 +311,7 @@ UserList::UserList(TabSupervisor *_tabSupervisor, AbstractClient *_client, UserL
|
|||
|
||||
userTree = new QTreeWidget;
|
||||
userTree->setColumnCount(3);
|
||||
#if QT_VERSION < 0x050000
|
||||
userTree->header()->setResizeMode(QHeaderView::ResizeToContents);
|
||||
#else
|
||||
userTree->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
#endif
|
||||
userTree->setHeaderHidden(true);
|
||||
userTree->setRootIsDecorated(false);
|
||||
userTree->setIconSize(QSize(20, 12));
|
||||
|
|
|
|||
|
|
@ -31,12 +31,7 @@
|
|||
#include <QSystemTrayIcon>
|
||||
#include <QApplication>
|
||||
#include <QtNetwork>
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
#include <QtGui/qtextdocument.h> // for Qt::escape()
|
||||
#else
|
||||
#include <QtConcurrent>
|
||||
#endif
|
||||
#include <QtConcurrent>
|
||||
|
||||
#include "main.h"
|
||||
#include "window_main.h"
|
||||
|
|
@ -397,15 +392,7 @@ QString MainWindow::extractInvalidUsernameMessage(QString & in)
|
|||
out += "<li>" + tr("can %1 contain numeric characters").arg((rules.at(4).toInt() > 0) ? "" : tr("NOT")) + "</li>";
|
||||
|
||||
if (rules.at(6).size() > 0)
|
||||
{
|
||||
out += "<li>" + tr("can contain the following punctuation: %1").arg(
|
||||
#if QT_VERSION < 0x050000
|
||||
Qt::escape(rules.at(6))
|
||||
#else
|
||||
rules.at(6).toHtmlEscaped()
|
||||
#endif
|
||||
) + "</li>";
|
||||
}
|
||||
out += "<li>" + tr("can contain the following punctuation: %1").arg(rules.at(6).toHtmlEscaped()) + "</li>";
|
||||
|
||||
out += "<li>" + tr("first character can %1 be a punctuation mark").arg((rules.at(5).toInt() > 0) ? "" : tr("NOT")) + "</li>";
|
||||
out += "</ul>";
|
||||
|
|
|
|||
|
|
@ -70,13 +70,8 @@ WndSets::WndSets(QWidget *parent)
|
|||
view->setDropIndicatorShown(true);
|
||||
view->setDragDropMode(QAbstractItemView::InternalMove);
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
view->header()->setResizeMode(QHeaderView::Stretch);
|
||||
view->header()->setResizeMode(SetsModel::LongNameCol, QHeaderView::ResizeToContents);
|
||||
#else
|
||||
view->header()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
view->header()->setSectionResizeMode(SetsModel::LongNameCol, QHeaderView::ResizeToContents);
|
||||
#endif
|
||||
|
||||
view->sortByColumn(SetsModel::SortKeyCol, Qt::AscendingOrder);
|
||||
view->setColumnHidden(SetsModel::SortKeyCol, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue