Ported cockatrice
This commit is contained in:
parent
bab340f7b7
commit
6dbdaafb33
22 changed files with 181 additions and 16 deletions
|
@ -172,6 +172,13 @@ if(Qt5Widgets_FOUND)
|
|||
list(APPEND COCKATRICE_LIBS Multimedia)
|
||||
endif()
|
||||
|
||||
# QtPrinter
|
||||
find_package(Qt5PrintSupport)
|
||||
if(Qt5PrintSupport_FOUND)
|
||||
include_directories(${Qt5PrintSupport_INCLUDE_DIRS})
|
||||
list(APPEND COCKATRICE_LIBS PrintSupport)
|
||||
endif()
|
||||
|
||||
# QtXml
|
||||
find_package(Qt5Xml)
|
||||
if(Qt5Xml_FOUND)
|
||||
|
|
|
@ -11,8 +11,12 @@
|
|||
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
|
||||
|
||||
if (player->getLocal()) {
|
||||
menu = new QMenu(name);
|
||||
aSet = new QAction(this);
|
||||
|
@ -129,7 +133,13 @@ void AbstractCounter::setCounter()
|
|||
{
|
||||
bool ok;
|
||||
dialogSemaphore = true;
|
||||
int newValue = QInputDialog::getInteger(0, tr("Set counter"), tr("New value for counter '%1':").arg(name), value, -2000000000, 2000000000, 1, &ok);
|
||||
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);
|
||||
if (deleteAfterDialog) {
|
||||
deleteLater();
|
||||
return;
|
||||
|
|
|
@ -68,6 +68,10 @@ QVariant CardDatabaseModel::headerData(int section, Qt::Orientation orientation,
|
|||
|
||||
void CardDatabaseModel::updateCardList()
|
||||
{
|
||||
#if QT_VERSION >= 0x050000
|
||||
beginResetModel();
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < cardList.size(); ++i)
|
||||
disconnect(cardList[i], 0, this, 0);
|
||||
|
||||
|
@ -75,7 +79,11 @@ void CardDatabaseModel::updateCardList()
|
|||
for (int i = 0; i < cardList.size(); ++i)
|
||||
connect(cardList[i], SIGNAL(cardInfoChanged(CardInfo *)), this, SLOT(cardInfoChanged(CardInfo *)));
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
reset();
|
||||
#else
|
||||
endResetModel();
|
||||
#endif
|
||||
}
|
||||
|
||||
void CardDatabaseModel::cardInfoChanged(CardInfo *card)
|
||||
|
|
|
@ -30,6 +30,10 @@ DeckListModel::~DeckListModel()
|
|||
|
||||
void DeckListModel::rebuildTree()
|
||||
{
|
||||
#if QT_VERSION >= 0x050000
|
||||
beginResetModel();
|
||||
#endif
|
||||
|
||||
root->clearTree();
|
||||
InnerDecklistNode *listRoot = deckList->getRoot();
|
||||
for (int i = 0; i < listRoot->size(); i++) {
|
||||
|
@ -55,7 +59,11 @@ void DeckListModel::rebuildTree()
|
|||
}
|
||||
}
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
reset();
|
||||
#else
|
||||
endResetModel();
|
||||
#endif
|
||||
}
|
||||
|
||||
int DeckListModel::rowCount(const QModelIndex &parent) const
|
||||
|
|
|
@ -48,13 +48,15 @@ void DeckStatsInterface::analyzeDeck(DeckList *deck)
|
|||
QUrl params;
|
||||
#if QT_VERSION < 0x050000
|
||||
params.addQueryItem("deck", deck->writeToString_Plain());
|
||||
QByteArray data;
|
||||
data.append(params.encodedQuery());
|
||||
#else
|
||||
QUrlQuery urlQuery;
|
||||
urlQuery.addQueryItem("deck", deck->writeToString_Plain());
|
||||
params.setUrlQuery(urlQuery);
|
||||
#endif
|
||||
params.setQuery(urlQuery);
|
||||
QByteArray data;
|
||||
data.append(params.encodedQuery());
|
||||
data.append(params.query(QUrl::EncodeReserved));
|
||||
#endif
|
||||
|
||||
QNetworkRequest request(QUrl("http://deckstats.net/index.php"));
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
|
||||
|
|
|
@ -64,7 +64,11 @@ 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()
|
||||
|
|
|
@ -79,8 +79,13 @@ DlgCreateToken::DlgCreateToken(const QStringList &_predefinedTokens, QWidget *pa
|
|||
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)));
|
||||
|
||||
if (predefinedTokens.isEmpty())
|
||||
|
|
|
@ -73,8 +73,13 @@ DlgEditTokens::DlgEditTokens(CardDatabaseModel *_cardDatabaseModel, QWidget *par
|
|||
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);
|
||||
|
|
|
@ -33,8 +33,11 @@ GameSelector::GameSelector(AbstractClient *_client, const TabSupervisor *_tabSup
|
|||
gameListView->header()->hideSection(1);
|
||||
else
|
||||
gameListProxyModel->setUnavailableGamesVisible(true);
|
||||
#if QT_VERSION < 0x050000
|
||||
gameListView->header()->setResizeMode(1, QHeaderView::ResizeToContents);
|
||||
|
||||
#else
|
||||
gameListView->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
|
||||
#endif
|
||||
filterButton = new QPushButton;
|
||||
filterButton->setIcon(QIcon(":/resources/icon_search.svg"));
|
||||
connect(filterButton, SIGNAL(clicked()), this, SLOT(actSetFilter()));
|
||||
|
|
|
@ -55,6 +55,7 @@ QString translationPath = TRANSLATION_PATH;
|
|||
QString translationPath = QString();
|
||||
#endif
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
void myMessageOutput(QtMsgType /*type*/, const char *msg)
|
||||
{
|
||||
QFile file("qdebug.txt");
|
||||
|
@ -63,6 +64,16 @@ void myMessageOutput(QtMsgType /*type*/, const char *msg)
|
|||
out << msg << endl;
|
||||
file.close();
|
||||
}
|
||||
#else
|
||||
void myMessageOutput(QtMsgType /*type*/, const QMessageLogContext &, const QString &msg)
|
||||
{
|
||||
QFile file("qdebug.txt");
|
||||
file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text);
|
||||
QTextStream out(&file);
|
||||
out << msg << endl;
|
||||
file.close();
|
||||
}
|
||||
#endif
|
||||
|
||||
void installNewTranslator()
|
||||
{
|
||||
|
@ -87,7 +98,13 @@ 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_MAC
|
||||
QDir baseDir(app.applicationDirPath());
|
||||
baseDir.cdUp();
|
||||
|
@ -100,7 +117,11 @@ int main(int argc, char *argv[])
|
|||
#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");
|
||||
|
@ -131,7 +152,7 @@ int main(int argc, char *argv[])
|
|||
#if QT_VERSION < 0x050000
|
||||
const QString dataDir = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
|
||||
#else
|
||||
const QString dataDir = QStandardPaths::standardLocations(QStandardPaths::DataLocation)).toString();
|
||||
const QString dataDir = QStandardPaths::standardLocations(QStandardPaths::DataLocation).first();
|
||||
#endif
|
||||
if (!db->getLoadSuccess())
|
||||
if (db->loadCardDatabase(dataDir + "/cards.xml"))
|
||||
|
|
|
@ -13,7 +13,11 @@ 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));
|
||||
|
|
|
@ -774,7 +774,13 @@ void Player::actViewLibrary()
|
|||
void Player::actViewTopCards()
|
||||
{
|
||||
bool ok;
|
||||
int number = QInputDialog::getInteger(0, tr("View top cards of library"), tr("Number of cards:"), defaultNumberTopCards, 1, 2000000000, 1, &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);
|
||||
if (ok) {
|
||||
defaultNumberTopCards = number;
|
||||
static_cast<GameScene *>(scene())->toggleZoneView(this, "deck", number);
|
||||
|
@ -829,7 +835,13 @@ void Player::actMulligan()
|
|||
|
||||
void Player::actDrawCards()
|
||||
{
|
||||
int number = QInputDialog::getInteger(0, tr("Draw cards"), tr("Number:"));
|
||||
int number =
|
||||
#if QT_VERSION < 0x050000
|
||||
QInputDialog::getInteger(
|
||||
#else
|
||||
QInputDialog::getInt(
|
||||
#endif
|
||||
0, tr("Draw cards"), tr("Number:"));
|
||||
if (number) {
|
||||
Command_DrawCards cmd;
|
||||
cmd.set_number(number);
|
||||
|
@ -844,8 +856,14 @@ void Player::actUndoDraw()
|
|||
|
||||
void Player::actMoveTopCardsToGrave()
|
||||
{
|
||||
int number = QInputDialog::getInteger(0, tr("Move top cards to grave"), tr("Number:"));
|
||||
if (!number)
|
||||
int number =
|
||||
#if QT_VERSION < 0x050000
|
||||
QInputDialog::getInteger(
|
||||
#else
|
||||
QInputDialog::getInt(
|
||||
#endif
|
||||
0, tr("Move top cards to grave"), tr("Number:"));
|
||||
if (!number)
|
||||
return;
|
||||
|
||||
const int maxCards = zones.value("deck")->getCards().size();
|
||||
|
@ -867,8 +885,14 @@ void Player::actMoveTopCardsToGrave()
|
|||
|
||||
void Player::actMoveTopCardsToExile()
|
||||
{
|
||||
int number = QInputDialog::getInteger(0, tr("Move top cards to exile"), tr("Number:"));
|
||||
if (!number)
|
||||
int number =
|
||||
#if QT_VERSION < 0x050000
|
||||
QInputDialog::getInteger(
|
||||
#else
|
||||
QInputDialog::getInt(
|
||||
#endif
|
||||
0, tr("Move top cards to exile"), tr("Number:"));
|
||||
if (!number)
|
||||
return;
|
||||
|
||||
const int maxCards = zones.value("deck")->getCards().size();
|
||||
|
@ -914,7 +938,13 @@ void Player::actUntapAll()
|
|||
void Player::actRollDie()
|
||||
{
|
||||
bool ok;
|
||||
int sides = QInputDialog::getInteger(0, tr("Roll die"), tr("Number of sides:"), 20, 2, 1000, 1, &ok);
|
||||
int sides =
|
||||
#if QT_VERSION < 0x050000
|
||||
QInputDialog::getInteger(
|
||||
#else
|
||||
QInputDialog::getInt(
|
||||
#endif
|
||||
0, tr("Roll die"), tr("Number of sides:"), 20, 2, 1000, 1, &ok);
|
||||
if (ok) {
|
||||
Command_RollDie cmd;
|
||||
cmd.set_sides(sides);
|
||||
|
@ -2022,7 +2052,13 @@ void Player::actCardCounterTrigger()
|
|||
case 11: {
|
||||
bool ok;
|
||||
dialogSemaphore = true;
|
||||
int number = QInputDialog::getInteger(0, tr("Set counters"), tr("Number:"), 0, 0, MAX_COUNTERS_ON_CARD, 1, &ok);
|
||||
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);
|
||||
dialogSemaphore = false;
|
||||
if (clearCardsToDelete())
|
||||
return;
|
||||
|
|
|
@ -72,7 +72,11 @@ PlayerListWidget::PlayerListWidget(TabSupervisor *_tabSupervisor, AbstractClient
|
|||
setColumnCount(6);
|
||||
setHeaderHidden(true);
|
||||
setRootIsDecorated(false);
|
||||
#if QT_VERSION < 0x050000
|
||||
header()->setResizeMode(QHeaderView::ResizeToContents);
|
||||
#else
|
||||
header()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
#endif
|
||||
retranslateUi();
|
||||
}
|
||||
|
||||
|
|
|
@ -258,8 +258,17 @@ void RemoteDeckList_TreeModel::deckListFinished(const Response &r)
|
|||
{
|
||||
const Response_DeckList &resp = r.GetExtension(Response_DeckList::ext);
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
beginResetModel();
|
||||
#endif
|
||||
|
||||
root->clearTree();
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
reset();
|
||||
#else
|
||||
endResetModel();
|
||||
#endif
|
||||
|
||||
ServerInfo_DeckStorage_TreeItem tempRoot;
|
||||
tempRoot.set_id(0);
|
||||
|
@ -280,7 +289,11 @@ 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,7 +278,11 @@ 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);
|
||||
|
|
|
@ -33,8 +33,13 @@ void SoundEngine::soundEnabledChanged()
|
|||
if (settingsCache->getSoundEnabled()) {
|
||||
qDebug("SoundEngine: enabling sound");
|
||||
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);
|
||||
|
|
|
@ -134,7 +134,11 @@ TabDeckEditor::TabDeckEditor(TabSupervisor *_tabSupervisor, QWidget *parent)
|
|||
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(&deckViewKeySignals, SIGNAL(onEnter()), this, SLOT(actIncrement()));
|
||||
|
|
|
@ -38,7 +38,11 @@ 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;
|
||||
|
|
|
@ -36,7 +36,11 @@ 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;
|
||||
|
|
|
@ -28,11 +28,17 @@ RoomSelector::RoomSelector(AbstractClient *_client, QWidget *parent)
|
|||
roomList->setRootIsDecorated(false);
|
||||
roomList->setColumnCount(4);
|
||||
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;
|
||||
|
|
|
@ -28,7 +28,11 @@ TableZone::TableZone(Player *_p, QGraphicsItem *parent)
|
|||
currentMinimumWidth = minWidth;
|
||||
|
||||
setCacheMode(DeviceCoordinateCache);
|
||||
#if QT_VERSION < 0x050000
|
||||
setAcceptsHoverEvents(true);
|
||||
#else
|
||||
setAcceptHoverEvents(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
void TableZone::updateBgPixmap()
|
||||
|
|
|
@ -216,7 +216,11 @@ 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));
|
||||
|
|
Loading…
Reference in a new issue