Skip to content

Commit

Permalink
More qt6 related changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ri0n committed Mar 15, 2024
1 parent f8711b3 commit d8f0998
Show file tree
Hide file tree
Showing 28 changed files with 138 additions and 93 deletions.
2 changes: 1 addition & 1 deletion src/accountregdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ AccountRegDlg::AccountRegDlg(PsiCon *psi, QWidget *parent) : QDialog(parent), ps

// Fields pane
QVBoxLayout *fields_layout = new QVBoxLayout(ui_.page_fields);
fields_layout->setMargin(0);
fields_layout->setContentsMargins(0, 0, 0, 0);
fields_container_ = new QScrollArea(ui_.page_fields);
fields_layout->addWidget(fields_container_);
fields_container_->setWidgetResizable(true);
Expand Down
2 changes: 1 addition & 1 deletion src/actionlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

#include <QList>
#include <QObject>
#include <QStringList>

class IconAction;
class QString;
class QStringList;

class ActionList : public QObject {
Q_OBJECT
Expand Down
4 changes: 2 additions & 2 deletions src/activeprofiles_dbus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ QString ActiveProfiles::Private::dbusName(QString prof)
QString name = PSIDBUSNAME;
name += ".";
name
+= encodeAlNumD(ApplicationInfo::homeDir(ApplicationInfo::ConfigLocation)).rightRef(qMax(0, 200 - name.size()));
+= encodeAlNumD(ApplicationInfo::homeDir(ApplicationInfo::ConfigLocation)).right(qMax(0, 200 - name.size()));
if (!prof.isEmpty()) {
name += ".";
name += encodeAlNumD(prof).rightRef(qMax(0, 250 - name.size()));
name += encodeAlNumD(prof).right(qMax(0, 250 - name.size()));
}
return name;
}
Expand Down
2 changes: 1 addition & 1 deletion src/chateditproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ChatEditProxy::ChatEditProxy(QWidget *parent) :
QWidget(parent), lineEditEnabled_(false), textEdit_(nullptr), layout_(nullptr)
{
layout_ = new QVBoxLayout(this);
layout_->setMargin(0);
layout_->setContentsMargins(0, 0, 0, 0);
layout_->setSpacing(0);

connect(PsiOptions::instance(), &PsiOptions::optionChanged, this, &ChatEditProxy::optionsChanged);
Expand Down
2 changes: 1 addition & 1 deletion src/chatsplitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void ChatSplitter::updateLayout()
delete layout_;
splitter_ = new QSplitter(this);
layout_ = new QVBoxLayout(this);
layout_->setMargin(0);
layout_->setContentsMargins(0, 0, 0, 0);
layout_->addWidget(splitter_);
splitter_->setOrientation(Qt::Vertical);
splitter_->setVisible(splitterEnabled());
Expand Down
2 changes: 1 addition & 1 deletion src/contactlistitemmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ContactListItemMenu::ContactListItemMenu(ContactListItem *item, ContactListModel
_lblTitle->setPalette(palette);
_lblTitle->setAutoFillBackground(true);
_lblTitle->setAlignment(Qt::AlignCenter);
_lblTitle->setMargin(6);
_lblTitle->setContentsMargins(6, 6, 6, 6);
_lblTitle->setFont(font);

QWidgetAction *waContextMenuTitle = new QWidgetAction(this);
Expand Down
4 changes: 2 additions & 2 deletions src/eventdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ EventDlg::~EventDlg()
void EventDlg::init()
{
QVBoxLayout *vb1 = new QVBoxLayout(this);
vb1->setMargin(4);
vb1->setContentsMargins(4, 4, 4, 4);
vb1->setSpacing(4);

// first row
Expand Down Expand Up @@ -775,7 +775,7 @@ void EventDlg::init()
// http auth transaction id
d->w_http_id = new QWidget(this);
QHBoxLayout *hb_http_id = new QHBoxLayout(d->w_http_id);
hb_http_id->setMargin(0);
hb_http_id->setContentsMargins(0, 0, 0, 0);
hb_http_id->setSpacing(4);
d->le_http_id = new QLineEdit(d->w_http_id);
l = new QLabel(tr("Transaction &identifier:"), d->w_http_id);
Expand Down
4 changes: 2 additions & 2 deletions src/filetransdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ FileRequestDlg::FileRequestDlg(const Jid &jid, PsiCon *psi, PsiAccount *pa, cons

QFrame * hb = new QFrame(this);
QHBoxLayout *hbLayout = new QHBoxLayout(hb);
hbLayout->setMargin(0);
hbLayout->setContentsMargins(0, 0, 0, 0);
d->lb_identity = new QLabel(tr("Identity: "), hb);
hbLayout->addWidget(d->lb_identity);
d->cb_ident = d->psi->accountsComboBox(hb);
Expand Down Expand Up @@ -577,7 +577,7 @@ FileRequestDlg::FileRequestDlg(const QDateTime &ts, FileTransfer *ft, PsiAccount
d->cb_ident = nullptr;
QFrame * hb = new QFrame(this);
QHBoxLayout *hbLayout = new QHBoxLayout(hb);
hbLayout->setMargin(0);
hbLayout->setContentsMargins(0, 0, 0, 0);
d->lb_identity = new QLabel(tr("Identity: "), hb);
hbLayout->addWidget(d->lb_identity);
d->lb_ident = new AccountLabel(hb);
Expand Down
2 changes: 1 addition & 1 deletion src/mainwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ MainWin::MainWin(bool _onTop, bool _asTool, PsiCon *psi) :
#endif
QMenu *viewMenu = new QMenu(tr("View"), this);

d->vb_roster->setMargin(layoutMargin);
d->vb_roster->setContentsMargins(layoutMargin, layoutMargin, layoutMargin, layoutMargin);
d->vb_roster->setSpacing(layoutMargin);

if (d->allInOne) {
Expand Down
2 changes: 1 addition & 1 deletion src/mucconfigdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ MUCConfigDlg::MUCConfigDlg(MUCManager *manager, QWidget *parent) : QDialog(paren
setModal(false);

QVBoxLayout *data_layout = new QVBoxLayout(ui_.pg_general_data);
data_layout->setMargin(0);
data_layout->setContentsMargins(0, 0, 0, 0);

data_container_ = new QScrollArea(ui_.pg_general_data);
data_layout->addWidget(data_container_);
Expand Down
2 changes: 1 addition & 1 deletion src/options/opt_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ QWidget *OptionsTabTree::widget()

QVBoxLayout *layout = new QVBoxLayout(w);
// layout->setSpacing(0);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);

QLabel *lb = new QLabel(tr("Please note: This editor will change the options "
"directly. Pressing Cancel will not revert these changes."),
Expand Down
2 changes: 1 addition & 1 deletion src/options/optionsdlgbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ void OptionsDlgBase::Private::openTab(const QString &id)

QVBoxLayout *vbox = new QVBoxLayout(w);
vbox->setSpacing(0);
vbox->setMargin(0);
vbox->setContentsMargins(0, 0, 0, 0);

tab->setParent(w);
vbox->addWidget(tab);
Expand Down
2 changes: 1 addition & 1 deletion src/options/optionstab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ void OptionsTabWidget::updateCurrent(int index)
QWidget *w = currentWidget();
if (!w2tab[w].initialized) {
QVBoxLayout *vbox = new QVBoxLayout(w);
vbox->setMargin(5);
vbox->setContentsMargins(5, 5, 5, 5);
OptionsTab *opttab = w2tab[w].tab;

QWidget *tab = opttab->widget();
Expand Down
2 changes: 1 addition & 1 deletion src/passdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ PassDialog::PassDialog(const QString &jid, QWidget *parent) : QDialog(parent)
setWindowTitle(tr("Wrong Account Password"));

QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setMargin(6);
mainLayout->setContentsMargins(6, 6, 6, 6);
mainLayout->setSpacing(6);
QHBoxLayout *botLayout = new QHBoxLayout();

Expand Down
2 changes: 1 addition & 1 deletion src/proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ ProxyChooser::ProxyChooser(ProxyManager *m, QWidget *parent) : QWidget(parent)
d->m = m;
connect(m, SIGNAL(settingsChanged()), SLOT(pm_settingsChanged()));
QHBoxLayout *hb = new QHBoxLayout(this);
hb->setMargin(0);
hb->setContentsMargins(0, 0, 0, 0);
hb->setSpacing(4);
d->cb_proxy = new QComboBox(this);
d->cb_proxy->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, d->cb_proxy->sizePolicy().verticalPolicy()));
Expand Down
5 changes: 3 additions & 2 deletions src/psidbusnotifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class iiibiiay {
#endif
}
iiibiiay() { }
static const int id;
static const decltype(qDBusRegisterMetaType<iiibiiay>()) id;

int width;
int height;
int rowstride;
Expand All @@ -78,7 +79,7 @@ class iiibiiay {
};
Q_DECLARE_METATYPE(iiibiiay)

const int iiibiiay::id(qDBusRegisterMetaType<iiibiiay>());
const decltype(qDBusRegisterMetaType<iiibiiay>()) iiibiiay::id{qDBusRegisterMetaType<iiibiiay>()};

QDBusArgument &operator<<(QDBusArgument &a, const iiibiiay &i)
{
Expand Down
2 changes: 1 addition & 1 deletion src/psioptionseditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ PsiOptionsEditor::PsiOptionsEditor(QWidget *parent) : QWidget(parent)

QVBoxLayout *layout = new QVBoxLayout(this);
layout->setSpacing(0);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);

QHBoxLayout *filterLayout = new QHBoxLayout;
le_filter = new QLineEdit(this);
Expand Down
6 changes: 3 additions & 3 deletions src/psirosterwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ PsiRosterWidget::PsiRosterWidget(QWidget *parent) :
contactListPageView_(nullptr), filterPageView_(nullptr), contactListModel_(nullptr), filterModel_(nullptr)
{
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);

stackedWidget_ = new QStackedWidget(this);
Expand All @@ -119,7 +119,7 @@ PsiRosterWidget::PsiRosterWidget(QWidget *parent) :
stackedWidget_->addWidget(contactListPage_);

QVBoxLayout *contactListPageLayout = new QVBoxLayout(contactListPage_);
contactListPageLayout->setMargin(0);
contactListPageLayout->setContentsMargins(0, 0, 0, 0);
contactListPageView_ = new PsiContactListView(contactListPage_);
contactListPageView_->installEventFilter(this);
contactListPageView_->setObjectName("contactListView");
Expand All @@ -132,7 +132,7 @@ PsiRosterWidget::PsiRosterWidget(QWidget *parent) :
stackedWidget_->addWidget(filterPage_);

QVBoxLayout *filterPageLayout = new QVBoxLayout(filterPage_);
filterPageLayout->setMargin(0);
filterPageLayout->setContentsMargins(0, 0, 0, 0);
filterPageLayout->setSpacing(0);

filterEdit_ = new ActionLineEdit(filterPage_);
Expand Down
2 changes: 1 addition & 1 deletion src/registrationdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ RegistrationDlg::RegistrationDlg(const Jid &jid, PsiAccount *pa) : QDialog(nullp
setWindowTitle(tr("Registration: %1").arg(d->jid.full()));

QVBoxLayout *vb1 = new QVBoxLayout(this);
vb1->setMargin(4);
vb1->setContentsMargins(4, 4, 4, 4);
d->lb_top = new QLabel(this);
d->lb_top->setWordWrap(true);
d->lb_top->setFrameStyle(QFrame::Panel | QFrame::Sunken);
Expand Down
11 changes: 6 additions & 5 deletions src/rosteravatarframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
RosterAvatarFrame::RosterAvatarFrame(QWidget *parent) : QFrame(parent), statusMessage_("")
{
ui_.setupUi(this);
layout()->setMargin(
PsiOptions::instance()->getOption("options.ui.contactlist.roster-avatar-frame.avatar.margin").toInt());
auto margin = PsiOptions::instance()->getOption("options.ui.contactlist.roster-avatar-frame.avatar.margin").toInt();
layout()->setContentsMargins(margin, margin, margin, margin);
layout()->setSpacing(0);
setMoodIcon("pep/mood");
setActivityIcon("pep/activities");
Expand Down Expand Up @@ -142,9 +142,10 @@ void RosterAvatarFrame::optionChanged(QString option)
drawAvatar();
else if (option == "options.ui.look.font.contactlist")
setFont();
else if (option == "options.ui.contactlist.roster-avatar-frame.avatar.margin")
layout()->setMargin(PsiOptions::instance()->getOption(option).toInt());
else if (option == "options.extended-presence.tune.publish") {
else if (option == "options.ui.contactlist.roster-avatar-frame.avatar.margin") {
auto margin = PsiOptions::instance()->getOption(option).toInt();
layout()->setContentsMargins(margin, margin, margin, margin);
} else if (option == "options.extended-presence.tune.publish") {
bool publishingEnabled = PsiOptions::instance()->getOption(option).toBool();
ui_.tb_tune->setChecked(publishingEnabled);
}
Expand Down
4 changes: 2 additions & 2 deletions src/showtextdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ShowTextDlg::ShowTextDlg(const QString &fname, bool rich, QWidget *parent) : QDi
}

QVBoxLayout *vb1 = new QVBoxLayout(this);
vb1->setMargin(8);
vb1->setContentsMargins(8, 8, 8, 8);
QTextEdit *te = new QTextEdit(this);
te->setReadOnly(true);
te->setAcceptRichText(rich);
Expand Down Expand Up @@ -71,7 +71,7 @@ ShowTextDlg::ShowTextDlg(const QString &text, bool nonfile, bool rich, QWidget *
setAttribute(Qt::WA_DeleteOnClose);

QVBoxLayout *vb1 = new QVBoxLayout(this);
vb1->setMargin(8);
vb1->setContentsMargins(8, 8, 8, 8);
QTextEdit *te = new QTextEdit(this);
te->setReadOnly(true);
te->setAcceptRichText(rich);
Expand Down
4 changes: 2 additions & 2 deletions src/statusdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ StatusShowDlg::StatusShowDlg(const UserListItem &u) : QDialog(nullptr)
setAttribute(Qt::WA_DeleteOnClose);
// build the dialog
QVBoxLayout *vb = new QVBoxLayout(this);
vb->setMargin(8);
vb->setContentsMargins(8, 8, 8, 8);
PsiTextView *te = new PsiTextView(this);
vb->addWidget(te);
QHBoxLayout *hb = new QHBoxLayout;
Expand Down Expand Up @@ -150,7 +150,7 @@ void StatusSetDlg::init()

// build the dialog
QVBoxLayout *vb = new QVBoxLayout(this);
vb->setMargin(8);
vb->setContentsMargins(8, 8, 8, 8);
QHBoxLayout *hb1 = new QHBoxLayout;
vb->addLayout(hb1);

Expand Down
4 changes: 2 additions & 2 deletions src/tabs/tabdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ TabDlg::TabDlg(TabManager *tabManager, const QString &geometryOption, TabDlgDele
delegate_->tabWidgetCreated(this, tabWidget_);

QVBoxLayout *vert1 = new QVBoxLayout(this);
vert1->setMargin(1);
vert1->setContentsMargins(1, 1, 1, 1);
vert1->addWidget(tabWidget_);

setAcceptDrops(true);
Expand Down Expand Up @@ -254,7 +254,7 @@ void TabDlg::tab_aboutToShowMenu(QMenu *menu)
int tabDlgMetaType = qRegisterMetaType<TabDlg *>("TabDlg*");
for (TabDlg *tabSet : tabManager_->tabSets()) {
QAction *act = sendTo->addAction(tabSet->desiredCaption());
act->setData(QVariant(tabDlgMetaType, &tabSet));
act->setData(QVariant(QMetaType(tabDlgMetaType), &tabSet));
act->setEnabled(tabSet != this);
}
connect(sendTo, SIGNAL(triggered(QAction *)), SLOT(menu_sendTabTo(QAction *)));
Expand Down
2 changes: 1 addition & 1 deletion src/vcardphotodlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ShowPhotoDlg::ShowPhotoDlg(QWidget *parent, QPixmap &pixmap) : QDialog(parent),
toolbar = new QToolBar(this);
toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly);
layout->setSpacing(0);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(toolbar);
layout->addWidget(label);

Expand Down
2 changes: 2 additions & 0 deletions src/whiteboarding/wbdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@
#include "wbdlg.h"

#include "accountlabel.h"
#include "iconaction.h"
#include "iconset.h"
#include "psiaccount.h"
#include "stretchwidget.h"

#include <QActionGroup>
#include <QColorDialog>
#include <QHBoxLayout>
#include <QMessageBox>
Expand Down
4 changes: 2 additions & 2 deletions src/whiteboarding/wbscene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ void WbScene::ungroup()
if (group.nodeName() == "g") {
QDomNodeList children = group.childNodes();

QMatrix groupTransform = WbItem::parseSvgTransform(group.attribute("transform"));
QTransform groupTransform = WbItem::parseSvgTransform(group.attribute("transform"));

for (int i = children.size() - 1; i >= 0; i--) {
QDomElement child = children.at(i).toElement();
if (!child.isNull()) {

if (!groupTransform.isIdentity()) {
// combine the transformations of the group and the child
QMatrix childTransform = WbItem::parseSvgTransform(child.attribute("transform"));
QTransform childTransform = WbItem::parseSvgTransform(child.attribute("transform"));
session_->setAttribute(child, "transform",
WbItem::toSvgTransform(childTransform * groupTransform));
}
Expand Down
Loading

0 comments on commit d8f0998

Please sign in to comment.