mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-20 04:14:27 -04:00
Code maintenance for Qt 5:
- Fixed some missing headers - Fixed some deprecated functions git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6845 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
30103ef5f2
commit
3e15a7bb86
15 changed files with 136 additions and 147 deletions
|
@ -47,9 +47,6 @@
|
||||||
|
|
||||||
class QModelIndex;
|
class QModelIndex;
|
||||||
class QPainter;
|
class QPainter;
|
||||||
class QStyleOptionProgressBarV2;
|
|
||||||
class QProgressBar;
|
|
||||||
class QApplication;
|
|
||||||
|
|
||||||
|
|
||||||
class DLListDelegate: public QAbstractItemDelegate {
|
class DLListDelegate: public QAbstractItemDelegate {
|
||||||
|
|
|
@ -41,9 +41,6 @@
|
||||||
|
|
||||||
class QModelIndex;
|
class QModelIndex;
|
||||||
class QPainter;
|
class QPainter;
|
||||||
class QStyleOptionProgressBarV2;
|
|
||||||
class QProgressBar;
|
|
||||||
class QApplication;
|
|
||||||
|
|
||||||
|
|
||||||
class ULListDelegate: public QAbstractItemDelegate {
|
class ULListDelegate: public QAbstractItemDelegate {
|
||||||
|
|
|
@ -17,89 +17,88 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
* Boston, MA 02110-1301, USA.
|
* Boston, MA 02110-1301, USA.
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
|
|
||||||
#include "LogoBar.h"
|
#include "LogoBar.h"
|
||||||
|
|
||||||
#include <util/RetroStyleLabel.h>
|
#include <util/RetroStyleLabel.h>
|
||||||
#include <util/MouseEventFilter.h>
|
#include <util/MouseEventFilter.h>
|
||||||
|
|
||||||
|
#include <QGridLayout>
|
||||||
#include <QtGui>
|
|
||||||
|
LogoBar::LogoBar(QWidget * parent)
|
||||||
LogoBar::LogoBar(QWidget * parent)
|
: QFrame(parent) {
|
||||||
: QFrame(parent) {
|
|
||||||
|
init();
|
||||||
init();
|
}
|
||||||
}
|
|
||||||
|
LogoBar::~LogoBar() {
|
||||||
LogoBar::~LogoBar() {
|
}
|
||||||
}
|
|
||||||
|
void LogoBar::init() {
|
||||||
void LogoBar::init() {
|
setFrameShape(QFrame::NoFrame);
|
||||||
setFrameShape(QFrame::NoFrame);
|
|
||||||
|
|
||||||
|
|
||||||
|
//LogoButton
|
||||||
//LogoButton
|
_logoButton = new RetroStyleLabel(this);
|
||||||
_logoButton = new RetroStyleLabel(this);
|
_logoButton->setPixmaps(
|
||||||
_logoButton->setPixmaps(
|
QPixmap(":/images/logobar/rslogo2.png"), //Start
|
||||||
QPixmap(":/images/logobar/rslogo2.png"), //Start
|
QPixmap(), //End
|
||||||
QPixmap(), //End
|
QPixmap(), //Fill
|
||||||
QPixmap(), //Fill
|
|
||||||
|
QPixmap(":/images/logobar/rslogo2.png"), //Start
|
||||||
QPixmap(":/images/logobar/rslogo2.png"), //Start
|
QPixmap(), //End
|
||||||
QPixmap(), //End
|
QPixmap() //Fill
|
||||||
QPixmap() //Fill
|
);
|
||||||
);
|
_logoButton->setMaximumSize(QSize(110, 65));
|
||||||
_logoButton->setMaximumSize(QSize(110, 65));
|
_logoButton->setMinimumSize(QSize(110, 65));
|
||||||
_logoButton->setMinimumSize(QSize(110, 65));
|
connect(_logoButton, SIGNAL(clicked()), SLOT(logoButtonClickedSlot()));
|
||||||
connect(_logoButton, SIGNAL(clicked()), SLOT(logoButtonClickedSlot()));
|
|
||||||
|
//FillLabel1
|
||||||
//FillLabel1
|
RetroStyleLabel * FillLabel1 = new RetroStyleLabel(this);
|
||||||
RetroStyleLabel * FillLabel1 = new RetroStyleLabel(this);
|
FillLabel1->setPixmaps(
|
||||||
FillLabel1->setPixmaps(
|
QPixmap(), //Start
|
||||||
QPixmap(), //Start
|
QPixmap(), //End
|
||||||
QPixmap(), //End
|
QPixmap(":/images/logobar/logo_bar_fill.png"), //Fill
|
||||||
QPixmap(":/images/logobar/logo_bar_fill.png"), //Fill
|
|
||||||
|
QPixmap(), //Start
|
||||||
QPixmap(), //Start
|
QPixmap(), //End
|
||||||
QPixmap(), //End
|
QPixmap(":/images/logobar/logo_bar_fill.png") //Fill
|
||||||
QPixmap(":/images/logobar/logo_bar_fill.png") //Fill
|
);
|
||||||
);
|
|
||||||
|
//FillLabel2
|
||||||
//FillLabel2
|
RetroStyleLabel * FillLabel2 = new RetroStyleLabel(this);
|
||||||
RetroStyleLabel * FillLabel2 = new RetroStyleLabel(this);
|
FillLabel2->setPixmaps(
|
||||||
FillLabel2->setPixmaps(
|
QPixmap(), //Start
|
||||||
QPixmap(), //Start
|
QPixmap(), //End
|
||||||
QPixmap(), //End
|
QPixmap(":/images/logobar/logo_bar_fill.png"), //Fill
|
||||||
QPixmap(":/images/logobar/logo_bar_fill.png"), //Fill
|
|
||||||
|
QPixmap(), //Start
|
||||||
QPixmap(), //Start
|
QPixmap(), //End
|
||||||
QPixmap(), //End
|
QPixmap(":/images/logobar/logo_bar_fill.png") //Fill
|
||||||
QPixmap(":/images/logobar/logo_bar_fill.png") //Fill
|
);
|
||||||
);
|
|
||||||
|
QGridLayout * layout = new QGridLayout(this);
|
||||||
QGridLayout * layout = new QGridLayout(this);
|
layout->setMargin(0);
|
||||||
layout->setMargin(0);
|
layout->setSpacing(0);
|
||||||
layout->setSpacing(0);
|
|
||||||
|
layout->addWidget(FillLabel1, 0, 0);
|
||||||
layout->addWidget(FillLabel1, 0, 0);
|
layout->addWidget(_logoButton, 0, 1);
|
||||||
layout->addWidget(_logoButton, 0, 1);
|
layout->addWidget(FillLabel2, 0, 2);
|
||||||
layout->addWidget(FillLabel2, 0, 2);
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
|
||||||
|
void LogoBar::setEnabledLogoButton(bool enable) {
|
||||||
void LogoBar::setEnabledLogoButton(bool enable) {
|
_logoButton->setEnabled(enable);
|
||||||
_logoButton->setEnabled(enable);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
void LogoBar::logoButtonClickedSlot() {
|
||||||
void LogoBar::logoButtonClickedSlot() {
|
logoButtonClicked();
|
||||||
logoButtonClicked();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,17 +28,10 @@
|
||||||
#define FNAME 0
|
#define FNAME 0
|
||||||
#define FSIZE 1
|
#define FSIZE 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define MAX_CHAR_TMP 128
|
#define MAX_CHAR_TMP 128
|
||||||
|
|
||||||
class QModelIndex;
|
class QModelIndex;
|
||||||
class QPainter;
|
class QPainter;
|
||||||
class QStyleOptionProgressBarV2;
|
|
||||||
class QProgressBar;
|
|
||||||
class QApplication;
|
|
||||||
|
|
||||||
|
|
||||||
class SFListDelegate: public QAbstractItemDelegate {
|
class SFListDelegate: public QAbstractItemDelegate {
|
||||||
|
|
||||||
|
@ -57,4 +50,3 @@ class SFListDelegate: public QAbstractItemDelegate {
|
||||||
signals:
|
signals:
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -361,28 +361,28 @@ QString ExprParamElement::toString()
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
if (searchType == DateSearch) {
|
if (searchType == DateSearch) {
|
||||||
QDateEdit * dateEdit = qFindChild<QDateEdit *> (internalframe, "param1");
|
QDateEdit * dateEdit = internalframe->findChild<QDateEdit *> ("param1");
|
||||||
str = dateEdit->text();
|
str = dateEdit->text();
|
||||||
if (inRangedConfig)
|
if (inRangedConfig)
|
||||||
{
|
{
|
||||||
str += QString(" ") + tr("to") + QString(" ");
|
str += QString(" ") + tr("to") + QString(" ");
|
||||||
dateEdit = qFindChild<QDateEdit *> (internalframe, "param2");
|
dateEdit = internalframe->findChild<QDateEdit *> ("param2");
|
||||||
str += dateEdit->text();
|
str += dateEdit->text();
|
||||||
}
|
}
|
||||||
} else if (searchType == SizeSearch)
|
} else if (searchType == SizeSearch)
|
||||||
{
|
{
|
||||||
QLineEdit * lineEditSize = qFindChild<QLineEdit*>(internalframe, "param1");
|
QLineEdit * lineEditSize = internalframe->findChild<QLineEdit*>("param1");
|
||||||
str = ("" == lineEditSize->text()) ? "0"
|
str = ("" == lineEditSize->text()) ? "0"
|
||||||
: lineEditSize->text();
|
: lineEditSize->text();
|
||||||
QComboBox * cb = qFindChild<QComboBox*> (internalframe, "unitsCb1");
|
QComboBox * cb = internalframe->findChild<QComboBox*> ("unitsCb1");
|
||||||
str += QString(" ") + cb->itemText(cb->currentIndex());
|
str += QString(" ") + cb->itemText(cb->currentIndex());
|
||||||
if (inRangedConfig)
|
if (inRangedConfig)
|
||||||
{
|
{
|
||||||
str += QString(" ") + tr("to") + QString(" ");
|
str += QString(" ") + tr("to") + QString(" ");
|
||||||
lineEditSize = qFindChild<QLineEdit*>(internalframe, "param2");
|
lineEditSize = internalframe->findChild<QLineEdit*>("param2");
|
||||||
str += ("" == lineEditSize->text()) ? "0"
|
str += ("" == lineEditSize->text()) ? "0"
|
||||||
: lineEditSize->text();
|
: lineEditSize->text();
|
||||||
cb = qFindChild<QComboBox*> (internalframe, "unitsCb2");
|
cb = internalframe->findChild<QComboBox*> ("unitsCb2");
|
||||||
str += QString(" ") + cb->itemText(cb->currentIndex());
|
str += QString(" ") + cb->itemText(cb->currentIndex());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -401,7 +401,7 @@ void ExprParamElement::adjustForSearchType(ExprSearchType type)
|
||||||
hexValidator = new QRegExpValidator(hexRegExp, this);
|
hexValidator = new QRegExpValidator(hexRegExp, this);
|
||||||
|
|
||||||
// remove all elements
|
// remove all elements
|
||||||
QList<QWidget*> children = qFindChildren<QWidget*>(internalframe);
|
QList<QWidget*> children = internalframe->findChildren<QWidget*>();
|
||||||
QWidget* child;
|
QWidget* child;
|
||||||
QLayout * lay_out = internalframe->layout();
|
QLayout * lay_out = internalframe->layout();
|
||||||
while (!children.isEmpty())
|
while (!children.isEmpty())
|
||||||
|
@ -555,7 +555,7 @@ void ExprParamElement::setRangedSearch(bool ranged)
|
||||||
bool ExprParamElement::ignoreCase()
|
bool ExprParamElement::ignoreCase()
|
||||||
{
|
{
|
||||||
return (isStringSearchExpression()
|
return (isStringSearchExpression()
|
||||||
&& (qFindChild<QCheckBox*>(internalframe, "ignoreCaseCB"))
|
&& (internalframe->findChild<QCheckBox*>("ignoreCaseCB"))
|
||||||
->checkState()==Qt::Checked);
|
->checkState()==Qt::Checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -563,7 +563,7 @@ QString ExprParamElement::getStrSearchValue()
|
||||||
{
|
{
|
||||||
if (!isStringSearchExpression()) return "";
|
if (!isStringSearchExpression()) return "";
|
||||||
|
|
||||||
QLineEdit * lineEdit = qFindChild<QLineEdit*>(internalframe, "param1");
|
QLineEdit * lineEdit = internalframe->findChild<QLineEdit*>("param1");
|
||||||
return lineEdit->displayText();
|
return lineEdit->displayText();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -579,19 +579,19 @@ uint64_t ExprParamElement::getIntValueFromField(QString fieldName, bool isToFiel
|
||||||
{
|
{
|
||||||
case DateSearch:
|
case DateSearch:
|
||||||
{
|
{
|
||||||
QDateEdit * dateEdit = qFindChild<QDateEdit *> (internalframe, (fieldName + suffix));
|
QDateEdit * dateEdit = internalframe->findChild<QDateEdit *> (fieldName + suffix);
|
||||||
QDateTime * time = new QDateTime(dateEdit->date());
|
QDateTime * time = new QDateTime(dateEdit->date());
|
||||||
val = (uint64_t)time->toTime_t();
|
val = (uint64_t)time->toTime_t();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SizeSearch:
|
case SizeSearch:
|
||||||
{
|
{
|
||||||
QLineEdit * lineEditSize = qFindChild<QLineEdit*>(internalframe, (fieldName + suffix));
|
QLineEdit * lineEditSize = internalframe->findChild<QLineEdit*>(fieldName + suffix);
|
||||||
bool ok2 = false;
|
bool ok2 = false;
|
||||||
val = (lineEditSize->displayText()).toULongLong(&ok2);
|
val = (lineEditSize->displayText()).toULongLong(&ok2);
|
||||||
if (ok2)
|
if (ok2)
|
||||||
{
|
{
|
||||||
QComboBox * cb = qFindChild<QComboBox*> (internalframe, (QString("unitsCb") + suffix));
|
QComboBox * cb = internalframe->findChild<QComboBox*>((QString("unitsCb") + suffix));
|
||||||
QVariant data = cb->itemData(cb->currentIndex());
|
QVariant data = cb->itemData(cb->currentIndex());
|
||||||
val *= data.toULongLong();
|
val *= data.toULongLong();
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,8 +43,6 @@ CreateChannel::CreateChannel()
|
||||||
ui.headerFrame->setHeaderImage(QPixmap(":/images/add_channel64.png"));
|
ui.headerFrame->setHeaderImage(QPixmap(":/images/add_channel64.png"));
|
||||||
ui.headerFrame->setHeaderText(tr("New Channel"));
|
ui.headerFrame->setHeaderText(tr("New Channel"));
|
||||||
|
|
||||||
picture = NULL;
|
|
||||||
|
|
||||||
// connect up the buttons.
|
// connect up the buttons.
|
||||||
connect( ui.buttonBox, SIGNAL(accepted()), this, SLOT(createChannel()));
|
connect( ui.buttonBox, SIGNAL(accepted()), this, SLOT(createChannel()));
|
||||||
connect( ui.buttonBox, SIGNAL(rejected()), this, SLOT(close()));
|
connect( ui.buttonBox, SIGNAL(rejected()), this, SLOT(close()));
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QMimeData>
|
||||||
|
|
||||||
#include <gui/RetroShareLink.h>
|
#include <gui/RetroShareLink.h>
|
||||||
#include "CreateChannelMsg.h"
|
#include "CreateChannelMsg.h"
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include <QDropEvent>
|
#include <QDropEvent>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
#include <QMimeData>
|
||||||
|
|
||||||
#include "DropLineEdit.h"
|
#include "DropLineEdit.h"
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include <QDropEvent>
|
#include <QDropEvent>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
#include <QMimeData>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
|
|
@ -409,7 +409,7 @@ void GraphWidget::drawBackground(QPainter *painter, const QRectF &rect)
|
||||||
QLinearGradient gradient(sceneRect.topLeft(), sceneRect.bottomRight());
|
QLinearGradient gradient(sceneRect.topLeft(), sceneRect.bottomRight());
|
||||||
gradient.setColorAt(0, Qt::white);
|
gradient.setColorAt(0, Qt::white);
|
||||||
gradient.setColorAt(1, Qt::lightGray);
|
gradient.setColorAt(1, Qt::lightGray);
|
||||||
painter->fillRect(rect.intersect(sceneRect), gradient);
|
painter->fillRect(rect.intersected(sceneRect), gradient);
|
||||||
painter->setBrush(Qt::NoBrush);
|
painter->setBrush(Qt::NoBrush);
|
||||||
painter->drawRect(sceneRect);
|
painter->drawRect(sceneRect);
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,8 @@ IMHistoryItemDelegate::IMHistoryItemDelegate(QWidget *parent)
|
||||||
|
|
||||||
void IMHistoryItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
void IMHistoryItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
if (qVariantCanConvert<IMHistoryItemPainter>(index.data())) {
|
if (index.data().canConvert<IMHistoryItemPainter>()) {
|
||||||
IMHistoryItemPainter itemPainter = qVariantValue<IMHistoryItemPainter>(index.data());
|
IMHistoryItemPainter itemPainter = index.data().value<IMHistoryItemPainter>();
|
||||||
itemPainter.paint(painter, option, IMHistoryItemPainter::ReadOnly);
|
itemPainter.paint(painter, option, IMHistoryItemPainter::ReadOnly);
|
||||||
} else {
|
} else {
|
||||||
QItemDelegate::paint(painter, option, index);
|
QItemDelegate::paint(painter, option, index);
|
||||||
|
@ -42,8 +42,8 @@ void IMHistoryItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem
|
||||||
|
|
||||||
QSize IMHistoryItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
|
QSize IMHistoryItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
if (qVariantCanConvert<IMHistoryItemPainter>(index.data())) {
|
if (index.data().canConvert<IMHistoryItemPainter>()) {
|
||||||
IMHistoryItemPainter painter = qVariantValue<IMHistoryItemPainter>(index.data());
|
IMHistoryItemPainter painter = index.data().value<IMHistoryItemPainter>();
|
||||||
return painter.sizeHint();
|
return painter.sizeHint();
|
||||||
} else {
|
} else {
|
||||||
return QItemDelegate::sizeHint(option, index);
|
return QItemDelegate::sizeHint(option, index);
|
||||||
|
|
|
@ -281,7 +281,7 @@ ChatPage::save(QString &/*errmsg*/)
|
||||||
ChatStyleInfo info;
|
ChatStyleInfo info;
|
||||||
QListWidgetItem *item = ui.publicList->currentItem();
|
QListWidgetItem *item = ui.publicList->currentItem();
|
||||||
if (item) {
|
if (item) {
|
||||||
info = qVariantValue<ChatStyleInfo>(item->data(Qt::UserRole));
|
info = item->data(Qt::UserRole).value<ChatStyleInfo>();
|
||||||
if (publicStylePath != info.stylePath || publicStyleVariant != ui.publicComboBoxVariant->currentText()) {
|
if (publicStylePath != info.stylePath || publicStyleVariant != ui.publicComboBoxVariant->currentText()) {
|
||||||
Settings->setPublicChatStyle(info.stylePath, ui.publicComboBoxVariant->currentText());
|
Settings->setPublicChatStyle(info.stylePath, ui.publicComboBoxVariant->currentText());
|
||||||
NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_PUBLIC);
|
NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_PUBLIC);
|
||||||
|
@ -290,7 +290,7 @@ ChatPage::save(QString &/*errmsg*/)
|
||||||
|
|
||||||
item = ui.privateList->currentItem();
|
item = ui.privateList->currentItem();
|
||||||
if (item) {
|
if (item) {
|
||||||
info = qVariantValue<ChatStyleInfo>(item->data(Qt::UserRole));
|
info = item->data(Qt::UserRole).value<ChatStyleInfo>();
|
||||||
if (privateStylePath != info.stylePath || privateStyleVariant != ui.privateComboBoxVariant->currentText()) {
|
if (privateStylePath != info.stylePath || privateStyleVariant != ui.privateComboBoxVariant->currentText()) {
|
||||||
Settings->setPrivateChatStyle(info.stylePath, ui.privateComboBoxVariant->currentText());
|
Settings->setPrivateChatStyle(info.stylePath, ui.privateComboBoxVariant->currentText());
|
||||||
NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_PRIVATE);
|
NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_PRIVATE);
|
||||||
|
@ -299,7 +299,7 @@ ChatPage::save(QString &/*errmsg*/)
|
||||||
|
|
||||||
item = ui.historyList->currentItem();
|
item = ui.historyList->currentItem();
|
||||||
if (item) {
|
if (item) {
|
||||||
info = qVariantValue<ChatStyleInfo>(item->data(Qt::UserRole));
|
info = item->data(Qt::UserRole).value<ChatStyleInfo>();
|
||||||
if (historyStylePath != info.stylePath || historyStyleVariant != ui.historyComboBoxVariant->currentText()) {
|
if (historyStylePath != info.stylePath || historyStyleVariant != ui.historyComboBoxVariant->currentText()) {
|
||||||
Settings->setHistoryChatStyle(info.stylePath, ui.historyComboBoxVariant->currentText());
|
Settings->setHistoryChatStyle(info.stylePath, ui.historyComboBoxVariant->currentText());
|
||||||
NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_HISTORY);
|
NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_HISTORY);
|
||||||
|
@ -476,7 +476,7 @@ void ChatPage::fillPreview(QListWidget *listWidget, QComboBox *comboBox, QTextBr
|
||||||
{
|
{
|
||||||
QListWidgetItem *item = listWidget->currentItem();
|
QListWidgetItem *item = listWidget->currentItem();
|
||||||
if (item) {
|
if (item) {
|
||||||
ChatStyleInfo info = qVariantValue<ChatStyleInfo>(item->data(Qt::UserRole));
|
ChatStyleInfo info = item->data(Qt::UserRole).value<ChatStyleInfo>();
|
||||||
|
|
||||||
setPreviewMessages(info.stylePath, comboBox->currentText(), textBrowser);
|
setPreviewMessages(info.stylePath, comboBox->currentText(), textBrowser);
|
||||||
} else {
|
} else {
|
||||||
|
@ -488,7 +488,7 @@ void ChatPage::on_publicList_currentRowChanged(int currentRow)
|
||||||
{
|
{
|
||||||
if (currentRow != -1) {
|
if (currentRow != -1) {
|
||||||
QListWidgetItem *item = ui.publicList->item(currentRow);
|
QListWidgetItem *item = ui.publicList->item(currentRow);
|
||||||
ChatStyleInfo info = qVariantValue<ChatStyleInfo>(item->data(Qt::UserRole));
|
ChatStyleInfo info = item->data(Qt::UserRole).value<ChatStyleInfo>();
|
||||||
|
|
||||||
QString author = info.authorName;
|
QString author = info.authorName;
|
||||||
if (info.authorEmail.isEmpty() == false) {
|
if (info.authorEmail.isEmpty() == false) {
|
||||||
|
@ -524,7 +524,7 @@ void ChatPage::on_privateList_currentRowChanged(int currentRow)
|
||||||
{
|
{
|
||||||
if (currentRow != -1) {
|
if (currentRow != -1) {
|
||||||
QListWidgetItem *item = ui.privateList->item(currentRow);
|
QListWidgetItem *item = ui.privateList->item(currentRow);
|
||||||
ChatStyleInfo info = qVariantValue<ChatStyleInfo>(item->data(Qt::UserRole));
|
ChatStyleInfo info = item->data(Qt::UserRole).value<ChatStyleInfo>();
|
||||||
|
|
||||||
QString author = info.authorName;
|
QString author = info.authorName;
|
||||||
if (info.authorEmail.isEmpty() == false) {
|
if (info.authorEmail.isEmpty() == false) {
|
||||||
|
@ -560,7 +560,7 @@ void ChatPage::on_historyList_currentRowChanged(int currentRow)
|
||||||
{
|
{
|
||||||
if (currentRow != -1) {
|
if (currentRow != -1) {
|
||||||
QListWidgetItem *item = ui.historyList->item(currentRow);
|
QListWidgetItem *item = ui.historyList->item(currentRow);
|
||||||
ChatStyleInfo info = qVariantValue<ChatStyleInfo>(item->data(Qt::UserRole));
|
ChatStyleInfo info = item->data(Qt::UserRole).value<ChatStyleInfo>();
|
||||||
|
|
||||||
QString author = info.authorName;
|
QString author = info.authorName;
|
||||||
if (info.authorEmail.isEmpty() == false) {
|
if (info.authorEmail.isEmpty() == false) {
|
||||||
|
|
|
@ -764,7 +764,7 @@ bool RsHtml::makeEmbeddedImage(const QImage &originalImage, QString &embeddedIma
|
||||||
|
|
||||||
// ask user
|
// ask user
|
||||||
QMessageBox msgBox;
|
QMessageBox msgBox;
|
||||||
msgBox.setText(QString(QApplication::translate("RsHtml", "Image is oversized for transmission.\nReducing image to %1x%2 pixels?", 0, QApplication::UnicodeUTF8)).arg(newSize.width()).arg(newSize.height()));
|
msgBox.setText(QString(QApplication::translate("RsHtml", "Image is oversized for transmission.\nReducing image to %1x%2 pixels?")).arg(newSize.width()).arg(newSize.height()));
|
||||||
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
|
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
|
||||||
msgBox.setDefaultButton(QMessageBox::Ok);
|
msgBox.setDefaultButton(QMessageBox::Ok);
|
||||||
if (msgBox.exec() != QMessageBox::Ok) {
|
if (msgBox.exec() != QMessageBox::Ok) {
|
||||||
|
|
|
@ -21,7 +21,8 @@
|
||||||
|
|
||||||
#include <util/RetroStyleLabel.h>
|
#include <util/RetroStyleLabel.h>
|
||||||
|
|
||||||
#include <QtGui>
|
#include <QPainter>
|
||||||
|
#include <QMouseEvent>
|
||||||
|
|
||||||
RetroStyleLabel::RetroStyleLabel(QWidget * parent, Mode mode, Qt::AlignmentFlag hAlign)
|
RetroStyleLabel::RetroStyleLabel(QWidget * parent, Mode mode, Qt::AlignmentFlag hAlign)
|
||||||
: QLabel(parent), _mode(mode) {
|
: QLabel(parent), _mode(mode) {
|
||||||
|
|
|
@ -17,22 +17,24 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
* Boston, MA 02110-1301, USA.
|
* Boston, MA 02110-1301, USA.
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
|
|
||||||
#include <util/Widget.h>
|
#include <util/Widget.h>
|
||||||
|
|
||||||
#include <QtGui>
|
#include <QDialog>
|
||||||
|
#include <QWidget>
|
||||||
QGridLayout * Widget::createLayout(QWidget * parent) {
|
#include <QGridLayout>
|
||||||
QGridLayout * layout = new QGridLayout(parent);
|
|
||||||
layout->setSpacing(0);
|
QGridLayout * Widget::createLayout(QWidget * parent) {
|
||||||
layout->setMargin(0);
|
QGridLayout * layout = new QGridLayout(parent);
|
||||||
return layout;
|
layout->setSpacing(0);
|
||||||
}
|
layout->setMargin(0);
|
||||||
|
return layout;
|
||||||
QDialog * Widget::transformToWindow(QWidget * widget) {
|
}
|
||||||
QDialog * dialog = new QDialog(widget->parentWidget());
|
|
||||||
widget->setParent(NULL);
|
QDialog * Widget::transformToWindow(QWidget * widget) {
|
||||||
createLayout(dialog)->addWidget(widget);
|
QDialog * dialog = new QDialog(widget->parentWidget());
|
||||||
return dialog;
|
widget->setParent(NULL);
|
||||||
}
|
createLayout(dialog)->addWidget(widget);
|
||||||
|
return dialog;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue