diff --git a/retroshare-gui/src/gui/FileTransfer/DLListDelegate.h b/retroshare-gui/src/gui/FileTransfer/DLListDelegate.h index cdaa7629f..2f50c6876 100644 --- a/retroshare-gui/src/gui/FileTransfer/DLListDelegate.h +++ b/retroshare-gui/src/gui/FileTransfer/DLListDelegate.h @@ -47,9 +47,6 @@ class QModelIndex; class QPainter; -class QStyleOptionProgressBarV2; -class QProgressBar; -class QApplication; class DLListDelegate: public QAbstractItemDelegate { diff --git a/retroshare-gui/src/gui/FileTransfer/ULListDelegate.h b/retroshare-gui/src/gui/FileTransfer/ULListDelegate.h index f6cf637a9..5c080f656 100644 --- a/retroshare-gui/src/gui/FileTransfer/ULListDelegate.h +++ b/retroshare-gui/src/gui/FileTransfer/ULListDelegate.h @@ -41,9 +41,6 @@ class QModelIndex; class QPainter; -class QStyleOptionProgressBarV2; -class QProgressBar; -class QApplication; class ULListDelegate: public QAbstractItemDelegate { diff --git a/retroshare-gui/src/gui/LogoBar.cpp b/retroshare-gui/src/gui/LogoBar.cpp index c8a082220..11799d1fc 100644 --- a/retroshare-gui/src/gui/LogoBar.cpp +++ b/retroshare-gui/src/gui/LogoBar.cpp @@ -17,89 +17,88 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. - ****************************************************************/ - -#include "LogoBar.h" - -#include -#include - - -#include - -LogoBar::LogoBar(QWidget * parent) - : QFrame(parent) { - - init(); -} - -LogoBar::~LogoBar() { -} - -void LogoBar::init() { - setFrameShape(QFrame::NoFrame); - - - - //LogoButton - _logoButton = new RetroStyleLabel(this); - _logoButton->setPixmaps( - QPixmap(":/images/logobar/rslogo2.png"), //Start - QPixmap(), //End - QPixmap(), //Fill - - QPixmap(":/images/logobar/rslogo2.png"), //Start - QPixmap(), //End - QPixmap() //Fill - ); - _logoButton->setMaximumSize(QSize(110, 65)); - _logoButton->setMinimumSize(QSize(110, 65)); - connect(_logoButton, SIGNAL(clicked()), SLOT(logoButtonClickedSlot())); - - //FillLabel1 - RetroStyleLabel * FillLabel1 = new RetroStyleLabel(this); - FillLabel1->setPixmaps( - QPixmap(), //Start - QPixmap(), //End - QPixmap(":/images/logobar/logo_bar_fill.png"), //Fill - - QPixmap(), //Start - QPixmap(), //End - QPixmap(":/images/logobar/logo_bar_fill.png") //Fill - ); - - //FillLabel2 - RetroStyleLabel * FillLabel2 = new RetroStyleLabel(this); - FillLabel2->setPixmaps( - QPixmap(), //Start - QPixmap(), //End - QPixmap(":/images/logobar/logo_bar_fill.png"), //Fill - - QPixmap(), //Start - QPixmap(), //End - QPixmap(":/images/logobar/logo_bar_fill.png") //Fill - ); - - QGridLayout * layout = new QGridLayout(this); - layout->setMargin(0); - layout->setSpacing(0); - - layout->addWidget(FillLabel1, 0, 0); - layout->addWidget(_logoButton, 0, 1); - layout->addWidget(FillLabel2, 0, 2); - - -} - -void LogoBar::setEnabledLogoButton(bool enable) { - _logoButton->setEnabled(enable); -} - - -void LogoBar::logoButtonClickedSlot() { - logoButtonClicked(); -} - - - - + ****************************************************************/ + +#include "LogoBar.h" + +#include +#include + +#include + +LogoBar::LogoBar(QWidget * parent) + : QFrame(parent) { + + init(); +} + +LogoBar::~LogoBar() { +} + +void LogoBar::init() { + setFrameShape(QFrame::NoFrame); + + + + //LogoButton + _logoButton = new RetroStyleLabel(this); + _logoButton->setPixmaps( + QPixmap(":/images/logobar/rslogo2.png"), //Start + QPixmap(), //End + QPixmap(), //Fill + + QPixmap(":/images/logobar/rslogo2.png"), //Start + QPixmap(), //End + QPixmap() //Fill + ); + _logoButton->setMaximumSize(QSize(110, 65)); + _logoButton->setMinimumSize(QSize(110, 65)); + connect(_logoButton, SIGNAL(clicked()), SLOT(logoButtonClickedSlot())); + + //FillLabel1 + RetroStyleLabel * FillLabel1 = new RetroStyleLabel(this); + FillLabel1->setPixmaps( + QPixmap(), //Start + QPixmap(), //End + QPixmap(":/images/logobar/logo_bar_fill.png"), //Fill + + QPixmap(), //Start + QPixmap(), //End + QPixmap(":/images/logobar/logo_bar_fill.png") //Fill + ); + + //FillLabel2 + RetroStyleLabel * FillLabel2 = new RetroStyleLabel(this); + FillLabel2->setPixmaps( + QPixmap(), //Start + QPixmap(), //End + QPixmap(":/images/logobar/logo_bar_fill.png"), //Fill + + QPixmap(), //Start + QPixmap(), //End + QPixmap(":/images/logobar/logo_bar_fill.png") //Fill + ); + + QGridLayout * layout = new QGridLayout(this); + layout->setMargin(0); + layout->setSpacing(0); + + layout->addWidget(FillLabel1, 0, 0); + layout->addWidget(_logoButton, 0, 1); + layout->addWidget(FillLabel2, 0, 2); + + +} + +void LogoBar::setEnabledLogoButton(bool enable) { + _logoButton->setEnabled(enable); +} + + +void LogoBar::logoButtonClickedSlot() { + logoButtonClicked(); +} + + + + diff --git a/retroshare-gui/src/gui/SFListDelegate.h b/retroshare-gui/src/gui/SFListDelegate.h index 26820a646..4115d93e5 100644 --- a/retroshare-gui/src/gui/SFListDelegate.h +++ b/retroshare-gui/src/gui/SFListDelegate.h @@ -28,17 +28,10 @@ #define FNAME 0 #define FSIZE 1 - - - #define MAX_CHAR_TMP 128 class QModelIndex; class QPainter; -class QStyleOptionProgressBarV2; -class QProgressBar; -class QApplication; - class SFListDelegate: public QAbstractItemDelegate { @@ -57,4 +50,3 @@ class SFListDelegate: public QAbstractItemDelegate { signals: }; #endif - diff --git a/retroshare-gui/src/gui/advsearch/guiexprelement.cpp b/retroshare-gui/src/gui/advsearch/guiexprelement.cpp index 98bcc9742..dfcef2df1 100644 --- a/retroshare-gui/src/gui/advsearch/guiexprelement.cpp +++ b/retroshare-gui/src/gui/advsearch/guiexprelement.cpp @@ -361,28 +361,28 @@ QString ExprParamElement::toString() } else { if (searchType == DateSearch) { - QDateEdit * dateEdit = qFindChild (internalframe, "param1"); + QDateEdit * dateEdit = internalframe->findChild ("param1"); str = dateEdit->text(); if (inRangedConfig) { str += QString(" ") + tr("to") + QString(" "); - dateEdit = qFindChild (internalframe, "param2"); + dateEdit = internalframe->findChild ("param2"); str += dateEdit->text(); } } else if (searchType == SizeSearch) { - QLineEdit * lineEditSize = qFindChild(internalframe, "param1"); + QLineEdit * lineEditSize = internalframe->findChild("param1"); str = ("" == lineEditSize->text()) ? "0" : lineEditSize->text(); - QComboBox * cb = qFindChild (internalframe, "unitsCb1"); + QComboBox * cb = internalframe->findChild ("unitsCb1"); str += QString(" ") + cb->itemText(cb->currentIndex()); if (inRangedConfig) { str += QString(" ") + tr("to") + QString(" "); - lineEditSize = qFindChild(internalframe, "param2"); + lineEditSize = internalframe->findChild("param2"); str += ("" == lineEditSize->text()) ? "0" : lineEditSize->text(); - cb = qFindChild (internalframe, "unitsCb2"); + cb = internalframe->findChild ("unitsCb2"); str += QString(" ") + cb->itemText(cb->currentIndex()); } } @@ -401,7 +401,7 @@ void ExprParamElement::adjustForSearchType(ExprSearchType type) hexValidator = new QRegExpValidator(hexRegExp, this); // remove all elements - QList children = qFindChildren(internalframe); + QList children = internalframe->findChildren(); QWidget* child; QLayout * lay_out = internalframe->layout(); while (!children.isEmpty()) @@ -555,7 +555,7 @@ void ExprParamElement::setRangedSearch(bool ranged) bool ExprParamElement::ignoreCase() { return (isStringSearchExpression() - && (qFindChild(internalframe, "ignoreCaseCB")) + && (internalframe->findChild("ignoreCaseCB")) ->checkState()==Qt::Checked); } @@ -563,7 +563,7 @@ QString ExprParamElement::getStrSearchValue() { if (!isStringSearchExpression()) return ""; - QLineEdit * lineEdit = qFindChild(internalframe, "param1"); + QLineEdit * lineEdit = internalframe->findChild("param1"); return lineEdit->displayText(); } @@ -579,19 +579,19 @@ uint64_t ExprParamElement::getIntValueFromField(QString fieldName, bool isToFiel { case DateSearch: { - QDateEdit * dateEdit = qFindChild (internalframe, (fieldName + suffix)); + QDateEdit * dateEdit = internalframe->findChild (fieldName + suffix); QDateTime * time = new QDateTime(dateEdit->date()); val = (uint64_t)time->toTime_t(); break; } case SizeSearch: { - QLineEdit * lineEditSize = qFindChild(internalframe, (fieldName + suffix)); + QLineEdit * lineEditSize = internalframe->findChild(fieldName + suffix); bool ok2 = false; val = (lineEditSize->displayText()).toULongLong(&ok2); if (ok2) { - QComboBox * cb = qFindChild (internalframe, (QString("unitsCb") + suffix)); + QComboBox * cb = internalframe->findChild((QString("unitsCb") + suffix)); QVariant data = cb->itemData(cb->currentIndex()); val *= data.toULongLong(); } diff --git a/retroshare-gui/src/gui/channels/CreateChannel.cpp b/retroshare-gui/src/gui/channels/CreateChannel.cpp index 4342204b0..530ea5c17 100644 --- a/retroshare-gui/src/gui/channels/CreateChannel.cpp +++ b/retroshare-gui/src/gui/channels/CreateChannel.cpp @@ -43,8 +43,6 @@ CreateChannel::CreateChannel() ui.headerFrame->setHeaderImage(QPixmap(":/images/add_channel64.png")); ui.headerFrame->setHeaderText(tr("New Channel")); - picture = NULL; - // connect up the buttons. connect( ui.buttonBox, SIGNAL(accepted()), this, SLOT(createChannel())); connect( ui.buttonBox, SIGNAL(rejected()), this, SLOT(close())); diff --git a/retroshare-gui/src/gui/channels/CreateChannelMsg.cpp b/retroshare-gui/src/gui/channels/CreateChannelMsg.cpp index a1caaecbc..aa632ac95 100644 --- a/retroshare-gui/src/gui/channels/CreateChannelMsg.cpp +++ b/retroshare-gui/src/gui/channels/CreateChannelMsg.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include "CreateChannelMsg.h" diff --git a/retroshare-gui/src/gui/common/DropLineEdit.cpp b/retroshare-gui/src/gui/common/DropLineEdit.cpp index 1ff16fd3c..d948377a2 100644 --- a/retroshare-gui/src/gui/common/DropLineEdit.cpp +++ b/retroshare-gui/src/gui/common/DropLineEdit.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include "DropLineEdit.h" diff --git a/retroshare-gui/src/gui/common/HashBox.cpp b/retroshare-gui/src/gui/common/HashBox.cpp index 8e4c39a8b..8214ee04c 100644 --- a/retroshare-gui/src/gui/common/HashBox.cpp +++ b/retroshare-gui/src/gui/common/HashBox.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include diff --git a/retroshare-gui/src/gui/elastic/graphwidget.cpp b/retroshare-gui/src/gui/elastic/graphwidget.cpp index 294fae1c7..eff0684ff 100644 --- a/retroshare-gui/src/gui/elastic/graphwidget.cpp +++ b/retroshare-gui/src/gui/elastic/graphwidget.cpp @@ -409,7 +409,7 @@ void GraphWidget::drawBackground(QPainter *painter, const QRectF &rect) QLinearGradient gradient(sceneRect.topLeft(), sceneRect.bottomRight()); gradient.setColorAt(0, Qt::white); gradient.setColorAt(1, Qt::lightGray); - painter->fillRect(rect.intersect(sceneRect), gradient); + painter->fillRect(rect.intersected(sceneRect), gradient); painter->setBrush(Qt::NoBrush); painter->drawRect(sceneRect); diff --git a/retroshare-gui/src/gui/im_history/IMHistoryItemDelegate.cpp b/retroshare-gui/src/gui/im_history/IMHistoryItemDelegate.cpp index b32da15cc..1150088e7 100644 --- a/retroshare-gui/src/gui/im_history/IMHistoryItemDelegate.cpp +++ b/retroshare-gui/src/gui/im_history/IMHistoryItemDelegate.cpp @@ -32,8 +32,8 @@ IMHistoryItemDelegate::IMHistoryItemDelegate(QWidget *parent) void IMHistoryItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { - if (qVariantCanConvert(index.data())) { - IMHistoryItemPainter itemPainter = qVariantValue(index.data()); + if (index.data().canConvert()) { + IMHistoryItemPainter itemPainter = index.data().value(); itemPainter.paint(painter, option, IMHistoryItemPainter::ReadOnly); } else { 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 { - if (qVariantCanConvert(index.data())) { - IMHistoryItemPainter painter = qVariantValue(index.data()); + if (index.data().canConvert()) { + IMHistoryItemPainter painter = index.data().value(); return painter.sizeHint(); } else { return QItemDelegate::sizeHint(option, index); diff --git a/retroshare-gui/src/gui/settings/ChatPage.cpp b/retroshare-gui/src/gui/settings/ChatPage.cpp index b14c24fca..b7c1dbdac 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.cpp +++ b/retroshare-gui/src/gui/settings/ChatPage.cpp @@ -281,7 +281,7 @@ ChatPage::save(QString &/*errmsg*/) ChatStyleInfo info; QListWidgetItem *item = ui.publicList->currentItem(); if (item) { - info = qVariantValue(item->data(Qt::UserRole)); + info = item->data(Qt::UserRole).value(); if (publicStylePath != info.stylePath || publicStyleVariant != ui.publicComboBoxVariant->currentText()) { Settings->setPublicChatStyle(info.stylePath, ui.publicComboBoxVariant->currentText()); NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_PUBLIC); @@ -290,7 +290,7 @@ ChatPage::save(QString &/*errmsg*/) item = ui.privateList->currentItem(); if (item) { - info = qVariantValue(item->data(Qt::UserRole)); + info = item->data(Qt::UserRole).value(); if (privateStylePath != info.stylePath || privateStyleVariant != ui.privateComboBoxVariant->currentText()) { Settings->setPrivateChatStyle(info.stylePath, ui.privateComboBoxVariant->currentText()); NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_PRIVATE); @@ -299,7 +299,7 @@ ChatPage::save(QString &/*errmsg*/) item = ui.historyList->currentItem(); if (item) { - info = qVariantValue(item->data(Qt::UserRole)); + info = item->data(Qt::UserRole).value(); if (historyStylePath != info.stylePath || historyStyleVariant != ui.historyComboBoxVariant->currentText()) { Settings->setHistoryChatStyle(info.stylePath, ui.historyComboBoxVariant->currentText()); NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_HISTORY); @@ -476,7 +476,7 @@ void ChatPage::fillPreview(QListWidget *listWidget, QComboBox *comboBox, QTextBr { QListWidgetItem *item = listWidget->currentItem(); if (item) { - ChatStyleInfo info = qVariantValue(item->data(Qt::UserRole)); + ChatStyleInfo info = item->data(Qt::UserRole).value(); setPreviewMessages(info.stylePath, comboBox->currentText(), textBrowser); } else { @@ -488,7 +488,7 @@ void ChatPage::on_publicList_currentRowChanged(int currentRow) { if (currentRow != -1) { QListWidgetItem *item = ui.publicList->item(currentRow); - ChatStyleInfo info = qVariantValue(item->data(Qt::UserRole)); + ChatStyleInfo info = item->data(Qt::UserRole).value(); QString author = info.authorName; if (info.authorEmail.isEmpty() == false) { @@ -524,7 +524,7 @@ void ChatPage::on_privateList_currentRowChanged(int currentRow) { if (currentRow != -1) { QListWidgetItem *item = ui.privateList->item(currentRow); - ChatStyleInfo info = qVariantValue(item->data(Qt::UserRole)); + ChatStyleInfo info = item->data(Qt::UserRole).value(); QString author = info.authorName; if (info.authorEmail.isEmpty() == false) { @@ -560,7 +560,7 @@ void ChatPage::on_historyList_currentRowChanged(int currentRow) { if (currentRow != -1) { QListWidgetItem *item = ui.historyList->item(currentRow); - ChatStyleInfo info = qVariantValue(item->data(Qt::UserRole)); + ChatStyleInfo info = item->data(Qt::UserRole).value(); QString author = info.authorName; if (info.authorEmail.isEmpty() == false) { diff --git a/retroshare-gui/src/util/HandleRichText.cpp b/retroshare-gui/src/util/HandleRichText.cpp index 6d6ac9c98..0ca124f07 100644 --- a/retroshare-gui/src/util/HandleRichText.cpp +++ b/retroshare-gui/src/util/HandleRichText.cpp @@ -764,7 +764,7 @@ bool RsHtml::makeEmbeddedImage(const QImage &originalImage, QString &embeddedIma // ask user 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.setDefaultButton(QMessageBox::Ok); if (msgBox.exec() != QMessageBox::Ok) { diff --git a/retroshare-gui/src/util/RetroStyleLabel.cpp b/retroshare-gui/src/util/RetroStyleLabel.cpp index aa3f3be4e..57f6f2a8a 100644 --- a/retroshare-gui/src/util/RetroStyleLabel.cpp +++ b/retroshare-gui/src/util/RetroStyleLabel.cpp @@ -21,7 +21,8 @@ #include -#include +#include +#include RetroStyleLabel::RetroStyleLabel(QWidget * parent, Mode mode, Qt::AlignmentFlag hAlign) : QLabel(parent), _mode(mode) { diff --git a/retroshare-gui/src/util/Widget.cpp b/retroshare-gui/src/util/Widget.cpp index 7a4eb42fe..e931874dc 100644 --- a/retroshare-gui/src/util/Widget.cpp +++ b/retroshare-gui/src/util/Widget.cpp @@ -17,22 +17,24 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. - ****************************************************************/ - -#include - -#include - -QGridLayout * Widget::createLayout(QWidget * parent) { - QGridLayout * layout = new QGridLayout(parent); - layout->setSpacing(0); - layout->setMargin(0); - return layout; -} - -QDialog * Widget::transformToWindow(QWidget * widget) { - QDialog * dialog = new QDialog(widget->parentWidget()); - widget->setParent(NULL); - createLayout(dialog)->addWidget(widget); - return dialog; -} + ****************************************************************/ + +#include + +#include +#include +#include + +QGridLayout * Widget::createLayout(QWidget * parent) { + QGridLayout * layout = new QGridLayout(parent); + layout->setSpacing(0); + layout->setMargin(0); + return layout; +} + +QDialog * Widget::transformToWindow(QWidget * widget) { + QDialog * dialog = new QDialog(widget->parentWidget()); + widget->setParent(NULL); + createLayout(dialog)->addWidget(widget); + return dialog; +}