19#include <QApplication>
49 QPushButton *cancel_button;
50 QPushButton *ok_button;
68 QString::number(max));
70 l2 =
new QLabel(
_(
"Select tax, luxury and science rates"));
72 l1->setAlignment(Qt::AlignHCenter);
73 l2->setAlignment(Qt::AlignHCenter);
74 main_layout->addWidget(
l2);
75 main_layout->addWidget(
l1);
76 main_layout->addSpacing(20);
78 cancel_button =
new QPushButton(
_(
"Cancel"));
79 ok_button =
new QPushButton(
_(
"Ok"));
82 connect(cancel_button, &QAbstractButton::pressed,
86 connect(ok_button, &QAbstractButton::pressed,
92 main_layout->addWidget(
fcde);
93 main_layout->addSpacing(20);
155 connect(
slider, &QAbstractSlider::valueChanged,
158 label =
new QLabel(QString::number(
mult_to_scale(pmul, val)));
161 hb->addWidget(label);
163 slider->setProperty(
"lab", QVariant::fromValue((
void *) label));
172 connect(
ok_button, &QAbstractButton::pressed,
176 main_layout->addSpacing(20);
191 qvar =
qo->property(
"lab");
192 lab =
reinterpret_cast<QLabel *
>(
qvar.value<
void *>());
193 lab->setText(QString::number(
qo->value()));
248 QRect rect = QApplication::primaryScreen()->availableGeometry();
254 p.setY(p.y() -
trd->height() / 2);
258 if (p.y() +
trd->height() > rect.bottom()) {
259 p.setY(rect.bottom() -
trd->height());
261 if (p.x() +
trd->width() > rect.right()) {
262 p.setX(rect.right() -
trd->width());
344 p.setRenderHint(QPainter::TextAntialiasing);
345 p.setBrush(Qt::SolidPattern);
346 p.setPen(Qt::SolidLine);
357 pix_scaled = pix->scaled(s, Qt::IgnoreAspectRatio,
358 Qt::SmoothTransformation);
365 pix_scaled = pix->scaled(s, Qt::IgnoreAspectRatio,
366 Qt::SmoothTransformation);
373 pix_scaled = pix->scaled(s, Qt::IgnoreAspectRatio,
374 Qt::SmoothTransformation);
375 for (
i = j;
i < 10;
i++) {
389 if (
event->buttons() & Qt::LeftButton) {
390 mouse_x =
static_cast<double>(
event->pos().x());
417 x_mouse =
static_cast<float>(
event->pos().x());
431 if (
event->buttons() & Qt::LeftButton) {
struct canvas int int struct sprite int int int int height
struct canvas int int struct sprite int int int width
void mouseMoveEvent(QMouseEvent *event)
void paintEvent(QPaintEvent *event)
void mousePressEvent(QMouseEvent *event)
fc_double_edge(QWidget *parent=nullptr)
QPixmap * get_pixmap(const QString &id)
static fc_icons * instance()
void slot_cancel_button_pressed()
void slot_set_value(int i)
void slot_ok_button_pressed()
multipler_rates_dialog(QWidget *parent=nullptr)
QList< QSlider * > slider_list
QPushButton * cancel_button
void slot_cancel_button_pressed()
tax_rates_dialog(QWidget *parent=nullptr)
void slot_apply_button_pressed()
void slot_ok_button_pressed()
bool can_client_issue_orders(void)
int get_player_bonus(const struct player *pplayer, enum effect_type effect_type)
const char * government_name_for_player(const struct player *pplayer)
static int scale_to_mult(const struct multiplier *pmul, int scale)
static int mult_to_scale(const struct multiplier *pmul, int val)
Multiplier_type_id multiplier_count(void)
const char * multiplier_name_translation(const struct multiplier *pmul)
bool multiplier_can_be_changed(struct multiplier *pmul, struct player *pplayer)
Multiplier_type_id multiplier_index(const struct multiplier *pmul)
#define multipliers_iterate(_mul_)
#define multipliers_iterate_end
int dsend_packet_player_rates(struct connection *pc, int tax, int luxury, int science)
int send_packet_player_multiplier(struct connection *pc, const struct packet_player_multiplier *packet)
int player_multiplier_target_value(const struct player *pplayer, const struct multiplier *pmul)
static int scale_to_mult(const struct multiplier *pmul, int scale)
void popup_multiplier_dialog(void)
void popup_rates_dialog(void)
void real_multipliers_dialog_update(void *unused)
static int mult_to_scale(const struct multiplier *pmul, int val)
struct sprite int int int int struct sprite int int float scale
struct player_economic economic
struct sprite * get_tax_sprite(const struct tileset *t, Output_type_id otype)